Frame 1
MochiAd.showPreloaderAd({id:"eaed1940d3d34464", res:"800x600"});
var my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
this.menu = my_cm;
fscommand ("showmenu", "fasle");
Instance of Symbol 190 MovieClip in Frame 11
//component parameters
onClipEvent (construct) {
_game_name = "puzzle_freak";
score_var = "_root.heroScore";
}
Frame 120
function turnDark(_mc, u) {
if (isNaN(u)) {
u = 0.05;
}
_mc.filters = [new flash.filters.ColorMatrixFilter([u, u, u, 0, 0, u, u, u, 0, 0, u, u, u, 0, 0, 0, 0, 0, 1, 0])];
}
function turnColorful(_mc) {
_mc.filters = [new flash.filters.ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0])];
}
function getSound(obj) {
if (soundOn) {
return(true);
}
if (soundOn == false) {
return(false);
}
}
function getMusic(obj) {
if (musicOn) {
return(true);
}
if (musicOn == false) {
return(false);
}
}
function setSound(obj) {
if (soundOn == false) {
soundOn = true;
obj.gotoAndStop(1);
} else if (soundOn) {
soundOn = false;
obj.gotoAndStop(2);
}
}
function setMusic(obj) {
if (musicOn == false) {
bgMusic_snd.setVolume(100);
musicOn = true;
obj.gotoAndStop(1);
} else if (musicOn) {
bgMusic_snd.setVolume(0);
musicOn = false;
obj.gotoAndStop(2);
}
}
function musicStop(Void) {
bgMusic_snd.stop();
}
function musicStart(musicName) {
trace(musicName);
bgMusic_snd.attachSound(musicName);
bgMusic_snd.start(0, 10000);
}
function soundStart(soundName) {
if (soundOn) {
allSound_snd.attachSound(soundName);
allSound_snd.start();
}
}
function game_setDifficulty(num) {
game_level = num;
menu_difficulty.mc_1.gotoAndStop(1);
menu_difficulty.mc_2.gotoAndStop(1);
menu_difficulty.mc_3.gotoAndStop(1);
menu_difficulty["mc_" + game_level].gotoAndStop(2);
set_level(num);
}
function game_getDifficulty(obj) {
obj.mc1.gotoAndStop(1);
obj.mc2.gotoAndStop(1);
obj.mc3.gotoAndStop(1);
obj["mc_" + game_level].gotoAndStop(2);
menu_difficulty = obj;
set_level(game_level);
}
function game_setQuality(num) {
game_quality = num;
menu_quality.mc_1.gotoAndStop(1);
menu_quality.mc_2.gotoAndStop(1);
menu_quality.mc_3.gotoAndStop(1);
menu_quality.mc_4.gotoAndStop(1);
menu_quality["mc_" + game_quality].gotoAndStop(2);
if (num == 1) {
_quality = "LOW";
} else if (num == 2) {
_quality = "MEDIUM";
} else if (num == 4) {
_quality = "BEST";
} else {
_quality = "HIGH";
}
}
function game_getQuality(obj) {
if (_quality == "LOW") {
game_quality = 1;
} else if (_quality == "MEDIUM") {
game_quality = 2;
} else if (_quality == "BEST") {
game_quality = 4;
} else {
game_quality = 3;
}
obj.mc1.gotoAndStop(1);
obj.mc2.gotoAndStop(1);
obj.mc3.gotoAndStop(1);
obj.mc4.gotoAndStop(1);
obj["mc_" + game_quality].gotoAndStop(2);
menu_quality = obj;
}
stop();
var soundOn = true;
var musicOn = true;
var sound_mc = _root.createEmptyMovieClip("sound_mc", _root.getNextHighestDepth());
var allSound_snd = new Sound(sound_mc);
var music_mc = _root.createEmptyMovieClip("music_mc", _root.getNextHighestDepth());
var bgMusic_snd = new Sound(music_mc);
var menu_difficulty;
var game_quality;
var menu_quality;
fscommand ("allowscale", false);
fscommand ("showmenu", false);
var game = this;
var intervalId;
var map_array = [[], ["puzzle"], ["puzzle"], ["puzzle"], ["random"], ["puzzle"], ["mov", 2], ["puzzle"], ["puzzle"], ["add", -1], ["puzzle"], ["puzzle"], ["puzzle"], ["add", 1], ["puzzle"], ["random"], ["puzzle"], ["puzzle"], ["mov", 4], ["puzzle"], ["mov", -3], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["add", 1], ["mov", 4], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["random"], ["puzzle"], ["puzzle"], ["puzzle"], ["add", 1], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["add", 1], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["mov", -2], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], ["puzzle"], []];
var gameArr = [["_getting_out", [70], "Get the yellow car out of the parking lot to the exit. Use your mouse button to click and drag the cars around.", 5], ["_different", [70], "Find 5 differences between the two pictures. Mouse point and click to select a difference.", 5], ["_ice_room", [70, 100], "Get your space ship to the space station. Use arrow keys to fly your spaceship around the planets.", 5], ["_memory", [40], "Look at the pictures and try to remember what they are and their location.", 0], ["_find", [70], "Find the listed items in the picture.", 5], ["_order", [150], "Click on the image and rearrange the pieces to match the original picture.", 5], ["_hanoi", [60, 90, 180, 300], "Move the donuts from the left hand side stick to the right hand side. Smaller donuts can only go on larger donuts. Mouse point and click.", 4], ["_jigsaw", [180], "Click on the jigsaw puzzle to start and rearrange the pieces to match the original picture. Mouse point, click and drag.", 5], ["_maze", [35], "Try to get to the exit flag. Arrow keys to move around.", 0], ["_lights", [150], "Make all the dogs stand up. Mouse point and click to change their position.", 0], ["_water", [90], "", 3], ["_3board", [40], "Try to keep your eye on the container with the dice.", 0], ["_move_together", [90, 120, 210], "Position all the blue balls over the yellow balls. You cannot hit the spiked sticks. Arrow keys to move around.", 5], ["_jump_chess", [60, 120, 180, 240, 300], "Clear all the octagonal screws so that only one is remaining. Screws can only be removed by jumping one over another.", 5]];
Instance of Symbol 151 MovieClip in Frame 120
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Frame 121
function gameStart() {
totalPlaying = 4;
var _local2 = 0;
while (_local2 < totalChar) {
var _local3 = this["selectChar" + _local2].getInfo();
strArr[_local2] = _local3[0];
if (_local3[0] == "not playing") {
totalPlaying--;
}
nameArr[_local2] = _local3[1];
if (_local3[1] == "") {
this["selectChar" + _local2].yourNamePlease_mc.gotoAndPlay(2);
return(undefined);
}
enemyIqRateArr[_local2] = rateArr[_local3[2]];
_local2++;
}
currentCombo.close();
if (totalPlaying <= 0) {
selectAPlayer_mc.gotoAndPlay(2);
return(undefined);
}
trace("strArr=" + strArr);
trace("nameArr=" + nameArr);
trace("enemyIqRateArr=" + enemyIqRateArr);
stopAllSounds();
gotoAndPlay ("main");
}
title_mc.stop();
stop();
var currentCombo;
var totalChar = 4;
var nameArr = ["Bird", "Albert", "Chubchub", "Doc"];
var i = 0;
while (i < totalChar) {
this["char_mc" + i].gotoAndStop(i + 1);
this["selectChar" + i].charName = nameArr[i];
i++;
}
selectChar0.com_humanIndex = 1;
selectChar2.com_humanIndex = 2;
selectChar3.com_humanIndex = 2;
var strArr = ["enemy", "enemy", "enemy", "enemy"];
var rateArr = [0.4, 0.5, 0.8];
var enemyIqRateArr = new Array(4);
var totalPlaying;
comboHitRec.useHandCursor = false;
comboHitRec.onPress = function () {
currentCombo.close();
};
okBtn.onRollOver = function () {
currentCombo.close();
};
okBtn.onRelease = function () {
gameStart();
};
Frame 122
var i = 0;
while (i < totalChar) {
if (strArr[i] == "not playing") {
game["pad" + i]._visible = false;
turnDark(game["char_man" + i]);
}
i++;
}
Frame 123
function getSound(obj) {
if (soundOn) {
return(true);
}
if (soundOn == false) {
return(false);
}
}
function getMusic(obj) {
if (musicOn) {
return(true);
}
if (musicOn == false) {
return(false);
}
}
function setSound(obj) {
if (soundOn == false) {
soundOn = true;
obj.gotoAndStop(1);
} else if (soundOn) {
soundOn = false;
obj.gotoAndStop(2);
}
}
function setMusic(obj) {
if (musicOn == false) {
bgMusic_snd.setVolume(100);
musicOn = true;
obj.gotoAndStop(1);
} else if (musicOn) {
bgMusic_snd.setVolume(0);
musicOn = false;
obj.gotoAndStop(2);
}
}
function musicStop(Void) {
bgMusic_snd.stop();
}
function musicStart(musicName) {
trace(musicName);
bgMusic_snd.attachSound(musicName);
bgMusic_snd.start(0, 10000);
}
function soundStart(soundName) {
if (soundOn) {
allSound_snd.attachSound(soundName);
allSound_snd.start();
}
}
function game_setDifficulty(num) {
game_level = num;
menu_difficulty.mc_1.gotoAndStop(1);
menu_difficulty.mc_2.gotoAndStop(1);
menu_difficulty.mc_3.gotoAndStop(1);
menu_difficulty["mc_" + game_level].gotoAndStop(2);
set_level(num);
}
function game_getDifficulty(obj) {
obj.mc1.gotoAndStop(1);
obj.mc2.gotoAndStop(1);
obj.mc3.gotoAndStop(1);
obj["mc_" + game_level].gotoAndStop(2);
menu_difficulty = obj;
set_level(game_level);
}
function game_setQuality(num) {
game_quality = num;
menu_quality.mc_1.gotoAndStop(1);
menu_quality.mc_2.gotoAndStop(1);
menu_quality.mc_3.gotoAndStop(1);
menu_quality.mc_4.gotoAndStop(1);
menu_quality["mc_" + game_quality].gotoAndStop(2);
if (num == 1) {
_quality = "LOW";
} else if (num == 2) {
_quality = "MEDIUM";
} else if (num == 4) {
_quality = "BEST";
} else {
_quality = "HIGH";
}
}
function game_getQuality(obj) {
if (_quality == "LOW") {
game_quality = 1;
} else if (_quality == "MEDIUM") {
game_quality = 2;
} else if (_quality == "BEST") {
game_quality = 4;
} else {
game_quality = 3;
}
obj.mc1.gotoAndStop(1);
obj.mc2.gotoAndStop(1);
obj.mc3.gotoAndStop(1);
obj.mc4.gotoAndStop(1);
obj["mc_" + game_quality].gotoAndStop(2);
menu_quality = obj;
}
function switchChar() {
currentChar.mc.pad.turns = (currentChar.turns = 0);
currentChar.mc.pad.prevFrame();
if ((++currentCharId) >= totalPlayer) {
currentCharId = 0;
}
currentChar = charArr[currentCharId];
currentChar.mc.pad.nextFrame();
trace("------------------");
trace(currentChar);
currentChar.mc.swapDepths(charArea.getNextHighestDepth());
if (totalPlayer <= 1) {
if (currentChar.type == "hero") {
dice.enabled = true;
clearInterval(intervalId);
intervalId = setInterval(function () {
dice.showInfo();
}, 4000);
} else {
enemyRoll();
}
currentChar.turns = 0;
currentChar.mc.pad.turns = 0;
} else {
currentChar.turns = 3;
currentChar.mc.pad.turns = 3;
mainInfo_pad.show(currentChar.name + "'s Turn!");
mainInfo_pad.onEffect = function () {
trace("type=" + currentChar.type);
if (currentChar.type == "hero") {
dice.enabled = true;
clearInterval(intervalId);
intervalId = setInterval(function () {
dice.showInfo();
}, 4000);
} else {
enemyRoll();
}
};
}
}
function enemyRoll() {
currentChar.turns--;
trace("turns=" + currentChar.turns);
if (currentChar.turns < 0) {
currentChar.turns = 0;
}
currentChar.mc.pad.turns = currentChar.turns;
game["char_man" + currentChar.id].play();
}
function disorder(arr) {
var _local4 = arr.length;
var _local3;
var _local5;
var _local1 = 0;
while (_local1 < _local4) {
_local3 = random(_local4);
_local5 = arr[_local3];
arr[_local3] = arr[_local1];
arr[_local1] = _local5;
_local1++;
}
}
stop();
dice.enabled = false;
clearInterval(intervalId);
var soundOn = true;
var musicOn = true;
var sound_mc = _root.createEmptyMovieClip("sound_mc", _root.getNextHighestDepth());
var allSound_snd = new Sound(sound_mc);
var music_mc = _root.createEmptyMovieClip("music_mc", _root.getNextHighestDepth());
var bgMusic_snd = new Sound(music_mc);
var menu_difficulty;
var game_quality;
var menu_quality;
musicStart("bgMusic.mp3");
var gameId = gameArr.length;
var charArr = new Array();
var totalPlayer = 0;
var char_mc;
var i = 0;
while (i < totalChar) {
char_mc = charArea.attachMovie("char_mc", ("char" + i) + "_mc", i);
char_mc.gotoAndStop(i + 1);
char_mc.pad = this["pad" + i];
char_mc.pad.score = 0;
char_mc.pad.name = nameArr[i];
char_mc.pad.turns = 0;
i++;
}
var map = new Map(map_mc, map_array);
var char;
var firstHero = undefined;
var i = 0;
while (i < totalChar) {
if (strArr[i] == "not playing") {
charArea[("char" + i) + "_mc"]._visible = false;
} else {
totalPlayer++;
charArr.push((char = (this["char" + i] = new Char(charArea[("char" + i) + "_mc"], map, strArr[i], i, enemyIqRateArr[i], nameArr[i]))));
if (char.type == "hero") {
char.startGame = function (Void) {
if ((++gameId) >= gameArr.length) {
gameId = 0;
disorder(gameArr);
}
pfw.show(this, gameArr[gameId]);
};
} else {
char.startGame = function () {
if ((Math.random() < this.iqRate) && ((this.turns > 0) || (totalPlayer <= 1))) {
var _local2 = random(70) + 100;
if (this.iqRate == rateArr[2]) {
_local2 = _local2 + 40;
}
this.update(_local2);
if (totalPlayer <= 1) {
enemyRoll();
} else {
mainInfo_pad.show(this.name + "'s Turn Again!");
mainInfo_pad.onEffect = function () {
enemyRoll();
};
}
} else {
this.update(0);
switchChar();
}
};
}
char.onUpdate = function (score) {
this.mc.pad.score = int(this.totalScore / this.score_array.length);
};
char.onMov = function (enemy, success) {
if (success) {
this.turns = 0;
this.mc.pad.turns = 0;
if (firstHero == undefined) {
firstHero = this;
}
charArr.splice(currentCharId, 1);
currentCharId--;
if ((--totalPlayer) > 0) {
if (this.type == "hero") {
var _local2 = 0;
while (_local2 < totalPlayer) {
if (charArr[_local2].type == "hero") {
switchChar();
return(undefined);
}
_local2++;
}
gotoAndStop ("gameover");
}
switchChar();
} else {
gotoAndStop ("gameover");
}
} else if (this.turns <= 0) {
switchChar();
} else {
mainInfo_pad.show(this.name + "'s Turn Again!");
if (this.type == "hero") {
mainInfo_pad.onEffect = function () {
dice.enabled = true;
clearInterval(intervalId);
intervalId = setInterval(function () {
dice.showInfo();
}, 4000);
};
} else {
mainInfo_pad.onEffect = function () {
enemyRoll();
};
}
}
};
}
i++;
}
var currentCharId = random(totalPlayer);
pfw.onGameOver = function (char, score) {
trace("score=" + score);
char.update(score);
if ((score == 0) || (char.turns <= 0)) {
switchChar();
} else {
mainInfo_pad.show(char.name + "'s Turn Again!");
mainInfo_pad.onEffect = function () {
dice.enabled = true;
clearInterval(intervalId);
intervalId = setInterval(function () {
dice.showInfo();
}, 4000);
};
}
};
pfw.onTimeUp = function (char) {
trace("timeup");
char.update(0);
switchChar();
};
var currentChar;
switchChar();
if (currentChar.type == "hero") {
mainInfo_pad.onEffect = function () {
dice.enabled = true;
clearInterval(intervalId);
dice.showInfo();
intervalId = setInterval(function () {
dice.showInfo();
}, 4000);
};
}
dice.onPress = function () {
clearInterval(intervalId);
this.enabled = false;
currentChar.turns--;
trace("turns=" + currentChar.turns);
if (currentChar.turns < 0) {
currentChar.turns = 0;
}
currentChar.mc.pad.turns = currentChar.turns;
game["char_man" + currentChar.id].play();
};
dice.onRoll = function (num) {
currentChar.mov(num);
};
Frame 124
charArr = new Array();
var hero;
var heroScore;
var win = true;
var i = 0;
while (i < totalChar) {
charArr.push(this["char" + i]);
switch (strArr[i]) {
case "hero" :
hero = this["char" + i];
break;
case "not playing" :
this["iqNumTxt" + i]._visible = false;
turnDark(this["iqBar" + i]);
turnDark(this[("head" + i) + "_mc"]);
}
i++;
}
if ((firstHero.type == "hero") || (hero == undefined)) {
hero = firstHero;
}
submit_mc.charName = hero.name;
heroScore = int(hero.totalScore / hero.score_array.length);
heroScoreTxt.text = heroScore;
if (hero.type != "hero") {
heroScore = 0;
}
var i = 0;
while (i < totalChar) {
if (strArr[i] == "not playing") {
} else {
var char = charArr[i];
var score = int(char.totalScore / char.score_array.length);
var iqBar = this["iqBar" + i];
iqBar._height = score * 0.8;
this["iqNumTxt" + i]._y = (iqBar._y - iqBar._height) - 20;
this["iqNumTxt" + i].txt = score;
if (char != hero) {
if (heroScore < score) {
win = false;
}
}
}
i++;
}
if (win) {
charResult_mc.gotoAndStop((hero.id * 2) + 1);
} else {
charResult_mc.gotoAndStop((hero.id * 2) + 2);
}
Instance of Symbol 190 MovieClip "submit_mc" in Frame 124
//component parameters
onClipEvent (construct) {
_game_name = "puzzle_freak";
score_var = "_root.heroScore";
}
Symbol 71 MovieClip [card_mc] Frame 1
function open(Void) {
this.gotoAndPlay(2);
}
function close(Void) {
this.gotoAndPlay(9);
}
var id;
var onOpen;
var onClose;
Symbol 71 MovieClip [card_mc] Frame 5
card_pic.gotoAndStop(id);
Symbol 71 MovieClip [card_mc] Frame 8
stop();
onOpen();
Symbol 71 MovieClip [card_mc] Frame 15
stop();
onClose();
Symbol 77 MovieClip [_memory_help] Frame 1
stop();
_parent._parent.keys_mc._visible = false;
var mouse_mc = _parent._parent.mouse_mc;
var total = 12;
var i = 0;
while (i < total) {
this["card_" + i]._visible = false;
i++;
}
i = 0;
card0.id = 6;
card0.stop();
this.onEnterFrame = function () {
var _local2 = this["card_" + i];
_local2.id = i + 1;
_local2._visible = true;
_local2.open();
if ((++i) >= total) {
delete this.onEnterFrame;
_local2.onOpen = function () {
play();
};
}
};
Symbol 77 MovieClip [_memory_help] Frame 20
stop();
i = 0;
this.onEnterFrame = function () {
var _local2 = this["card_" + i];
_local2.id = i + 1;
_local2._visible = true;
_local2.close();
if ((++i) >= total) {
delete this.onEnterFrame;
_local2.onClose = function () {
play();
};
}
};
Symbol 77 MovieClip [_memory_help] Frame 43
stop();
card0.open();
card0.onOpen = function () {
play();
};
Symbol 77 MovieClip [_memory_help] Frame 70
stop();
mouse_mc.play();
card_5.open();
card_5.onOpen = function () {
play();
};
Symbol 77 MovieClip [_memory_help] Frame 71
stop();
_parent._parent.done_mc._visible = true;
Symbol 142 MovieClip Frame 1
this._xscale = _parent.dXscale * 100;
this._yscale = _parent.dYscale * 100;
gotoAndStop(_parent._currentframe);
Symbol 144 MovieClip Frame 1
this._xscale = _parent.dXscale * 100;
this._yscale = _parent.dYscale * 100;
Symbol 147 MovieClip [_jigsaw_help] Frame 1
_parent._parent.keys_mc._visible = false;
_parent._parent.nextFrame();
Symbol 1028 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function showPreloaderAd(options) {
var _local29 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812};
options = _parseOptions(options, _local29);
var _local15 = options.clip;
var _local25 = 11000;
var _local28 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
return(undefined);
}
_local15.stop();
var mc = _local15._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local16 = _getRes(options);
var _local5 = _local16[0];
var _local14 = _local16[1];
mc._x = _local5 * 0.5;
mc._y = _local14 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local5 * -0.5;
chk._y = _local14 * -0.5;
var _local8 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local8._x = 10;
_local8._y = _local14 - 20;
var _local24 = options.color;
delete options.color;
var _local21 = options.background;
delete options.background;
var _local26 = options.outline;
delete options.outline;
var _local6 = _local8.createEmptyMovieClip("_outline", 1);
_local6.beginFill(_local21);
_local6.moveTo(0, 0);
_local6.lineTo(_local5 - 20, 0);
_local6.lineTo(_local5 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
_local6.endFill();
var _local4 = _local8.createEmptyMovieClip("_inside", 2);
_local4.beginFill(_local24);
_local4.moveTo(0, 0);
_local4.lineTo(_local5 - 20, 0);
_local4.lineTo(_local5 - 20, 10);
_local4.lineTo(0, 10);
_local4.lineTo(0, 0);
_local4.endFill();
_local4._xscale = 0;
var _local7 = _local8.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local26, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local5 - 20, 0);
_local7.lineTo(_local5 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local25;
chk.ad_timeout = _local28;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
var _local15 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd"};
options = _parseOptions(options, _local15);
var _local6 = options.clip;
var _local12 = 11000;
var _local14 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
return(undefined);
}
_local6.stop();
var mc = _local6._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local7 = _getRes(options);
var _local16 = _local7[0];
var _local13 = _local7[1];
mc._x = _local16 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local12;
chk.ad_timeout = _local14;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local25);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = "1.4";
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = "1.4";
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 1029 MovieClip [__Packages.Game] Frame 0
class Game
{
var gameName, timeArr, instruction, totalStage, stageNum, time;
function Game (arr) {
arr = arr.slice();
gameName = arr[0];
timeArr = arr[1].slice();
instruction = arr[2];
totalStage = arr[3];
stageNum = random(totalStage) + 1;
nextStage();
}
function nextStage(Void) {
if (totalStage == 0) {
stageNum = 0;
time = timeArr[0];
} else {
if ((++stageNum) > totalStage) {
stageNum = 1;
}
if (stageNum > timeArr.length) {
time = timeArr[timeArr.length - 1];
} else {
time = timeArr[stageNum - 1];
}
}
trace((((("game=" + gameName) + ",stageNum=") + stageNum) + ",time=") + time);
}
}
Symbol 1030 MovieClip [__Packages.Char] Frame 0
class Char
{
var mc, frame, map, mapNode, type, id, iqRate, name, turns, totalScore, score_array, onUpdate, onMov, startGame, step, stween;
function Char (_mc, _map, _type, _id, _iqRate, name1) {
mc = _mc;
frame = mc._currentframe;
mc.char = this;
map = _map;
mapNode = map.node0;
type = _type;
id = _id;
iqRate = _iqRate;
name = name1;
turns = 0;
mc._x = mapNode.x;
mc._y = mapNode.y;
totalScore = 0;
score_array = new Array();
}
function update(score) {
totalScore = totalScore + int((score / 2) + 75);
score_array.push(score);
onUpdate(totalScore);
}
function run(str, value) {
trace((("str=" + str) + ",value=") + value);
switch (str) {
case "" :
onMov(this, mapNode == map.tailNode);
break;
case "mov" :
mov(value);
break;
case "add" :
if (mc._parent._parent.totalPlayer > 1) {
if (value < 0) {
mc.pad.turns = (turns = 0);
} else {
mc.pad.turns = (turns = turns + value);
}
}
onMov(this, mapNode == map.tailNode);
break;
case "puzzle" :
startGame();
}
}
function mov(_step) {
if (mapNode.char == this) {
mapNode.char = undefined;
}
step = _step;
if (step > 0) {
if (mapNode == map.tailNode) {
mov(-step);
return(false);
}
mapNode = mapNode.nextNode;
} else if (step < 0) {
if (mapNode == map.headNode) {
mov(0);
return(false);
}
mapNode = mapNode.prevNode;
} else {
mapNode.char = this;
mapNode.effect();
if (mapNode.nodeType == "random") {
var _local2 = ["mov", "add", "puzzle"];
mc.str = _local2[random(_local2.length)];
mc.value = (random(2) - 0.5) * 2;
} else {
mc.str = mapNode.nodeType;
mc.value = mapNode.value;
}
switch (mc.str) {
case "mov" :
if (mc.value > 0) {
mc.showInfo((("Move forwards\r" + mc.value) + " step") + ((mc.value == 1) ? "!" : "s!"));
} else {
mc.showInfo((("Move backwards\r" + (-mc.value)) + " step") + ((mc.value == -1) ? "!" : "s!"));
}
break;
case "add" :
if (mc.value > 0) {
mc.showInfo("Extra turn!");
} else {
mc.showInfo("Lose a turn!");
}
break;
default :
mapNode.onEffect = function (char) {
char.run(char.mc.str, char.mc.value);
};
return(false);
}
mc.onEffect = function () {
this.char.run(this.str, this.value);
};
return(false);
}
stween = new STween(mc, mapNode.x, mapNode.y, mapNode.scale);
stween.onMov = function (mc) {
var _local1 = mc.char.step;
if (_local1 > 0) {
_local1--;
} else {
_local1++;
}
mc.swapDepths((mc._xscale * 100) + random(100));
mc.char.mov(_local1);
};
return(true);
}
function win(char, step) {
mapNode.char = this;
char.mov(step);
}
function toString(Void) {
return((type + ",") + id);
}
}
Symbol 1031 MovieClip [__Packages.MapNode] Frame 0
class MapNode
{
var mc, nodeType, value, x, y, scale;
function MapNode (_mc, _nodeType, _value) {
mc = _mc;
mc.mapNode = this;
if (_nodeType == undefined) {
_nodeType = "";
}
if (_value == undefined) {
_value = "";
}
nodeType = _nodeType;
value = _value;
x = mc._parent._x + mc._x;
y = mc._parent._y + mc._y;
scale = mc._xscale;
}
function effect(Void) {
mc.effect();
mc.onEffect = function () {
this.mapNode.onEffect(this.mapNode.char);
};
}
}
Symbol 1032 MovieClip [__Packages.Map] Frame 0
class Map
{
var total, headNode, node0, tailNode;
function Map (map_mc, map_array) {
total = map_array.length;
var _local3;
var _local4 = null;
var _local2 = 0;
while (_local2 < total) {
_local3 = (this["node" + _local2] = new MapNode(map_mc["node" + _local2], map_array[_local2][0], map_array[_local2][1]));
_local3.prevNode = _local4;
_local4.nextNode = _local3;
_local4 = _local3;
_local2++;
}
headNode = node0;
tailNode = this["node" + (total - 1)];
trace(total + " nodes total");
}
}
Symbol 1033 MovieClip [__Packages.STween] Frame 0
class STween
{
var mc, xt, yt, u, scalet, intervalId, dx, dy, dScale, onMov;
function STween (_mc, _xt, _yt, _scalet, _u) {
mc = _mc;
if (mc.stween != undefined) {
mc.stween.stopMov();
}
mc.stween = this;
xt = _xt;
yt = _yt;
if (isNaN(_scalet)) {
_scalet = 100;
}
if (isNaN(_u)) {
_u = 0.5;
}
u = _u;
scalet = _scalet;
intervalId = setInterval(this, "mov", 33);
}
function mov(Void) {
if (mc._x == undefined) {
clearInterval(intervalId);
} else {
dx = xt - mc._x;
dy = yt - mc._y;
dScale = scalet - mc._xscale;
mc._x = mc._x + (dx * u);
mc._y = mc._y + (dy * u);
mc._yscale = (mc._xscale = mc._xscale + (dScale * u));
if ((((dx * dx) + (dy * dy)) + (dScale * dScale)) < 1) {
clearInterval(intervalId);
mc._x = xt;
mc._y = yt;
mc._yscale = (mc._xscale = scalet);
onMov(mc);
}
}
}
function stopMov(Void) {
clearInterval(intervalId);
mc.stween = undefined;
}
}
Symbol 1034 MovieClip [__Packages.Timer] Frame 0
class Timer
{
var mc, w0, t0, t, totalTime, intervalId, onTimeUp;
function Timer (_mc) {
mc = _mc;
mc.bug_mc._x = (w0 = mc.bar._width);
}
function timeStart(_t) {
t0 = getTimer();
t = (totalTime = _t * 1000);
intervalId = setInterval(this, "run", 33);
}
function run(Void) {
if (mc._x == undefined) {
clearInterval(intervalId);
} else {
var _local2 = getTimer();
t = t - (_local2 - t0);
if (t <= 0) {
timeUp();
}
t0 = _local2;
mc.bug_mc._x = (mc.bar._width = mc.bar._width + ((((t / totalTime) * w0) - mc.bar._width) * 0.2));
}
}
function getTime(Void) {
return(t / 1000);
}
function timeStop(Void) {
mc.bug_mc._x = (mc.bar._width = (t / totalTime) * w0);
clearInterval(intervalId);
}
function timeUp(Void) {
mc.bug_mc._x = (mc.bar._width = 0);
clearInterval(intervalId);
onTimeUp(totalTime / 1000);
}
function addTime(dTime) {
t = t + (dTime * 1000);
if (t > totalTime) {
t = totalTime;
} else if (t < 0) {
t = 0;
}
}
}
Symbol 1035 MovieClip [__Packages.Hanoi] Frame 0
class Hanoi
{
var isWin, totalRing, arr, onWin;
function Hanoi (_totalRing) {
isWin = false;
totalRing = _totalRing;
arr = [[totalRing], [totalRing], [totalRing]];
var _local2 = totalRing - 1;
while (_local2 >= 0) {
arr[0].push(_local2);
_local2--;
}
}
function getTotal(stickId) {
return(arr[stickId].length - 1);
}
function getTopRing(stickId) {
return(arr[stickId][arr[stickId].length - 1]);
}
function movAble(stickId1, stickId2) {
return(getTopRing(stickId1) < getTopRing(stickId2));
}
function mov(stickId1, stickId2) {
arr[stickId2].push(arr[stickId1].pop());
if ((stickId2 == 2) && (arr[stickId2].length == (totalRing + 1))) {
win();
}
}
function win(Void) {
isWin = true;
onWin();
}
function toString(Void) {
return((((arr[0] + newline) + arr[1]) + newline) + arr[2]);
}
}
Symbol 1036 MovieClip [__Packages.Jigsaw] Frame 0
class Jigsaw
{
var mArea, mName, userMouse, varOrder, w, h, mMap, dw, dh, ddw, ddh, dragLeft, dragTop, dragRight, dragBottom;
function Jigsaw (_mArea, _mName, pic_mc, _userMouse, picW, picH, _dw, _dh, _ddw, _ddh, wOrShape_array, _h) {
mArea = _mArea;
mName = _mName;
userMouse = _userMouse;
varOrder = 0;
if (typeof(wOrShape_array) == "number") {
w = wOrShape_array;
h = _h;
var _local11 = w;
var _local18 = 2 * h;
var _local7 = new Array(_local18 + 1);
var _local5 = 0;
while (_local5 <= _local18) {
_local7[_local5] = new Array(_local11 + 1);
var _local4 = 0;
while (_local4 <= _local11) {
if ((((_local5 == 0) || (_local5 == _local18)) || ((_local4 == 0) && ((_local5 % 2) == 1))) || (_local4 == _local11)) {
_local7[_local5][_local4] = 0;
} else {
_local7[_local5][_local4] = (2 * random(2)) - 1;
}
_local4++;
}
_local5++;
}
} else {
var _local7 = wOrShape_array;
w = _local7[0].length - 1;
h = (_local7.length - 1) / 2;
}
mMap = new Array(h);
var _local3 = 0;
while (_local3 < h) {
mMap[_local3] = new Array(w);
var _local2 = 0;
while (_local2 < w) {
mMap[_local3][_local2] = "";
_local2++;
}
_local3++;
}
mArea.jigsaw = this;
dw = picW / w;
dh = picH / h;
var _local12 = dw / _dw;
var _local17 = dh / _dh;
ddw = _ddw * _local12;
ddh = _ddh * _local17;
mArea._x = dw / 2;
mArea._y = dh / 2;
var _local9 = dw + (ddw * 2);
var _local10 = dh + (ddh * 2);
var _local19 = new flash.display.BitmapData(picW, picH, false);
_local19.draw(pic_mc);
_local3 = 0;
while (_local3 < h) {
var _local2 = 0;
while (_local2 < w) {
var _local6 = mArea.attachMovie(mName, (("m" + _local3) + "_") + _local2, (_local3 * w) + _local2, {ox:_local2, oy:_local3, _x:_local2 * dw, _y:_local3 * dh, dXscale:_local12, dYscale:_local17});
var _local8 = new flash.display.BitmapData(_local9, _local10, false);
_local8.copyPixels(_local19, new flash.geom.Rectangle((_local2 * dw) - ddw, (_local3 * dh) - ddh, _local9, _local10), new flash.geom.Point(0, 0));
_local6.gotoAndStop((((41 - _local7[(_local3 * 2) + 1][_local2]) - (_local7[_local3 * 2][_local2] * 3)) + (_local7[(_local3 * 2) + 1][_local2 + 1] * 9)) + (_local7[(_local3 * 2) + 2][_local2] * 27));
_local6.bmp_mc.attachBitmap(_local8, 0);
_local6.bmp_mc._x = (-_local9) / 2;
_local6.bmp_mc._y = (-_local10) / 2;
_local6.filters = [new flash.filters.BevelFilter(2, 85, 16777215, 0.5, 0, 0.5, 10, 10, 2, 1)];
_local2++;
}
_local3++;
}
}
function disabledM(m) {
m.shape.enabled = false;
delete m.shape.onPress;
delete m.shape.onRelease;
delete m.shape.onRollOver;
delete m.shape.onRollOut;
delete m.shape.onReleaseOutside;
m.dragArea.enabled = false;
delete m.dragArea.onPress;
delete m.dragArea.onRelease;
delete m.dragArea.onRollOver;
delete m.dragArea.onRollOut;
delete m.dragArea.onReleaseOutside;
userMouse.gotoAndStop("blank");
}
function disorder(stageW, stageH) {
userMouse.gotoAndStop("blank");
userMouse.onEnterFrame = function () {
this._x = this._parent._xmouse;
this._y = this._parent._ymouse;
};
var _local10 = dw * w;
var _local13 = dh * h;
var _local12 = ((stageW - _local10) - dw) / 2;
var _local11 = ((stageH - _local13) - dh) / 2;
dragLeft = (mArea._x - _local12) - dw;
dragTop = (mArea._y - _local11) - dh;
dragRight = ((mArea._x + _local10) + _local12) - dw;
dragBottom = ((mArea._y + _local13) + _local11) - dh;
var _local9 = (((dragRight - dragLeft) - (dw * w)) - dw) / 2;
var _local8 = 0;
while (_local8 < h) {
var _local6 = 0;
while (_local6 < w) {
varOrder--;
var _local2 = mArea[(("m" + _local8) + "_") + _local6];
new mx.transitions.Tween(_local2, "_x", mx.transitions.easing.Strong.easeOut, _local2._x, ((random(2) * ((_local10 + _local9) + dw)) + dragLeft) + random(_local9), 6, false);
new mx.transitions.Tween(_local2, "_y", mx.transitions.easing.Strong.easeOut, _local2._y, random(dragBottom - dragTop) + dragTop, 6, false);
new mx.transitions.Tween(_local2, "_rotation", mx.transitions.easing.Strong.easeOut, 0, random(4) * 90, 6, false);
_local2.shape.onRollOver = function () {
this._parent._parent.jigsaw.userMouse.gotoAndStop("rotate");
this._parent.onEnterFrame = function () {
var _local2 = this._parent.jigsaw.userMouse;
if ((this._x - this._parent._xmouse) < 0) {
_local2._xscale = -100;
} else {
_local2._xscale = 100;
}
if ((this._y - this._parent._ymouse) < 0) {
_local2._yscale = -100;
} else {
_local2._yscale = 100;
}
};
};
_local2.shape.onRollOut = function () {
delete this._parent.onEnterFrame;
this._parent._parent.jigsaw.userMouse.gotoAndStop("blank");
};
_local2.shape.onPress = function () {
this._parent.swapDepths(this._parent._parent.getNextHighestDepth());
this._parent.x0 = this._parent._xmouse;
this._parent.y0 = this._parent._ymouse;
this._parent.da = 0;
this._parent.onEnterFrame = function () {
var _local2 = (Math.atan2(this._ymouse, this._xmouse) - Math.atan2(this.y0, this.x0)) * 57.2958;
if (_local2 != 0) {
this.da = _local2;
this._rotation = this._rotation + this.da;
}
this.x0 = this._xmouse;
this.y0 = this._ymouse;
};
};
_local2.shape.onRelease = function () {
stopDrag();
delete this._parent.onEnterFrame;
var _local2 = Math.round(this._parent._rotation / 90) * 90;
if ((Math.abs(_local2 - this._parent._rotation) > 30) && (((_local2 - this._parent._rotation) * this._parent.da) < 0)) {
if (this._parent.da < 0) {
_local2 = _local2 - 90;
} else {
_local2 = _local2 + 90;
}
}
if (_local2 == 0) {
var _local6 = this._parent._parent.jigsaw.dw;
var _local5 = this._parent._parent.jigsaw.dh;
var _local4 = Math.round(this._parent._x / _local6);
var _local3 = Math.round(this._parent._y / _local5);
if ((_local4 == this._parent.ox) && (_local3 == this._parent.oy)) {
this._parent._parent.jigsaw.mMap[_local3][_local4] = this._parent;
this._parent._parent.jigsaw.disabledM(this._parent);
this._parent._parent.jigsaw.putOne();
if ((++this._parent._parent.jigsaw.varOrder) >= 0) {
this._parent._parent.jigsaw.win();
}
new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.Strong.easeOut, this._parent._x, _local4 * _local6, 6, false);
new mx.transitions.Tween(this._parent, "_y", mx.transitions.easing.Strong.easeOut, this._parent._y, _local3 * _local5, 6, false);
}
}
new mx.transitions.Tween(this._parent, "_rotation", mx.transitions.easing.Strong.easeOut, this._parent._rotation, _local2, 6, false);
};
_local2.shape.onReleaseOutside = function () {
this._parent._parent.jigsaw.userMouse.gotoAndStop("blank");
this.onRelease();
};
_local2.dragArea.onRollOut = function () {
this._parent._parent.jigsaw.userMouse.gotoAndStop("blank");
};
_local2.dragArea.onRollOver = function () {
this._parent._parent.jigsaw.userMouse.gotoAndStop("move");
};
_local2.dragArea.onPress = function () {
this._parent.swapDepths(this._parent._parent.getNextHighestDepth());
var _local3 = Math.round(this._parent._x / this._parent._parent.jigsaw.dw);
var _local2 = Math.round(this._parent._y / this._parent._parent.jigsaw.dh);
if ((((_local3 >= 0) && (_local3 < this._parent._parent.jigsaw.w)) && (_local2 >= 0)) && (_local2 < this._parent._parent.jigsaw.h)) {
this._parent._parent.jigsaw.mMap[_local2][_local3] = "";
}
this._parent.x = this._parent._x;
this._parent.y = this._parent._y;
this._parent.startDrag(false, this._parent._parent.jigsaw.dragLeft, this._parent._parent.jigsaw.dragTop, this._parent._parent.jigsaw.dragRight, this._parent._parent.jigsaw.dragBottom);
};
_local2.dragArea.onRelease = (_local2.dragArea.onReleaseOutside = function () {
stopDrag();
delete this._parent.onEnterFrame;
var _local5 = this._parent._parent.jigsaw.dw;
var _local4 = this._parent._parent.jigsaw.dh;
var _local3 = Math.round(this._parent._x / _local5);
var _local2 = Math.round(this._parent._y / _local4);
if ((((_local3 >= 0) && (_local3 < this._parent._parent.jigsaw.w)) && (_local2 >= 0)) && (_local2 < this._parent._parent.jigsaw.h)) {
if (this._parent._parent.jigsaw.mMap[_local2][_local3] == "") {
if (((_local3 == this._parent.ox) && (_local2 == this._parent.oy)) && (this._parent._rotation == 0)) {
this._parent._parent.jigsaw.mMap[_local2][_local3] = this._parent;
this._parent._parent.jigsaw.disabledM(this._parent);
this._parent._parent.jigsaw.putOne();
if ((++this._parent._parent.jigsaw.varOrder) >= 0) {
this._parent._parent.jigsaw.win();
}
new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.Strong.easeOut, this._parent._x, _local3 * _local5, 6, false);
new mx.transitions.Tween(this._parent, "_y", mx.transitions.easing.Strong.easeOut, this._parent._y, _local2 * _local4, 6, false);
}
}
}
});
_local6++;
}
_local8++;
}
}
}
Symbol 1037 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 1038 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 1039 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 1040 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1041 MovieClip [__Packages.MazeTile] Frame 0
class MazeTile
{
var x, y, walkAble;
function MazeTile (x1, y1, _walkAble) {
x = x1;
y = y1;
walkAble = _walkAble;
}
function toString(Void) {
return((((" (" + x) + ",") + y) + ")");
}
}
Symbol 1042 MovieClip [__Packages.MazeChar] Frame 0
class MazeChar
{
var mc, ta, xx, yy, x, y, wid, v, leftKey, rightKey, upKey, downKey, intervalId, onWin;
function MazeChar (_mc, _leftKey, _rightKey, _upKey, _downKey, _ta, _xx, _yy, _wid) {
mc = _mc;
ta = _ta;
xx = _xx;
yy = _yy;
x = int(xx / ta.d);
y = int(yy / ta.d);
wid = _wid;
v = 4;
leftKey = _leftKey;
rightKey = _rightKey;
upKey = _upKey;
downKey = _downKey;
intervalId = setInterval(this, "run", 33);
}
function run(Void) {
if (Key.isDown(leftKey)) {
mov(-v, 0);
} else if (Key.isDown(rightKey)) {
mov(v, 0);
} else if (Key.isDown(upKey)) {
mov(0, -v);
} else if (Key.isDown(downKey)) {
mov(0, v);
} else {
mc.body.gotoAndStop(1);
}
}
function mov(vx, vy) {
var _local3 = true;
var _local2 = true;
xx = xx + vx;
yy = yy + vy;
if (vx < 0) {
mc.gotoAndStop(1);
_local3 = ta.isWalkAble(xx - wid, yy - wid);
_local2 = ta.isWalkAble(xx - wid, (yy + wid) - 1);
if (!(_local3 && (_local2))) {
xx = (x * ta.d) + wid;
if (_local3) {
mov(0, -v);
return(true);
}
if (_local2) {
mov(0, v);
return(true);
}
}
} else if (vx > 0) {
mc.gotoAndStop(3);
_local3 = ta.isWalkAble((xx + wid) - 1, yy - wid);
_local2 = ta.isWalkAble((xx + wid) - 1, (yy + wid) - 1);
if (!(_local3 && (_local2))) {
xx = ((x + 1) * ta.d) - wid;
if (_local3) {
mov(0, -v);
return(true);
}
if (_local2) {
mov(0, v);
return(true);
}
}
} else if (vy < 0) {
mc.gotoAndStop(2);
_local3 = ta.isWalkAble(xx - wid, yy - wid);
_local2 = ta.isWalkAble((xx + wid) - 1, yy - wid);
if (!(_local3 && (_local2))) {
yy = (y * ta.d) + wid;
if (_local3) {
mov(-v, 0);
return(true);
}
if (_local2) {
mov(v, 0);
return(true);
}
}
} else {
mc.gotoAndStop(4);
_local3 = ta.isWalkAble(xx - wid, (yy + wid) - 1);
_local2 = ta.isWalkAble((xx + wid) - 1, (yy + wid) - 1);
if (!(_local3 && (_local2))) {
yy = ((y + 1) * ta.d) - wid;
if (_local3) {
mov(-v, 0);
return(true);
}
if (_local2) {
mov(v, 0);
return(true);
}
}
}
mc.body.play();
mc._x = xx;
mc._y = yy;
x = int(xx / ta.d);
y = int(yy / ta.d);
if ((x == ta.targetX) && (y == ta.targetY)) {
win();
}
mc.swapDepths(ta.getDepth(x, y));
return(_local3 && (_local2));
}
function win(Void) {
onWin();
}
}
Symbol 1043 MovieClip [__Packages.MazeTileArea] Frame 0
class MazeTileArea
{
var w, h, d, targetX, targetY;
function MazeTileArea (_w, _h, _d, _targetX, _targetY) {
w = _w;
h = _h;
d = _d;
targetX = _targetX;
targetY = _targetY;
}
function getDepth(x, y) {
return(((y * w) + w) - x);
}
function isWalkAble(xx, yy) {
return(this[(("t" + int(yy / d)) + "_") + int(xx / d)].walkAble);
}
}
Symbol 1044 MovieClip [__Packages.PicGame] Frame 0
class PicGame
{
var mArea, d, w, h, step, gameover, totalTimes, x0, y0, order, prevId, onDisorder;
function PicGame (_mArea, pic, _d, _gameover) {
var _local6 = flash.display.BitmapData.loadBitmap(pic);
mArea = _mArea;
mArea.pg = this;
d = _d;
w = _local6.width / d;
h = _local6.height / d;
step = 0;
gameover = _gameover;
var _local4 = 0;
while (_local4 < h) {
var _local3 = 0;
while (_local3 < w) {
var _local2 = mArea.attachMovie("order_m", (("m" + _local4) + "_") + _local3, (_local4 * w) + _local3);
_local2._x = _local3 * d;
_local2._y = _local4 * d;
_local2.x0 = _local3;
_local2.y0 = _local4;
var _local5 = new flash.display.BitmapData(d, d, false);
_local5.copyPixels(_local6, new flash.geom.Rectangle(_local3 * d, _local4 * d, d, d), new flash.geom.Point(0, 0));
_local2.m.attachBitmap(_local5, 0);
_local2.onPress = function () {
this._parent.pg.mov(this);
};
_local2.enabled = false;
_local3++;
}
_local4++;
}
}
function disorder(_totalTimes) {
totalTimes = _totalTimes;
mArea.m0_0._alpha = 0;
mArea.m0_0._x = -d;
mArea.m0_0._name = "m0_-1";
x0 = 0;
y0 = 0;
order = 0;
prevId = 2;
disorderMov();
}
function disorderMov(Void) {
if ((--totalTimes) >= 0) {
do {
var _local3 = ((prevId + 3) + random(3)) % 4;
var x = (x0 + xy[_local3][0]);
var y = (y0 + xy[_local3][1]);
} while ((((x < 0) || (x >= w)) || (y < 0)) || (y >= h));
prevId = _local3;
var _local2 = mArea[(("m" + y) + "_") + x];
_local2.xt = x0 * d;
_local2.yt = y0 * d;
_local2._name = (("m" + y0) + "_") + x0;
x0 = x;
y0 = y;
_local2.onEnterFrame = function () {
var _local3 = this.xt - this._x;
var _local2 = this.yt - this._y;
this._x = this._x + (_local3 * 0.8);
this._y = this._y + (_local2 * 0.8);
if (((_local3 * _local3) + (_local2 * _local2)) < 100) {
delete this.onEnterFrame;
this._x = this.xt;
this._y = this.yt;
this._parent.pg.disorderMov();
}
};
} else {
var y = 0;
while (y < h) {
var x = 0;
while (x < w) {
var _local2 = mArea[(("m" + y) + "_") + x];
if ((_local2.x0 != (_local2._x / d)) || (_local2.y0 != (_local2._y / d))) {
order--;
}
x++;
}
y++;
}
setEnabled(true);
onDisorder();
}
}
function mov(m) {
setEnabled(false);
m.xt = x0 * d;
m.yt = y0 * d;
if ((m.x0 == (m._x / d)) && (m.y0 == (m._y / d))) {
order--;
} else if ((m.x0 == x0) && (m.y0 == y0)) {
order++;
}
m._name = (("m" + y0) + "_") + x0;
x0 = m._x / d;
y0 = m._y / d;
step++;
mArea._parent.step++;
m.onEnterFrame = function () {
var _local3 = this.xt - this._x;
var _local2 = this.yt - this._y;
this._x = this._x + (_local3 * 0.8);
this._y = this._y + (_local2 * 0.8);
if (((_local3 * _local3) + (_local2 * _local2)) < 1) {
delete this.onEnterFrame;
this._x = this.xt;
this._y = this.yt;
if (this._parent.pg.order == -1) {
this._parent["m0_-1"]._name = "m0_0";
this._parent.m0_0._x = 0;
this._parent.m0_0.onEnterFrame = function () {
if (((this._alpha = this._alpha + 10)) > 95) {
this._alpha = 100;
delete this.onEnterFrame;
}
};
this._parent.pg.gameover();
} else {
this._parent.pg.setEnabled(true);
}
}
};
}
function setEnabled(value) {
var _local2 = 0;
while (_local2 < 4) {
var _local4 = x0 + xy[_local2][0];
var _local3 = y0 + xy[_local2][1];
if ((((_local4 >= 0) && (_local4 < w)) && (_local3 >= 0)) && (_local3 < h)) {
mArea[(("m" + _local3) + "_") + _local4].enabled = value;
}
_local2++;
}
}
static var xy = [[-1, 0], [0, -1], [1, 0], [0, 1]];
}
Symbol 154 MovieClip Frame 1
onEnterFrame = function () {
var _local5 = _root.getBytesLoaded();
var _local4 = _root.getBytesTotal();
var _local3 = int((_local5 / _local4) * 100);
num_txt.text = _local3 + "%";
if (_root._mochiad instanceof MovieClip) {
this._visible = false;
}
if (_local3 == 100) {
delete this.onEnterFrame;
if ((_root._mochiad instanceof MovieClip) != true) {
_root.play();
}
}
};
Symbol 158 MovieClip Frame 1
this._visible = false;
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_root.play();
} else {
_root.stop();
}
Symbol 158 MovieClip Frame 2
this._visible = true;
Symbol 158 MovieClip Frame 39
stop();
Instance of Symbol 151 MovieClip in Symbol 158 MovieClip Frame 39
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 162 MovieClip Frame 26
stop();
Symbol 168 Button
on (release) {
gotoAndStop ("submit");
}
Symbol 174 Button
on (release) {
gotoAndStop (1);
}
Symbol 184 Button
on (release) {
gotoAndStop ("submited");
}
Symbol 189 Button
on (release) {
viewHighscore();
}
Symbol 190 MovieClip Frame 1
stop();
_global.game_name = _game_name;
var highscore = eval (score_var);
_global.viewHighscore = function () {
getURL ("http://www.freeworldgroup.com/score/index.asp?game=" + game_name, "_blank");
};
if (highscore == 0) {
this._visible = false;
}
trace(game_name);
trace(highscore);
trace("http://www.freeworldgroup.com/score/index.asp?game=" + game_name);
Symbol 190 MovieClip Frame 3
function sendData() {
send_var.game = game_name;
send_var.score = highscore;
send_var.name = name_txt.text;
if (send_var.name == "") {
send_var.name = "guest" + int(Math.random() * 1000);
}
send_var.sendAndLoad("http://www.freeworldgroup.com/score/score.asp", load_var, "POST");
gotoAndStop ("sending");
}
stop();
name_txt.text = charName;
gold_txt.text = highscore;
send_var = new LoadVars();
load_var = new LoadVars();
ok_btn.onRelease = sendData;
load_var.onLoad = function () {
gotoAndStop ("done");
};
Instance of Symbol 170 MovieClip in Symbol 190 MovieClip Frame 3
on (release) {
}
Symbol 191 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 274 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 275 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 281 Button
on (release) {
gotoAndStop ("select");
}
Symbol 283 Button
on (release) {
viewHighscore();
}
Symbol 285 Button
on (release) {
getURL ("http://www.freeworldgroup.com/", "_blank");
}
Symbol 287 Button
on (release) {
getURL ("http://www.ifungames.com", "_blank");
}
Symbol 289 Button
on (release) {
getURL ("http://www.freeworldgroup.com/koalafiles.htm", "_blank");
}
Symbol 291 Button
on (release) {
nextFrame();
}
Symbol 294 MovieClip Frame 1
this.onPress = function () {
};
this.enabled = false;
Symbol 299 Button
on (release) {
prevFrame();
}
Symbol 301 MovieClip Frame 1
stop();
Symbol 303 Button
on (press) {
gotoAndStop (2);
}
Symbol 309 Button
on (release) {
gotoAndStop (1);
}
Symbol 310 MovieClip Frame 1
stop();
Symbol 310 MovieClip Frame 2
stop();
credits_hitRec.enabled = false;
Symbol 330 MovieClip Frame 36
stop();
onShow();
Symbol 331 MovieClip Frame 1
function show(_text) {
text = _text;
nextFrame();
}
stop();
var text = "";
for (var each in this) {
this[each].removeMovieClip();
}
Symbol 331 MovieClip Frame 2
function cal(Void) {
if ((++totalShowed) >= L) {
onEffect();
prevFrame();
}
}
var tf = new TextFormat();
tf.font = "Arial Black";
tf.size = 29;
var L = text.length;
var i = 1;
while (i < L) {
num0.duplicateMovieClip("num" + i, i);
i++;
}
var d = ((-tf.getTextExtent(text).width) / 2);
var i = 0;
while (i < L) {
var num_mc = this["num" + i];
num_mc.txt = text.charAt(i);
num_mc._x = d;
d = d + ((tf.getTextExtent(text.substr(i, 2)).width / 2) + 1);
num_mc.stop();
num_mc.onShow = cal;
i++;
}
var id = 0;
this.onEnterFrame = function () {
this["num" + id].play();
if ((++id) >= L) {
delete this.onEnterFrame;
}
};
var totalShowed = 0;
Symbol 332 MovieClip Frame 1
stop();
Symbol 332 MovieClip Frame 3
stop();
nums.show("Click Dice!");
nums.onEffect = function () {
gotoAndStop (1);
};
Symbol 361 MovieClip Frame 1
function roll(id) {
num = random(6) + 1;
if (isNaN(id)) {
id = 5;
}
_parent.soundStart("dice.mp3");
gotoAndPlay("roll" + id);
}
function getNum(Void) {
return(num);
}
function showInfo(Void) {
diceInfo_mc.play();
}
function showInfo(Void) {
diceInfo_mc.gotoAndPlay(2);
}
stop();
var num = (random(6) + 1);
dice_mc.gotoAndStop(num);
Symbol 361 MovieClip Frame 2
stop();
dice_mc.gotoAndStop(num);
onRoll(num);
Symbol 361 MovieClip Frame 15
gotoAndStop (2);
Symbol 361 MovieClip Frame 29
gotoAndStop (2);
Symbol 361 MovieClip Frame 43
gotoAndStop (2);
Symbol 361 MovieClip Frame 57
gotoAndStop (2);
Symbol 361 MovieClip Frame 67
gotoAndStop (2);
Symbol 362 MovieClip Frame 1
var dice = _parent._parent.dice;
dice._visible = true;
dice._x = _parent._x + this._x;
dice._y = _parent._y + this._y;
dice.roll(id);
this.onEnterFrame = function () {
dice._x = _parent._x + this._x;
dice._y = _parent._y + this._y;
};
Symbol 372 MovieClip Frame 1
function open() {
gotoAndPlay (2);
}
function close() {
gotoAndPlay (31);
}
function show(_txt) {
txt = _txt;
gotoAndPlay (2);
}
stop();
var onShow;
var onOpen;
var onClose;
Symbol 372 MovieClip Frame 15
onOpen();
Symbol 372 MovieClip Frame 41
stop();
onClose();
onShow();
Symbol 383 MovieClip Frame 1
stop();
Symbol 384 MovieClip Frame 1
function show(num) {
this["key" + num].play();
}
Instance of Symbol 383 MovieClip "key1" in Symbol 384 MovieClip Frame 1
onClipEvent (keyDown) {
if (Key.isDown(_root.key_up)) {
_parent.role.body.gotoAndStop("jump");
}
}
Symbol 387 MovieClip Frame 1
stop();
Symbol 395 MovieClip Frame 1
function hide(Void) {
Key.removeListener(this);
delete this.onMouseDown;
Mouse.show();
gotoAndStop ("nothing");
}
function show(_char, arr) {
Key.removeListener(this);
delete this.onMouseDown;
Mouse.show();
char = _char;
var _local2 = arr[0];
gameObj = this[_local2];
if (gameObj == undefined) {
gameObj = (this[_local2] = new Game(arr));
} else {
gameObj.nextStage();
}
gotoAndPlay ("show");
}
function gameOver(score) {
onGameOver(char, score);
hide();
}
function giveUp(Void) {
Key.removeListener(this);
delete this.onMouseDown;
Mouse.show();
gameOver(0);
}
var char;
var gameObj;
var onGameOver;
var onTimeUp;
hide();
Symbol 395 MovieClip Frame 2
delete timer;
timer = undefined;
Symbol 395 MovieClip Frame 5
function start(Void) {
Key.removeListener(this);
delete this.onMouseDown;
gotoAndStop ("game");
}
stop();
loader.attachMovie(gameObj.gameName + "_help", "help", 0);
instruction = gameObj.instruction;
this.onMouseDown = function () {
start();
};
Key.addListener(this);
this.onKeyUp = function () {
start();
};
Symbol 395 MovieClip Frame 6
giveUpBtn.onPress = function () {
giveUp();
};
resetBtn.onPress = function () {
loader.game.reset();
};
delete timer;
var timer = new Timer(timer_mc);
timer.timeStart(gameObj.time);
timer.onTimeUp = function (totalTime) {
WellDone_mc.show("Times Up!");
loader.onPress = function () {
};
loader.enabled = false;
WellDone_mc.onShow = function () {
hide();
onTimeUp(char);
};
};
loader.attachMovie(gameObj.gameName, "game", 0);
loader.game.stageNum = gameObj.stageNum;
loader.game.onGameOver = function (score) {
timer.timeStop();
WellDone_mc.show("Well Done!");
loader.onPress = function () {
};
loader.enabled = false;
WellDone_mc.onShow = function () {
var _local1 = int(timer.getTime());
var _local2 = score + _local1;
gameOver(_local2);
hide();
};
};
loader.game.onError = function (dTime) {
timer.addTime(-dTime);
};
Symbol 427 MovieClip Frame 1
stop();
Symbol 427 MovieClip Frame 2
_parent.dice._visible = false;
Symbol 427 MovieClip Frame 9
dicePos_mc.id = 2;
Symbol 444 MovieClip Frame 1
stop();
Symbol 444 MovieClip Frame 2
_parent.dice._visible = false;
Symbol 444 MovieClip Frame 10
dicePos_mc.id = 1;
Symbol 463 MovieClip Frame 1
stop();
Symbol 463 MovieClip Frame 2
_parent.dice._visible = false;
Symbol 463 MovieClip Frame 6
dicePos_mc.id = 3;
Symbol 480 MovieClip Frame 1
stop();
Symbol 480 MovieClip Frame 2
_parent.dice._visible = false;
Symbol 480 MovieClip Frame 19
dicePos_mc.id = 2;
Symbol 486 MovieClip [char_mc] Frame 1
function showInfo(str) {
info_pad._x = this._x;
info_pad._y = (this._y - this._height) - 5;
info_pad.show(str);
info_pad.onEffect = function () {
onEffect();
};
}
var info_pad = _parent._parent.info_pad;
Symbol 512 Button
on (press) {
open();
}
Symbol 514 MovieClip Frame 1
stop();
this.onPress = function () {
};
this.enabled = false;
Symbol 526 Button
on (press) {
close();
}
Symbol 527 MovieClip Frame 1
function select(id) {
selectedIndex = id;
close();
onSelect((labelTxt.text = labelArr[id]));
}
function open(Void) {
gotoAndStop (3);
onOpen();
}
function close(Void) {
gotoAndStop (2);
onClose();
}
function setEnabled(value) {
if (value) {
comboMaskRec.prevFrame();
} else {
comboMaskRec.nextFrame();
}
}
nextFrame();
totalItem = labelArr.length;
if (isNaN(selectedIndex)) {
selectedIndex = 0;
}
labelTxt.text = labelArr[selectedIndex];
Symbol 527 MovieClip Frame 2
for (var each in this) {
this[each].removeMovieClip();
}
Symbol 527 MovieClip Frame 3
var item_mc;
var i = 1;
while (i < totalItem) {
item0.duplicateMovieClip("item" + i, i);
this["item" + i]._y = item0._y + ((item0._height + 5) * i);
i++;
}
var i = 0;
while (i < totalItem) {
item_mc = this["item" + i];
item_mc.txt = labelArr[i];
item_mc.id = i;
item_mc.btn.onPress = function () {
select(this._parent.id);
};
i++;
}
bg_mc._y = item_mc._y + item_mc._height;
bg_mc.onPress = function () {
};
bg_mc.enabled = false;
Symbol 537 MovieClip Frame 2
stop();
Symbol 538 MovieClip [_3board] Frame 1
function reset() {
}
function gameOver() {
onGameOver(100);
}
function error() {
onError(5);
}
var i = 0;
while (i < 3) {
this.attachMovie("can_mc", "can" + i, i, {_x:170 + (190 * i), _y:380, hasDice:false});
i++;
}
ClickTheContainerWithTheDiceInIt_mc.stop();
Symbol 538 MovieClip [_3board] Frame 2
function disorder(arr) {
var _local4 = arr.length;
var _local3;
var _local5;
var _local1 = 0;
while (_local1 < _local4) {
_local3 = random(_local4);
_local5 = arr[_local3];
arr[_local3] = arr[_local1];
arr[_local1] = _local5;
_local1++;
}
}
function disorderCan(_va, _totalDisorder) {
if (_totalDisorder <= 0) {
var _local4 = 0;
while (_local4 < 3) {
var _local5 = this["can" + _local4];
_local5.enabled = true;
_local4++;
}
ClickTheContainerWithTheDiceInIt_mc.play();
} else {
disorder(numArr);
va = _va;
totalDisorder = _totalDisorder;
disorderCanNum = 0;
var _local4 = 1;
while (_local4 <= 2) {
var _local5 = (this["can_mc" + _local4] = this["can" + numArr[_local4]]);
_local5.onMov = function () {
if ((++disorderCanNum) >= 2) {
disorderCan(va, totalDisorder - 1);
}
};
_local4++;
}
this["can" + numArr[0]].swapDepths(1);
_local4 = 1;
while (_local4 <= 2) {
var _local2 = this["can_mc" + _local4];
var _local3 = this["can_mc" + (3 - _local4)];
_local2.brother = _local3;
if (Math.abs(_local2._x - _local3._x) > 210) {
_local2.setV(va / 2);
} else {
_local2.setV(va);
}
_local2.mov(_local3._x, ((_local2._x < _local3._x) ? -1 : 1));
_local5.swapDepths(((_local2._x < _local3._x) ? 0 : 2));
_local4++;
}
}
}
stop();
var game = this;
var delayTime = 10;
var numArr = [0, 1, 2];
var can_mc1;
var can_mc2;
var error_can;
var totalDisorder;
var disorderCanNum;
var va = 20;
var level = 0;
var targetCan = this["can" + random(3)];
targetCan.hasDice = true;
targetCan.open();
targetCan.onOpen = function () {
targetCan.swapDepths(2);
targetCan.dice.nextFrame();
gotoAndStop ("rest");
};
Symbol 538 MovieClip [_3board] Frame 3
var i = 0;
while (i < 3) {
var can_mc = this["can" + i];
can_mc.onPress = function () {
ClickTheContainerWithTheDiceInIt_mc.gotoAndStop(1);
var _local2 = 0;
while (_local2 < 3) {
game["can" + _local2].enabled = false;
_local2++;
}
this.open();
};
can_mc.onOpen = function (isTarget) {
gotoAndStop ("check");
if (isTarget) {
delayTime = 10;
game.onEnterFrame = function () {
if ((--delayTime) <= 0) {
delete this.onEnterFrame;
targetCan.close();
targetCan.onClose = function () {
if ((++level) > 5) {
level = 5;
gameOver();
} else {
va = va + 6;
gotoAndStop ("run");
}
};
}
};
} else {
error_can = this;
delayTime = 10;
game.onEnterFrame = function () {
if ((--delayTime) <= 0) {
delete this.onEnterFrame;
targetCan.open();
targetCan.onOpen = function () {
error();
this.dice.nextFrame();
gotoAndStop ("rest");
};
}
};
}
};
can_mc.enabled = false;
i++;
}
disorderCan(va, 3);
Symbol 538 MovieClip [_3board] Frame 5
targetCan.enabled = true;
targetCan.onPress = function () {
error_can.close();
this.dice.gotoAndStop(1);
this.close();
this.onClose = function () {
gotoAndStop ("run");
};
};
Symbol 539 MovieClip [_3board_help] Frame 1
_parent._parent.keys_mc._visible = false;
_parent._parent.nextFrame();
Symbol 541 MovieClip Frame 2
stop();
Symbol 544 MovieClip Frame 1
stop();
Symbol 545 MovieClip [can_mc] Frame 1
function open() {
this.gotoAndPlay("open");
}
function close() {
this.gotoAndPlay("close");
}
function setV(_va) {
va = _va;
}
function mov(_xt, _k) {
xt = _xt;
k = _k;
ra = Math.abs(xt - x0) / 2;
xo = (xt + x0) / 2;
yo = y0;
if (k > 0) {
a = 180;
this.onEnterFrame = function () {
a = a - va;
if (a <= 0) {
delete this.onEnterFrame;
this._x = (x0 = xt);
this._y = y0;
this._xscale = (this._yscale = 100);
onMov(this);
} else {
this._x = xo + (ra * Math.cos((a * Math.PI) / 180));
this._y = yo + (rb * Math.sin((a * Math.PI) / 180));
this._xscale = (this._yscale = 100 + (this._y - y0));
}
};
} else {
a = 0;
this.onEnterFrame = function () {
a = a - va;
if (a <= -180) {
delete this.onEnterFrame;
this._x = (x0 = xt);
this._y = y0;
this._xscale = (this._yscale = 100);
onMov(this);
} else {
this._x = xo + (ra * Math.cos((a * Math.PI) / 180));
this._y = yo + (rb * Math.sin((a * Math.PI) / 180));
this._xscale = (this._yscale = 100 + (this._y - y0));
}
};
}
}
var x0 = this._x;
var y0 = this._y;
var xo;
var yo;
var ra;
var rb = 10;
var a = 0;
var k;
var va;
var xt;
var onOpen;
var onClose;
var onMov;
nextFrame();
Symbol 545 MovieClip [can_mc] Frame 3
dice._visible = hasDice;
Symbol 545 MovieClip [can_mc] Frame 6
stop();
onOpen(hasDice);
Symbol 545 MovieClip [can_mc] Frame 9
stop();
onClose();
Symbol 571 MovieClip Frame 1
stop();
Symbol 571 MovieClip Frame 17
stop();
onEffect();
Symbol 572 MovieClip Frame 1
function check() {
var _local3 = 1;
while (_local3 <= total) {
var _local4 = this["effect" + _local3];
if ((_local4._currentframe == 1) && (_local4.hitTest(gun.hitRec))) {
totalFound++;
brother.totalFound++;
_local4.play();
brother["effect" + _local3].play();
_local4.onEffect = function () {
if (totalFound == total) {
_parent._parent.gameOver();
}
};
return(undefined);
}
_local3++;
}
if (_local3 > total) {
_parent._parent.error();
}
}
gotoAndStop(_parent._currentframe);
var brother = _parent.brother.ctrl;
var w = this._width;
var h = this._height;
var total = 5;
var totalFound = 0;
gotoAndStop(_parent._currentframe);
gun.onEnterFrame = function () {
var _local3 = _xmouse;
var _local2 = _ymouse;
if ((((_local3 >= 0) && (_local3 <= w)) && (_local2 >= 0)) && (_local2 <= h)) {
this._alpha = 0;
this._x = _local3;
this._y = _local2;
} else {
this._alpha = 100;
this._x = brother._xmouse;
this._y = brother._ymouse;
}
};
hitRec.useHandCursor = false;
hitRec.onPress = function () {
check();
};
Symbol 594 MovieClip [_different] Frame 1
function reset() {
}
function error() {
onError(10);
}
function gameOver() {
onGameOver(100);
}
pic1.brother = pic2;
pic2.brother = pic1;
pic1.gotoAndStop(stageNum);
pic2.gotoAndStop(stageNum);
Symbol 595 MovieClip [_different_help] Frame 1
_parent._parent.keys_mc._visible = false;
_parent._parent.nextFrame();
Symbol 726 MovieClip [_find] Frame 1
function reset() {
}
function gameOver() {
onGameOver(100);
}
function error() {
onError(10);
}
function init(itemArr) {
var _local2 = 0;
while (_local2 < 5) {
var _local3 = this["mc" + _local2];
_local3.txt = this["item_txt" + _local2];
_local3.txt.text = itemArr[_local2];
_local3.useHandCursor = false;
_local3.onPress = function () {
delete this.onPress;
this.txt.text = "";
totalFound++;
this.onEnterFrame = function () {
if (((this._alpha = this._alpha - 5)) < 1) {
delete this.onEnterFrame;
this._alpha = 0;
if (totalFound == total) {
gameOver();
}
}
};
};
_local2++;
}
hitRec.useHandCursor = false;
hitRec.onPress = function () {
error();
};
}
var total = 5;
var totalFound = 0;
gotoAndStop(stageNum + 1);
Symbol 726 MovieClip [_find] Frame 2
init(["baseball glove", "hand gun", "hand skeleton", "knife", "football"]);
Symbol 726 MovieClip [_find] Frame 3
init(["snake", "chair", "elephant", "machine gun", "cat"]);
Symbol 726 MovieClip [_find] Frame 4
init(["deer", "spider", "motorbike", "gun", "hawk"]);
Symbol 726 MovieClip [_find] Frame 5
init(["Crow", "hawk", "switch", "volleyball", "snake"]);
Symbol 726 MovieClip [_find] Frame 6
init(["pork", "crab", "tire", "scorpion", "grasshopper"]);
Symbol 727 MovieClip [_find_help] Frame 1
_parent._parent.keys_mc._visible = false;
_parent._parent.nextFrame();
Symbol 744 MovieClip Frame 1
function gameInit(_score) {
score = _score;
draggingM = undefined;
map = new Array(h);
var _local5 = 0;
while (_local5 < h) {
map[_local5] = new Array(w);
var _local6 = 0;
while (_local6 < w) {
map[_local5][_local6] = 0;
_local6++;
}
_local5++;
}
totalM = 0;
for (var _local9 in game) {
var _local2 = game[_local9];
if ((typeof(_local2) == "movieclip") && (_local2.rec != undefined)) {
game["m" + (totalM++)] = _local2;
var _local3 = Math.round(_local2.rec._width / d);
var _local4 = Math.round(_local2.rec._height / d);
_local2.x = Math.round(_local2._x / d);
_local2.y = Math.round(_local2._y / d);
switch ((Math.round(_local2._rotation / 90) + 4) % 4) {
case 0 :
_local2.x0 = _local2.x;
_local2.y0 = _local2.y;
break;
case 1 :
_local3 = _local3 ^ _local4;
_local4 = _local3 ^ _local4;
_local3 = _local3 ^ _local4;
_local2.x0 = (_local2.x = _local2.x - _local3);
_local2.y0 = _local2.y;
_local2.rec._y = (-d) * _local3;
break;
case 2 :
_local2.x0 = (_local2.x = _local2.x - _local3);
_local2.y0 = (_local2.y = _local2.y - _local4);
_local2.rec._x = (-d) * _local3;
_local2.rec._y = (-d) * _local4;
break;
case 3 :
_local3 = _local3 ^ _local4;
_local4 = _local3 ^ _local4;
_local3 = _local3 ^ _local4;
_local2.x0 = _local2.x;
_local2.y0 = (_local2.y = _local2.y - _local4);
_local2.rec._x = (-d) * _local4;
}
_local2.w = _local3;
_local2.h = _local4;
_local2.shape = new Array(_local2.h);
_local5 = 0;
while (_local5 < _local2.h) {
_local2.shape[_local5] = new Array(_local2.w);
var _local6 = 0;
while (_local6 < _local2.w) {
_local2.shape[_local5][_local6] = 1;
_local6++;
}
_local5++;
}
_local2.car._x = _local2.rec._x;
_local2.car._y = _local2.rec._y;
_local2._x = _local2.x * d;
_local2._y = _local2.y * d;
setMap(map, _local2, 1);
_local2.onPress = function () {
draggingM = this;
setMap(map, this, 0);
this.xm = _xmouse;
this.ym = _ymouse;
this.onEnterFrame = function () {
var _local3 = int(this._x / d);
var _local2 = int(this._y / d);
var _local5 = (_local3 * d) - this._x;
var _local4 = (_local2 * d) - this._y;
if (((_local5 * _local5) + (_local4 * _local4)) < 5) {
this._x = _local3 * d;
this._y = _local2 * d;
this.ltrb = getLtrb(map, this, _local3, _local2);
if (Math.abs(_xmouse - this.xm) > Math.abs(_ymouse - this.ym)) {
this.startDrag(false, (_local3 - this.ltrb[0]) * d, _local2 * d, (_local3 + this.ltrb[2]) * d, _local2 * d);
} else {
this.startDrag(false, _local3 * d, (_local2 - this.ltrb[1]) * d, _local3 * d, (_local2 + this.ltrb[3]) * d);
}
}
this.xm = _xmouse;
this.ym = _ymouse;
};
};
}
}
}
function stageClear() {
var _local3 = 0;
while (_local3 < totalM) {
delete game["m" + _local3].onPress;
_local3++;
}
_parent.railing_mc.play();
myCar.onEnterFrame = function () {
this._x = this._x + 1.5;
};
onGameOver(score);
}
function getLtrb(map, m, mx, my) {
var _local13 = m.shape.length;
var _local10 = [0, 0, 0, 0];
var _local6 = 0;
while (_local6 < 4) {
var _local8 = mx + xy[_local6][0];
var _local7 = my + xy[_local6][1];
if ((((_local8 < 0) || (_local8 >= w)) || (_local7 < 0)) || (_local7 >= h)) {
} else {
var _local4 = 0;
while (_local4 < m.h) {
var _local1 = 0;
while (_local1 < m.w) {
var _local3 = _local8 + _local1;
var _local2 = _local7 + _local4;
if (((((_local3 < 0) || (_local3 >= w)) || (_local2 < 0)) || (_local2 >= h)) || (map[_local2][_local3] > 0)) {
j = -1;
break;
}
_local1++;
}
if (_local1 < m.w) {
break;
}
_local4++;
}
if (_local4 >= m.h) {
_local10[_local6] = 1;
}
}
_local6++;
}
if ((((Math.round(m._rotation / 90) + 4) % 4) % 2) == 0) {
_local10[1] = (_local10[3] = 0);
} else {
_local10[0] = (_local10[2] = 0);
}
return(_local10);
}
function setMap(map, m, num) {
var _local3 = 0;
while (_local3 < m.h) {
m.shape[_local3] = new Array(m.w);
var _local1 = 0;
while (_local1 < m.w) {
map[m.y + _local3][m.x + _local1] = num;
_local1++;
}
_local3++;
}
}
function reset() {
gotoAndPlay(frame);
}
var frame = ((_parent.stageNum * 3) - 1);
gotoAndPlay(frame);
var game = this;
var score;
var d = 80;
var w = 5;
var h = 5;
var xy = [[-1, 0], [0, -1], [1, 0], [0, 1]];
var draggingM;
var map;
var totalM;
game.onMouseUp = function () {
if (draggingM != undefined) {
stopDrag();
delete draggingM.onEnterFrame;
delete draggingM.ltrb;
draggingM.x = Math.round(draggingM._x / d);
draggingM.y = Math.round(draggingM._y / d);
draggingM._x = draggingM.x * d;
draggingM._y = draggingM.y * d;
setMap(map, draggingM, 1);
if (draggingM == myCar) {
if (myCar.x == (w - 2)) {
stageClear();
}
}
draggingM = undefined;
}
};
Symbol 744 MovieClip Frame 4
stop();
gameInit(100);
Symbol 744 MovieClip Frame 7
stop();
gameInit(100);
Symbol 744 MovieClip Frame 10
stop();
gameInit(100);
Symbol 744 MovieClip Frame 13
stop();
gameInit(100);
Symbol 744 MovieClip Frame 16
stop();
gameInit(100);
Symbol 748 MovieClip Frame 1
stop();
Symbol 748 MovieClip Frame 6
stop();
Symbol 749 MovieClip [_getting_out] Frame 1
function reset(Void) {
game.reset();
}
function error(Void) {
}
game.onGameOver = function (score) {
onGameOver(score);
};
Symbol 751 MovieClip [_getting_out_help] Frame 1
_parent._parent.keys_mc._visible = false;
var mouse_mc = _parent._parent.mouse_mc;
Symbol 751 MovieClip [_getting_out_help] Frame 11
mouse_mc.play();
Symbol 751 MovieClip [_getting_out_help] Frame 23
mouse_mc.play();
Symbol 751 MovieClip [_getting_out_help] Frame 36
mouse_mc.play();
Symbol 751 MovieClip [_getting_out_help] Frame 47
stop();
_parent._parent.done_mc._visible = true;
Symbol 759 MovieClip [_hanoi] Frame 1
function gameOver(Void) {
onGameOver((totalRing - 2) * 25);
}
function reset(Void) {
gotoAndPlay (1);
}
function error(Void) {
}
function getRing(stickId) {
var _local2 = 0;
while (_local2 < 3) {
if (_local2 == stickId) {
} else if (hanoi.movAble(stickId, _local2)) {
this["stick" + _local2].enabled = true;
} else {
this["stick" + _local2].enabled = false;
}
_local2++;
}
currentStick = this["stick" + stickId];
currentRing = front_mc["ring" + hanoi.getTopRing(stickId)];
stween = new STween(currentRing, currentStick._x, currentStick._y - 200);
stween.onMov = function (currentRing) {
};
}
function putRing(stickId) {
hanoi.mov(currentStick.id, stickId);
currentStick = this["stick" + stickId];
stween = new STween(currentRing, currentStick._x, currentStick._y - 200);
currentRing.stick = currentStick;
currentRing = undefined;
if (hanoi.isWin) {
var _local2 = 0;
while (_local2 < 3) {
this["stick" + _local2].enabled = false;
_local2++;
}
stween.onMov = function (ring_mc) {
stween = new STween(ring_mc, ring_mc.stick._x, ring_mc.stick._y - (hanoi.getTotal(stickId) * d));
stween.onMov = function (ring_mc) {
};
};
gameOver();
} else {
setMovAble();
stween.onMov = function (ring_mc) {
stween = new STween(ring_mc, ring_mc.stick._x, ring_mc.stick._y - (hanoi.getTotal(stickId) * d));
stween.onMov = function (ring_mc) {
};
};
}
}
function setMovAble(Void) {
var _local3 = 0;
while (_local3 < 3) {
var _local2 = 0;
while (_local2 < 3) {
if (hanoi.movAble(_local3, _local2)) {
break;
}
if (_local3 == _local2) {
}
_local2++;
}
if (_local2 >= 3) {
this["stick" + _local3].enabled = false;
} else {
this["stick" + _local3].enabled = true;
}
_local3++;
}
}
if (stageNum > 4) {
stageNum = 4;
}
var totalRing = (stageNum + 2);
Symbol 759 MovieClip [_hanoi] Frame 2
var d = 20;
var ring_mc;
var hanoi = new Hanoi(totalRing);
var i = 0;
while (i < totalRing) {
var depth = (totalRing - i);
var x = stick0._x;
var y = (stick0._y + (d * (i - totalRing)));
ring_mc = front_mc.attachMovie("ring_mc", "ring" + i, depth, {_x:x, _y:y});
ring_mc.gotoAndStop(i + 7);
ring_mc.brother = back_mc.attachMovie("ring_mc", "ring" + i, depth, {_x:x, _y:y});
ring_mc.brother.brother = ring_mc;
ring_mc.brother.gotoAndStop(i + 1);
ring_mc.brother.onEnterFrame = function () {
this._x = this.brother._x;
this._y = this.brother._y;
};
i++;
}
stick0.enabled = true;
stick1.enabled = false;
stick2.enabled = false;
var stick_btn;
var stween;
var i = 0;
while (i < 3) {
stick_btn = this["stick" + i];
stick_btn.id = i;
stick_btn.onPress = function () {
if (currentRing == undefined) {
getRing(this.id);
} else {
putRing(this.id);
}
};
i++;
}
var currentRing;
var currentStick;
Symbol 759 MovieClip [_hanoi] Frame 3
stop();
Symbol 761 MovieClip [_hanoi_help] Frame 1
_parent._parent.keys_mc._visible = false;
var mouse_mc = _parent._parent.mouse_mc;
Symbol 761 MovieClip [_hanoi_help] Frame 8
mouse_mc.play();
Symbol 761 MovieClip [_hanoi_help] Frame 27
mouse_mc.play();
Symbol 761 MovieClip [_hanoi_help] Frame 62
mouse_mc.play();
Symbol 761 MovieClip [_hanoi_help] Frame 82
mouse_mc.play();
Symbol 761 MovieClip [_hanoi_help] Frame 117
mouse_mc.play();
Symbol 761 MovieClip [_hanoi_help] Frame 137
mouse_mc.play();
Symbol 761 MovieClip [_hanoi_help] Frame 164
stop();
_parent._parent.done_mc._visible = true;
Symbol 778 MovieClip [tile_mc] Frame 1
var type = "planet";
gotoAndStop(random(this._totalframes) + 1);
Symbol 784 MovieClip Frame 1
var type = "target";
Symbol 788 MovieClip Frame 1
var type = "spaceShip";
Symbol 790 MovieClip [_ice_room] Frame 1
var bf = (new flash.filters.BlurFilter());
var bmp = (new flash.display.BitmapData(280, 280, true, 0));
smokeArea.attachBitmap(bmp, 0);
tileArea.gotoAndStop(stageNum);
Symbol 790 MovieClip [_ice_room] Frame 2
function reset() {
delete spaceShip.onEnterFrame;
moving = false;
spaceShip._x = spaceShip.x0;
spaceShip._y = spaceShip.y0;
spaceShip._rotation = 0;
}
function gameOver() {
onGameOver(100);
}
function error() {
intervalId = setInterval(function () {
clearInterval(intervalId);
onError(10);
reset();
}, 1000);
}
function mov(dx, dy) {
if (map[((spaceShip._y / d) - 0.5) + dy][((spaceShip._x / d) - 0.5) + dx] == "planet") {
return(undefined);
}
moving = true;
spaceShip.vx = dx * v;
spaceShip.vy = dy * v;
spaceShip._rotation = 57.2957795130823 * Math.atan2(dy, dx);
spaceShip.onEnterFrame = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
var _local3 = this._x - (d / 2);
var _local2 = this._y - (d / 2);
if (((_local3 % d) == 0) && ((_local2 % d) == 0)) {
_local3 = _local3 / d;
_local2 = _local2 / d;
if ((((_local3 < 0) || (_local3 >= w)) || (_local2 < 0)) || (_local2 >= h)) {
error();
this.onEnterFrame = function () {
this._x = this._x + this.vx;
this._y = this._y + this.vy;
};
} else if (map[_local2][_local3] == "target") {
delete this.onEnterFrame;
gameOver();
} else {
_local3 = _local3 + (this.vx / v);
_local2 = _local2 + (this.vy / v);
if (map[_local2][_local3] == "planet") {
delete this.onEnterFrame;
moving = false;
}
}
}
};
}
stop();
var w = 14;
var h = 14;
var d = 20;
var v = (d / 2);
var intervalId;
var spaceShip;
var map = new Array(h);
var moving = false;
var y = 0;
while (y < h) {
map[y] = new Array(w);
var x = 0;
while (x < w) {
map[y][x] = "";
x++;
}
y++;
}
for (var each in tileArea) {
var mc = tileArea[each];
var x = Math.round(mc._x / d);
var y = Math.round(mc._y / d);
map[y][x] = mc.type;
if (mc.type == "spaceShip") {
spaceShip = mc;
spaceShip.x0 = spaceShip._x;
spaceShip.y0 = spaceShip._y;
}
}
Key.addListener(this);
this.onKeyDown = function () {
if (moving) {
return(undefined);
}
switch (Key.getCode()) {
case 37 :
mov(-1, 0);
return;
case 39 :
mov(1, 0);
return;
case 38 :
mov(0, -1);
return;
case 40 :
mov(0, 1);
}
};
smokeArea.onEnterFrame = function () {
if (moving) {
var _local2 = spaceShip._x - 5;
while (_local2 <= (spaceShip._x + 5)) {
var _local1 = spaceShip._y - 5;
while (_local1 <= (spaceShip._y + 5)) {
if (random(100) < 20) {
bmp.setPixel32(_local2, _local1, 4294967295);
}
_local1++;
}
_local2++;
}
}
bmp.applyFilter(bmp, bmp.rectangle, p0, bf);
};
Symbol 791 MovieClip Frame 1
_parent._parent._parent.mouse_mc._visible = false;
var keys_mc = _parent._parent._parent.keys_mc;
Symbol 791 MovieClip Frame 2
keys_mc.show(2);
Symbol 791 MovieClip Frame 31
keys_mc.show(1);
Symbol 791 MovieClip Frame 61
keys_mc.show(0);
Symbol 791 MovieClip Frame 91
keys_mc.show(3);
Symbol 791 MovieClip Frame 97
stop();
_parent._parent._parent.done_mc._visible = true;
Symbol 796 MovieClip Frame 1
function open() {
gotoAndPlay (2);
}
function close() {
gotoAndPlay (31);
}
function show(_txt) {
txt = _txt;
gotoAndPlay (2);
}
stop();
var onShow;
var onOpen;
var onClose;
Symbol 796 MovieClip Frame 15
onOpen();
Symbol 796 MovieClip Frame 41
stop();
onClose();
onShow();
Symbol 808 MovieClip Frame 1
stop();
var picW = 400;
var picH = 300;
var bestW;
var bestH;
var w;
var h;
var clickToStart_mc = _parent.clickToStart_mc;
bestW = int(picW / 70);
bestH = int(((picH * 0.9) * bestW) / picW);
w = bestW;
h = bestH;
pic_mc.gotoAndStop(_parent.stageNum);
var myJigsaw = new Jigsaw(mArea, "m", pic_mc, _parent.userMouse, picW, picH, 90, 100, 25, 30, w, h);
myJigsaw.win = function () {
gameOver();
};
_parent._parent._parent.timer.timeStop();
clickToStart_mc.show("Click to Start!");
clickToStart_mc.onOpen = function () {
clickToStart_mc.stop();
mArea.onPress = function () {
delete this.onPress;
clickToStart_mc.close();
clickToStart_mc.onClose = function () {
myJigsaw.disorder(600, 400);
_parent._parent._parent.timer.timeStart(_parent._parent._parent.gameObj.time);
};
};
};
Symbol 811 MovieClip Frame 1
Mouse.show();
stop();
Symbol 811 MovieClip Frame 2
Mouse.hide();
Symbol 811 MovieClip Frame 3
Mouse.hide();
Symbol 812 MovieClip [_jigsaw] Frame 2
function reset(Void) {
}
function error(Void) {
}
stop();
userMouse._x = -10000;
game.gameOver = function () {
onGameOver(100);
};
Symbol 824 MovieClip Frame 1
function effect(Void) {
gotoAndPlay (2);
}
stop();
var onEffect;
Symbol 824 MovieClip Frame 10
onEffect();
Symbol 826 MovieClip [_jump_chess] Frame 1
function reset() {
gotoAndPlay ("init");
}
function gameOver() {
onGameOver(50 + (stageNum * 10));
}
function error() {
onError(10);
}
Symbol 826 MovieClip [_jump_chess] Frame 3
selectRec._x = -1000;
chessArea.gotoAndStop(stageNum);
Symbol 826 MovieClip [_jump_chess] Frame 4
function setChessEnabled(Void) {
var _local5 = 0;
for (var _local6 in chessArea) {
var _local1 = chessArea[_local6];
if (typeof(_local1) != "movieclip") {
continue;
}
var _local2 = 0;
while (_local2 < 4) {
var _local4 = ltrb[_local2][0];
var _local3 = ltrb[_local2][1];
if (((chessArea[(("chess" + (_local1.y + _local3)) + "_") + (_local1.x + _local4)] != undefined) && (chessArea[(("chess" + (_local1.y + (2 * _local3))) + "_") + (_local1.x + (2 * _local4))] == undefined)) && (recArea[(("rec" + (_local1.y + (2 * _local3))) + "_") + (_local1.x + (2 * _local4))] != undefined)) {
break;
}
_local2++;
}
if (_local2 < 4) {
_local5++;
_local1.enabled = true;
} else {
_local1.enabled = false;
}
}
return(_local5);
}
stop();
var d = 50;
var delayTime;
var currentChess = undefined;
var ltrb = [[-1, 0], [0, -1], [1, 0], [0, 1]];
for (var each in recArea) {
var rec = recArea[each];
if (typeof(rec) != "movieclip") {
continue;
}
rec.x = Math.round(rec._x / d);
rec.y = Math.round(rec._y / d);
rec._name = (("rec" + rec.y) + "_") + rec.x;
rec._x = rec.x * d;
rec._y = rec.y * d;
rec.gotoAndStop(1);
rec.enabled = false;
rec.onPress = function () {
for (var _local5 in recArea) {
var _local2 = recArea[_local5];
if (typeof(_local2) != "movieclip") {
continue;
}
_local2.enabled = false;
_local2.gotoAndStop(1);
}
for (var _local5 in chessArea) {
var _local3 = chessArea[_local5];
if (typeof(_local3) != "movieclip") {
continue;
}
_local3.enabled = false;
}
selectRec._x = this._x + this._parent._x;
selectRec._y = this._y + this._parent._y;
var _local7 = (this._x - currentChess._x) / 2;
var _local6 = (this._y - currentChess._y) / 2;
currentChess.xt = this._x;
currentChess.yt = this._y;
currentChess.killChess = chessArea[(("chess" + (currentChess.y + (_local6 / d))) + "_") + (currentChess.x + (_local7 / d))];
currentChess.effect();
currentChess.onEffect = function () {
currentChess.killChess.swapDepths(100);
currentChess.killChess.removeMovieClip();
currentChess.effect();
currentChess.onEffect = function () {
currentChess._x = currentChess.xt;
currentChess._y = currentChess.yt;
currentChess.x = currentChess.xt / d;
currentChess.y = currentChess.yt / d;
currentChess._name = (("chess" + currentChess.y) + "_") + currentChess.x;
currentChess = undefined;
if (setChessEnabled() == 0) {
trace("no mov");
var _local1 = 0;
for (var _local2 in chessArea) {
if (typeof(chessArea[_local2]) != "movieclip") {
continue;
}
_local1++;
}
trace(_local1);
if (_local1 == 1) {
gameOver();
}
}
};
new STween(currentChess, currentChess.xt, currentChess.yt);
};
new STween(currentChess, currentChess._x + _local7, currentChess._y + _local6);
};
}
for (var each in chessArea) {
var chessman_mc = chessArea[each];
if (typeof(chessman_mc) != "movieclip") {
continue;
}
chessman_mc.x0 = (chessman_mc.x = Math.round(chessman_mc._x / d));
chessman_mc.y0 = (chessman_mc.y = Math.round(chessman_mc._y / d));
chessman_mc._name = (("chess" + chessman_mc.y) + "_") + chessman_mc.x;
chessman_mc._x = chessman_mc.x * d;
chessman_mc._y = chessman_mc.y * d;
chessman_mc.onPress = function () {
this.swapDepths(0);
selectRec._x = this._x + this._parent._x;
selectRec._y = this._y + this._parent._y;
currentChess = this;
for (var _local6 in recArea) {
var _local3 = recArea[_local6];
_local3.enabled = false;
_local3.gotoAndStop(1);
}
var _local2 = 0;
while (_local2 < 4) {
var _local5 = ltrb[_local2][0];
var _local4 = ltrb[_local2][1];
var _local3 = recArea[(("rec" + (this.y + (2 * _local4))) + "_") + (this.x + (2 * _local5))];
if (((chessArea[(("chess" + (this.y + _local4)) + "_") + (this.x + _local5)] != undefined) && (chessArea[(("chess" + (this.y + (2 * _local4))) + "_") + (this.x + (2 * _local5))] == undefined)) && (_local3 != undefined)) {
_local3.enabled = true;
_local3.gotoAndStop(2);
}
_local2++;
}
};
}
setChessEnabled();
Symbol 828 MovieClip [_jump_chess_help] Frame 1
_parent._parent.keys_mc._visible = false;
var mouse_mc = _parent._parent.mouse_mc;
Symbol 828 MovieClip [_jump_chess_help] Frame 4
mouse_mc.play();
Symbol 828 MovieClip [_jump_chess_help] Frame 19
mouse_mc.play();
Symbol 828 MovieClip [_jump_chess_help] Frame 37
mouse_mc.play();
Symbol 828 MovieClip [_jump_chess_help] Frame 47
mouse_mc.play();
Symbol 828 MovieClip [_jump_chess_help] Frame 58
stop();
_parent._parent.done_mc._visible = true;
Symbol 833 MovieClip Frame 1
function turn() {
nextFrame();
return(1);
}
Symbol 833 MovieClip Frame 2
function turn() {
prevFrame();
return(-1);
}
Symbol 834 MovieClip [_lights] Frame 1
function reset() {
total = 0;
var _local3 = 0;
while (_local3 < h) {
var _local2 = 0;
while (_local2 < w) {
dog_mc = this[(("dog" + _local3) + "") + _local2];
total = total + dog_mc.f;
dog_mc.gotoAndStop(dog_mc.f + 1);
_local2++;
}
_local3++;
}
}
function error() {
}
function gameOver() {
this.onPress = function () {
};
this.enabled = false;
onGameOver(100);
}
var w = 4;
var h = 4;
var ltrb = [[-1, 0], [0, -1], [1, 0], [0, 1]];
var total = 0;
var map = new Array(h);
var y = 0;
while (y < h) {
map[y] = new Array(w);
var x = 0;
while (x < w) {
map[y][x] = 0;
x++;
}
y++;
}
var i = 0;
while (i < 100) {
var x0 = random(w);
var y0 = random(h);
map[y0][x0] = 1 - map[y0][x0];
var j = 0;
while (j < 4) {
var x = (x0 + ltrb[j][0]);
var y = (y0 + ltrb[j][1]);
if (map[y][x] != undefined) {
map[y][x] = 1 - map[y][x];
}
j++;
}
i++;
}
var y = 0;
while (y < h) {
var x = 0;
while (x < w) {
dog_mc = this[(("dog" + y) + "") + x];
dog_mc.x = x;
dog_mc.y = y;
dog_mc.f = map[y][x];
total = total + dog_mc.f;
dog_mc.gotoAndStop(dog_mc.f + 1);
dog_mc.onPress = function () {
total = total + this.turn();
var _local2 = 0;
while (_local2 < 4) {
var _local3 = this._parent[(("dog" + (this.y + ltrb[_local2][1])) + "") + (this.x + ltrb[_local2][0])];
if (_local3 != undefined) {
total = total + _local3.turn();
}
_local2++;
}
if (total == (w * h)) {
gameOver();
}
};
x++;
}
y++;
}
Symbol 836 MovieClip [_lights_help] Frame 1
_parent._parent.keys_mc._visible = false;
var mouse_mc = _parent._parent.mouse_mc;
Symbol 836 MovieClip [_lights_help] Frame 20
mouse_mc.play();
Symbol 836 MovieClip [_lights_help] Frame 42
mouse_mc.play();
Symbol 836 MovieClip [_lights_help] Frame 43
stop();
_parent._parent.done_mc._visible = true;
Symbol 839 MovieClip [_maze] Frame 1
function reset(Void) {
}
function error(Void) {
}
function gameOver(Void) {
onGameOver(100);
}
var w = 40;
var h = 27;
var d = 16;
var targetX = 1;
var targetY = 1;
var ta = new MazeTileArea(w, h, d, targetX, targetY);
var char;
var map = new Array(h);
var ltrb = [[-1, 0], [0, -1], [1, 0], [0, 1]];
do {
var y = 0;
while (y < h) {
map[y] = new Array(w);
var x = 0;
while (x < w) {
if ((((x == 0) || (x == (w - 1))) || (y == 0)) || (y == (h - 1))) {
map[y][x] = -1;
} else {
map[y][x] = 1;
}
x++;
}
y++;
}
var seed = [[w - 2, h - 2]];
var seed2;
var x;
var y;
var x0;
var y0;
var dx;
var dy;
var L;
while (((L = seed.length)) > 0) {
seed2 = new Array();
var i = 0;
while (i < L) {
x0 = seed[i][0];
y0 = seed[i][1];
var ran = random(4);
var totalPush = 0;
var k = 0;
while (k < 3) {
var j = ((k + ran) % 4);
dx = ltrb[j][0];
dy = ltrb[j][1];
x = x0 + dx;
y = y0 + dy;
if (map[y][x] == -1) {
} else if (map[y][x] != 0) {
if (((((((dx == 0) && (map[y][x + 1] != 0)) && (map[y][x - 1] != 0)) && (map[y + dy][x + 1] != 0)) && (map[y + dy][x - 1] != 0)) && (map[y + (2 * dy)][x] != 0)) || ((((((dy == 0) && (map[y + 1][x] != 0)) && (map[y - 1][x] != 0)) && (map[y + 1][x + dx] != 0)) && (map[y - 1][x + dx] != 0)) && (map[y][x + (2 * dx)] != 0))) {
map[y][x] = 0;
totalPush++;
seed2.push([x, y]);
}
}
k++;
}
i++;
}
seed = seed2.slice();
}
var i = 0;
while (i < 4) {
if (map[targetY + ltrb[i][1]][targetX + ltrb[i][0]] == 0) {
break;
}
i++;
}
} while (i >= 4);
var brick_mc;
var y = 0;
while (y < h) {
var x = 0;
while (x < w) {
switch (map[y][x]) {
case 1 :
case -1 :
brick_mc = brickArea.attachMovie("brick_mc", (("brick" + y) + "_") + x, ta.getDepth(x, y), {_x:x * d, _y:y * d});
brick_mc.gotoAndStop(((y + x) % 2) + 1);
ta[(("t" + y) + "_") + x] = new MazeTile(x, y, false);
break;
default :
ta[(("t" + y) + "_") + x] = new MazeTile(x, y, true);
}
x++;
}
y++;
}
var xChar = (w - 2);
var yChar = (h - 2);
var char_mc = brickArea.attachMovie("maze_char_mc", "char_mc", ta.getDepth(xChar, yChar), {_x:(xChar + 0.5) * d, _y:(yChar + 0.5) * d});
char_mc.gotoAndStop(4);
char = new MazeChar(char_mc, 37, 39, 38, 40, ta, char_mc._x, char_mc._y, d / 2);
char.onWin = function () {
gameOver();
};
ta[(("t" + yChar) + "_") + xChar] = new MazeTile(x, y, true);
brick_mc = brickArea.attachMovie("brick_mc", (("brick" + targetY) + "_") + targetX, ta.getDepth(targetX, targetY), {_x:targetX * d, _y:targetY * d});
brick_mc.gotoAndStop(3);
ta[(("t" + targetY) + "_") + targetX] = new MazeTile(targetX, targetY, true);
Symbol 840 MovieClip [_maze_help] Frame 1
_parent._parent.mouse_mc._visible = false;
var keys_mc = _parent._parent.keys_mc;
Symbol 840 MovieClip [_maze_help] Frame 2
keys_mc.show(1);
Symbol 840 MovieClip [_maze_help] Frame 15
keys_mc.show(0);
Symbol 840 MovieClip [_maze_help] Frame 33
keys_mc.show(1);
Symbol 840 MovieClip [_maze_help] Frame 59
keys_mc.show(0);
Symbol 840 MovieClip [_maze_help] Frame 81
keys_mc.show(1);
Symbol 840 MovieClip [_maze_help] Frame 91
keys_mc.show(0);
Symbol 840 MovieClip [_maze_help] Frame 117
keys_mc.show(1);
Symbol 840 MovieClip [_maze_help] Frame 131
keys_mc.show(2);
Symbol 840 MovieClip [_maze_help] Frame 157
keys_mc.show(1);
Symbol 840 MovieClip [_maze_help] Frame 179
keys_mc.show(0);
Symbol 840 MovieClip [_maze_help] Frame 217
keys_mc.show(1);
Symbol 840 MovieClip [_maze_help] Frame 227
keys_mc.show(0);
Symbol 840 MovieClip [_maze_help] Frame 289
keys_mc.show(1);
Symbol 840 MovieClip [_maze_help] Frame 299
keys_mc.show(0);
Symbol 840 MovieClip [_maze_help] Frame 315
stop();
_parent._parent.done_mc._visible = true;
Symbol 842 MovieClip Frame 1
this.onPress = function () {
};
this.enabled = false;
Symbol 846 MovieClip Frame 1
function open() {
gotoAndPlay (2);
}
function close() {
gotoAndPlay (31);
}
function show(_txt) {
txt = _txt;
gotoAndPlay (2);
}
stop();
var onShow;
var onOpen;
var onClose;
Symbol 846 MovieClip Frame 15
onOpen();
Symbol 846 MovieClip Frame 41
stop();
onClose();
onShow();
Symbol 849 MovieClip [_memory] Frame 1
function reset() {
}
function gameOver() {
onGameOver(100);
}
function error() {
onError(10);
}
function disorder(arr) {
var _local4 = arr.length;
var _local3;
var _local5;
var _local1 = 0;
while (_local1 < _local4) {
_local3 = random(_local4);
_local5 = arr[_local3];
arr[_local3] = arr[_local1];
arr[_local1] = _local5;
_local1++;
}
}
stop();
var w = 4;
var h = 3;
var d = 100;
var dd = 4;
var total = (w * h);
var id_array = new Array(total);
var game = this;
hitRec._x = -10000;
var i = 0;
while (i < total) {
id_array[i] = i + 1;
i++;
}
disorder(id_array);
var x = 0;
var y = 0;
card0.stop();
var time = 10;
var delayTime = 0;
_parent._parent.timer.timeStop();
this.onEnterFrame = function () {
var _local2 = (y * w) + x;
var _local3 = cardArea.attachMovie("card_mc", (("card" + y) + "_") + x, _local2, {id:id_array[_local2], _x:x * (d + dd), _y:y * (d + dd)});
if ((++x) >= w) {
x = 0;
if ((++y) >= h) {
delete this.onEnterFrame;
this.onEnterFrame = function () {
if ((--delayTime) <= 0) {
delayTime = 30;
timerTxt.show(time--);
timerTxt.onOpen = function () {
this.stop();
if (time < 0) {
delete game.onEnterFrame;
timerTxt.close();
timerTxt.onClose = function () {
tenSec_mc._visible = false;
gotoAndStop ("close");
};
}
};
}
};
}
}
};
Symbol 849 MovieClip [_memory] Frame 2
function showRan() {
card0.id = id_array.splice(0, 1)[0];
card0.open();
card0.onOpen = function () {
hitRec._x = -10000;
};
}
hitRec._x = 0;
var x = 0;
var y = 0;
var total = 1;
disorder(id_array);
this.onEnterFrame = function () {
var _local3 = cardArea[(("card" + y) + "_") + x];
_local3.close();
if ((++x) >= w) {
x = 0;
if ((++y) >= h) {
delete this.onEnterFrame;
_local3.onClose = function () {
this.onClose = null;
showRan();
_parent._parent.timer.timeStart(_parent._parent.gameObj.time);
var _local4 = 0;
while (_local4 < h) {
var _local3 = 0;
while (_local3 < w) {
cardArea[(("card" + _local4) + "_") + _local3].onPress = function () {
hitRec._x = 0;
this.open();
this.onOpen = function () {
this.onOpen = null;
if (this.id == card0.id) {
delete this.onPress;
if ((--total) <= 0) {
gameOver();
} else {
delayTime = 10;
this.onEnterFrame = function () {
if ((--delayTime) <= 0) {
delete this.onEnterFrame;
card0.close();
card0.onClose = function () {
this.onClose = null;
showRan();
};
}
};
}
} else {
error();
delayTime = 10;
this.onEnterFrame = function () {
if ((--delayTime) <= 0) {
delete this.onEnterFrame;
this.close();
this.onClose = function () {
hitRec._x = -10000;
};
}
};
}
};
};
_local3++;
}
_local4++;
}
gotoAndStop ("run");
};
}
}
};
Symbol 854 MovieClip Frame 1
var type = "brick";
Symbol 856 MovieClip Frame 1
var type = "thorn";
Symbol 858 MovieClip Frame 1
var type = "target";
Symbol 864 MovieClip Frame 1
stop();
var type = "ball";
Symbol 864 MovieClip Frame 6
stop();
Symbol 883 MovieClip [_move_together] Frame 1
function reset() {
delete this.onEnterFrame;
gotoAndPlay (1);
}
function gameOver() {
if (stageNum == 1) {
onGameOver(40);
} else {
onGameOver(100);
}
}
function error() {
onError(10);
}
Symbol 883 MovieClip [_move_together] Frame 2
tileArea.gotoAndStop(stageNum);
Symbol 883 MovieClip [_move_together] Frame 3
function mov(dx, dy) {
var _local10 = 0;
var _local9 = false;
var _local8 = 0;
while (_local8 < totalBall) {
var _local2 = ballArr[_local8];
_local2.prevX = _local2.x;
_local2.prevY = _local2.y;
_local2.x = _local2.x + dx;
_local2.y = _local2.y + dy;
var _local7 = this[(("m" + _local2.y) + "_") + _local2.x];
switch (_local7.mc.type) {
case "thorn" :
_local2.x = _local2.x - dx;
_local2.y = _local2.y - dy;
_local2.play();
_local9 = true;
break;
case "brick" :
_local2.x = _local2.x - dx;
_local2.y = _local2.y - dy;
break;
default :
if (_local7.ball == "") {
break;
}
var _local6 = _local2.x;
var _local5 = _local2.y;
do {
_local6 = _local6 + dx;
_local5 = _local5 + dy;
var m2 = this[(("m" + _local5) + "_") + _local6];
} while (m2.ball != "");
if (!((m2.mc.type != undefined) && (m2.mc.type != "target"))) {
break;
}
_local2.x = _local2.x - dx;
_local2.y = _local2.y - dy;
}
if (_local7.mc.type == "target") {
_local10++;
}
_local2._x = _local2.x * d;
_local2._y = _local2.y * d;
_local8++;
}
_local8 = 0;
while (_local8 < totalBall) {
var _local2 = ballArr[_local8];
if (this[(("m" + _local2.prevY) + "_") + _local2.prevX].ball == _local2) {
this[(("m" + _local2.prevY) + "_") + _local2.prevX].ball = "";
}
this[(("m" + _local2.y) + "_") + _local2.x].ball = _local2;
_local8++;
}
if (_local9) {
error();
Key.removeListener(this);
delayTime = 10;
this.onEnterFrame = function () {
if ((--this.delayTime) <= 0) {
delete this.onEnterFrame;
reset();
}
};
return(undefined);
}
if (_local10 == totalBall) {
Key.removeListener(this);
gameOver();
}
}
stop();
var w = 18;
var h = 14;
var d = 30;
var ballArr = new Array();
var delayTime;
var y = 0;
while (y < h) {
var x = 0;
while (x < w) {
this[(("m" + y) + "_") + x] = {mc:"", ball:""};
x++;
}
y++;
}
for (var each in tileArea) {
var mc = tileArea[each];
if (typeof(mc.type) == "string") {
var x = Math.round(mc._x / d);
var y = Math.round(mc._y / d);
mc.x = x;
mc.y = y;
mc._x = x * d;
mc._y = y * d;
if (mc.type == "ball") {
ballArr.push(mc);
this[(("m" + y) + "_") + x].ball = mc;
mc.x0 = x;
mc.y0 = y;
} else {
this[(("m" + y) + "_") + x].mc = mc;
}
}
}
var totalBall = ballArr.length;
Key.addListener(this);
this.onKeyDown = function () {
switch (Key.getCode()) {
case 37 :
mov(-1, 0);
return;
case 39 :
mov(1, 0);
return;
case 38 :
mov(0, -1);
return;
case 40 :
mov(0, 1);
}
};
Symbol 886 MovieClip [_move_together_help] Frame 1
_parent._parent.mouse_mc._visible = false;
var keys_mc = _parent._parent.keys_mc;
var delayTime = 0;
this.onEnterFrame = function () {
if ((--delayTime) <= 0) {
delayTime = 15;
this.nextFrame();
}
};
Symbol 886 MovieClip [_move_together_help] Frame 3
keys_mc.show(0);
Symbol 886 MovieClip [_move_together_help] Frame 4
keys_mc.show(1);
Symbol 886 MovieClip [_move_together_help] Frame 5
keys_mc.show(1);
Symbol 886 MovieClip [_move_together_help] Frame 6
keys_mc.show(2);
Symbol 886 MovieClip [_move_together_help] Frame 7
keys_mc.show(2);
Symbol 886 MovieClip [_move_together_help] Frame 8
keys_mc.show(3);
Symbol 886 MovieClip [_move_together_help] Frame 9
keys_mc.show(3);
Symbol 886 MovieClip [_move_together_help] Frame 10
keys_mc.show(3);
Symbol 886 MovieClip [_move_together_help] Frame 11
keys_mc.show(3);
Symbol 886 MovieClip [_move_together_help] Frame 12
keys_mc.show(0);
Symbol 886 MovieClip [_move_together_help] Frame 13
stop();
Symbol 895 MovieClip [_order] Frame 2
function reset() {
}
function gameOver() {
onGameOver(100);
}
function error() {
}
var pg;
var d = 100;
gotoAndStop(stageNum + 2);
_parent._parent.timer.timeStop();
clickToStart_mc.show("Click to Start!");
clickToStart_mc.onOpen = function () {
clickToStart_mc.stop();
this._parent.onPress = function () {
delete this.onPress;
clickToStart_mc.close();
clickToStart_mc.onClose = function () {
pg.disorder(50);
};
pg.onDisorder = function () {
_parent._parent.timer.timeStart(_parent._parent.gameObj.time);
};
};
};
Symbol 895 MovieClip [_order] Frame 3
pg = new PicGame(mArea, "1", d, gameOver);
Symbol 895 MovieClip [_order] Frame 4
pg = new PicGame(mArea, "2", d, gameOver);
Symbol 895 MovieClip [_order] Frame 5
pg = new PicGame(mArea, "3", d, gameOver);
Symbol 895 MovieClip [_order] Frame 6
pg = new PicGame(mArea, "4", d, gameOver);
Symbol 895 MovieClip [_order] Frame 7
pg = new PicGame(mArea, "5", d, gameOver);
Symbol 898 MovieClip [_order_help] Frame 1
_parent._parent.keys_mc._visible = false;
var mouse_mc = _parent._parent.mouse_mc;
Symbol 898 MovieClip [_order_help] Frame 24
mouse_mc.play();
Symbol 898 MovieClip [_order_help] Frame 39
mouse_mc.play();
Symbol 898 MovieClip [_order_help] Frame 52
mouse_mc.play();
Symbol 898 MovieClip [_order_help] Frame 65
mouse_mc.play();
Symbol 898 MovieClip [_order_help] Frame 78
mouse_mc.play();
Symbol 898 MovieClip [_order_help] Frame 91
stop();
_parent._parent.done_mc._visible = true;
Symbol 918 MovieClip Frame 7
stop();
Symbol 919 MovieClip Frame 1
function setVolume(_vol) {
maxVol = _vol;
body._xscale = (body._yscale = (shape._xscale = (shape._yscale = Math.sqrt(maxVol / 7) * 100)));
glass._x = (body._xscale / 100) * 50;
h = body._height * k;
w = maxVol / h;
yBottom = body._height;
y0 = (this._y = this._y - body._height);
volTxt_mc._y = body._height + 20;
}
function pour(_glass_mc) {
glass_mc = _glass_mc;
prevVol = vol;
glass_mc.prevVol = glass_mc.vol;
nextVol = vol - (glass_mc.maxVol - glass_mc.vol);
if (nextVol < 0) {
nextVol = 0;
}
glass_mc.nextVol = (glass_mc.vol + vol) - nextVol;
nextA = getA(nextVol);
a = 0;
this.onEnterFrame = function () {
if (((a = a + v)) >= nextA) {
a = nextA;
setWater(nextVol);
glass_mc.setWater(glass_mc.nextVol);
delete this.onEnterFrame;
this.onEnterFrame = function () {
a = a * 0.6;
drops._visible = false;
if (((glass._rotation = (a * 180) / Math.PI)) < 1) {
delete this.onEnterFrame;
glass._rotation = (a = 0);
onPour();
}
vol = Math.round(vol);
setWater(vol);
};
} else {
var _local2 = vol;
glass_mc.setWater((glass_mc.prevVol + prevVol) - vol);
}
glass._rotation = (a * 180) / Math.PI;
setWater(vol);
if (_local2 != vol) {
drops._visible = true;
}
};
}
function setWater(_vol) {
if (isNaN(_vol)) {
_vol = maxVol;
}
vol = int(_vol * 100) / 100;
var _local1 = Math.tan(a);
if (_local1 == 0) {
y = vol / w;
if (y > h) {
y = h;
vol = maxVol;
}
} else {
var y = Math.sqrt((2 * vol) * _local1);
if ((y / _local1) > w) {
y = (vol / w) + ((_local1 * w) / 2);
if (y > h) {
y = h;
vol = maxVol - (((w * w) * _local1) / 2);
}
} else if (y > h) {
y = h;
vol = ((h * h) / _local1) / 2;
}
}
water_mc._y = yBottom - (y / k);
water_mc._rotation = -glass._rotation;
}
function getA(_vol) {
var _local1;
if (_vol < (maxVol / 2)) {
_local1 = Math.atan2(h * h, 2 * _vol);
} else {
_local1 = Math.atan2(2 * ((w * h) - _vol), w * w);
}
if (_local1 < 0) {
_local1 = 0;
} else if (_local1 > (Math.PI/2)) {
_local1 = (Math.PI/2);
}
return(_local1);
}
drops._visible = false;
var body = glass.body;
var shape = glass.shape;
var water_mc = glass.water_mc;
var x0 = this._x;
var y0;
var yBottom;
var k = 0.0192450089729875;
var w;
var h;
var a = 0;
var maxVol;
var vol = 0;
var prevVol;
var nextVol;
var nextA;
var onPour;
var v = 0.1;
var glass_mc;
Symbol 920 MovieClip [_water] Frame 1
function reset() {
gotoAndPlay (2);
}
function gameOver() {
onGameOver(100);
}
function error() {
}
var arr_array = [[8, 5, 3], [10, 7, 3], [12, 7, 5]];
if (stageNum > 3) {
stageNum = 3;
}
var arr = arr_array[stageNum - 1];
_parent._parent.instruction = ("Pour water from one jug unto another to make 2 jugs contain exactly " + (arr[0] / 2)) + " litres of water.";
Symbol 920 MovieClip [_water] Frame 2
for (var each in this) {
this[each].removeMovieClip();
}
Symbol 920 MovieClip [_water] Frame 4
var i = 0;
while (i < 3) {
this["glass" + i]._visible = false;
i++;
}
Symbol 920 MovieClip [_water] Frame 5
function setEnabled(isFull) {
if (isFull == undefined) {
var _local2 = 0;
while (_local2 < 3) {
var _local3 = this["glass" + _local2];
_local3.enabled = false;
_local2++;
}
} else if (isFull) {
var _local2 = 0;
while (_local2 < 3) {
var _local3 = this["glass" + _local2];
_local3.enabled = (_local3 == currentGlass) || (_local3.vol != _local3.maxVol);
_local2++;
}
} else {
var _local2 = 0;
while (_local2 < 3) {
var _local3 = this["glass" + _local2];
_local3.enabled = _local3.vol != 0;
_local2++;
}
}
}
stop();
var stween = undefined;
var currentGlass = undefined;
var i = 0;
while (i < 3) {
var glass = this["glass" + i];
glass._visible = true;
glass.setVolume(arr[i]);
glass.onPress = function () {
if (currentGlass == undefined) {
this.swapDepths(0);
currentGlass = this;
stween = new STween(this, this._x, this.y0 - 100);
setEnabled(true);
this.volTxt_mc._visible = (this.maxVolTxt_mc._visible = false);
} else if (currentGlass == this) {
stween = new STween(this, this._x, this.y0);
stween.onMov = function (glass) {
glass.volTxt_mc._visible = (glass.maxVolTxt_mc._visible = true);
};
setEnabled(false);
currentGlass = undefined;
} else {
setEnabled();
stween = new STween(currentGlass, this._x - 50, ((this.y0 < currentGlass.y0) ? (this.y0 - 50) : (currentGlass.y0 - 10)));
stween.onMov = function (glass) {
glass.pour(currentGlass);
glass.onPour = function () {
stween = new STween(this, this.x0, this._y);
stween.onMov = function (glass) {
stween = new STween(glass, glass._x, glass.y0);
stween.onMov = function (glass) {
glass.volTxt_mc._visible = (glass.maxVolTxt_mc._visible = true);
if (Math.round(glass0.vol) == Math.round(glass1.vol)) {
gameOver();
} else {
setEnabled(false);
}
};
};
};
currentGlass = undefined;
};
currentGlass = this;
}
};
i++;
}
glass0.setWater();
glass1.setWater(0);
glass2.setWater(0);
setEnabled(false);
Symbol 922 MovieClip [_water_help] Frame 1
_parent._parent.keys_mc._visible = false;
var mouse_mc = _parent._parent.mouse_mc;
var arr = [12, 7, 5];
_parent._parent.instruction = "Pour water from one jug unto another to make 2 jugs contain exactly 6 litres of water.";
Symbol 922 MovieClip [_water_help] Frame 4
var i = 0;
while (i < 3) {
this["glass" + i]._visible = false;
i++;
}
Symbol 922 MovieClip [_water_help] Frame 5
function getGlass(id) {
var _local2 = this["glass" + id];
if (currentGlass == undefined) {
_local2.swapDepths(0);
currentGlass = _local2;
stween = new STween(_local2, _local2._x, _local2.y0 - 100);
_local2.volTxt_mc._visible = (_local2.maxVolTxt_mc._visible = false);
}
}
function pourTo(id) {
var glass = this["glass" + id];
stween = new STween(currentGlass, glass._x - 50, ((glass.y0 < currentGlass.y0) ? (glass.y0 - 50) : (currentGlass.y0 - 10)));
stween.onMov = function (glass) {
glass.pour(currentGlass);
glass.onPour = function () {
stween = new STween(glass, glass.x0, glass._y);
stween.onMov = function (glass) {
stween = new STween(glass, glass._x, glass.y0);
stween.onMov = function (glass) {
glass.volTxt_mc._visible = (glass.maxVolTxt_mc._visible = true);
onPour();
};
};
};
currentGlass = undefined;
};
currentGlass = glass;
}
stop();
var i = 0;
while (i < 3) {
var glass = this["glass" + i];
glass._visible = true;
glass.setVolume(arr[i]);
i++;
}
var stween = undefined;
var currentGlass = undefined;
glass0.setWater(11);
glass1.setWater(1);
glass2.setWater(0);
getGlass(0);
pourTo(2);
onPour = function () {
getGlass(2);
pourTo(1);
onPour = function () {
_parent._parent.done_mc._visible = true;
};
};
Symbol 929 MovieClip Frame 1
function show(_info) {
info = _info;
gotoAndPlay ("show");
}
function hide(Void) {
gotoAndPlay ("hide");
}
stop();
var info;
var onShow;
var onHide;
var onEffect;
Symbol 929 MovieClip Frame 6
onShow();
Symbol 929 MovieClip Frame 51
stop();
onHide();
onEffect();
Symbol 939 MovieClip Frame 1
stop();
Symbol 943 MovieClip Frame 1
stop();
Symbol 943 MovieClip Frame 100
stop();
Symbol 949 MovieClip Frame 1
function effect(Void) {
play();
}
stop();
var onEffect;
Symbol 949 MovieClip Frame 14
onEffect();
Symbol 954 MovieClip Frame 1
stop();
this.onPress = function () {
};
this.enabled = false;
Symbol 955 MovieClip Frame 1
function setEnabled(value) {
if (value) {
charNameMaskRec.prevFrame();
} else {
charNameMaskRec.nextFrame();
}
}
Symbol 958 MovieClip Frame 1
stop();
Symbol 959 MovieClip Frame 1
function turnDark(_mc) {
_mc.setEnabled(false);
}
function turnColorful(_mc) {
_mc.setEnabled(true);
}
var charNameTxt = charName_mc.charNameTxt;
charNameTxt.text = charName;
selectTxt_mc._visible = false;
if (isNaN(com_humanIndex)) {
com_humanIndex = 0;
}
com_human.labelArr = ["computer", "human", "not playing"];
com_human.selectedIndex = com_humanIndex;
com_human.onSelect = function (selectedLabel) {
switch (selectedLabel) {
case "computer" :
gotoAndStop (2);
break;
case "human" :
gotoAndStop (3);
break;
case "not playing" :
gotoAndStop (4);
}
};
com_diff.labelArr = ["dumb", "ordinary", "genius"];
com_diff.selectedIndex = 1;
com_diff.onSelect = function () {
};
gotoAndStop(com_humanIndex + 2);
com_diff.onOpen = (com_human.onOpen = function () {
if (_parent.currentCombo != this) {
_parent.currentCombo.close();
_parent.currentCombo = this;
}
Selection.setFocus(selectTxt_mc.charNameTxt);
});
Symbol 959 MovieClip Frame 2
function getInfo(Void) {
return(["computer", charNameTxt.text, com_diff.selectedIndex]);
}
turnColorful(com_diff);
turnColorful(charName_mc);
charNameTxt.text = charName;
Symbol 959 MovieClip Frame 3
function getInfo(Void) {
return(["hero", charNameTxt.text, com_diff.selectedIndex]);
}
turnDark(com_diff);
turnColorful(charName_mc);
charNameTxt.text = "";
Selection.setFocus(charNameTxt);
Symbol 959 MovieClip Frame 4
function getInfo(Void) {
return(["not playing", "0", com_diff.selectedIndex]);
}
turnDark(com_diff);
turnDark(charName_mc);
Selection.setFocus(selectTxt_mc.charNameTxt);
Symbol 965 MovieClip Frame 1
stop();
if (getMusic(this) == false) {
gotoAndStop (2);
}
Symbol 965 MovieClip Frame 2
stop();
Symbol 965 MovieClip Frame 3
gotoAndStop (1);
Symbol 966 Button
on (press) {
play();
}
Symbol 967 MovieClip Frame 1
stop();
if (getSound(this) == false) {
gotoAndStop (2);
}
Symbol 967 MovieClip Frame 2
stop();
Symbol 967 MovieClip Frame 3
gotoAndStop (1);
Symbol 969 Button
on (release) {
gotoAndStop (2);
}
Symbol 973 Button
on (release) {
_parent.game_setQuality(1);
}
Symbol 976 MovieClip Frame 1
stop();
Symbol 978 Button
on (release) {
_parent.game_setQuality(2);
}
Symbol 981 MovieClip Frame 1
stop();
Symbol 983 Button
on (release) {
_parent.game_setQuality(3);
}
Symbol 986 MovieClip Frame 1
stop();
Symbol 988 Button
on (release) {
_parent.game_setQuality(4);
}
Symbol 990 MovieClip Frame 1
stop();
Symbol 991 Button
on (release) {
gotoAndStop (1);
}
Symbol 992 MovieClip Frame 1
function game_setQuality(num) {
game_quality = num;
menu_quality.mc_1.gotoAndStop(1);
menu_quality.mc_2.gotoAndStop(1);
menu_quality.mc_3.gotoAndStop(1);
menu_quality.mc_4.gotoAndStop(1);
menu_quality["mc_" + game_quality].gotoAndStop(2);
if (num == 1) {
_quality = "LOW";
} else if (num == 2) {
_quality = "MEDIUM";
} else if (num == 4) {
_quality = "BEST";
} else {
_quality = "HIGH";
}
gotoAndStop (1);
}
function game_getQuality(obj) {
if (_quality == "LOW") {
game_quality = 1;
} else if (_quality == "MEDIUM") {
game_quality = 2;
} else if (_quality == "BEST") {
game_quality = 4;
} else {
game_quality = 3;
}
obj.mc1.gotoAndStop(1);
obj.mc2.gotoAndStop(1);
obj.mc3.gotoAndStop(1);
obj.mc4.gotoAndStop(1);
obj["mc_" + game_quality].gotoAndStop(2);
menu_quality = obj;
}
stop();
var game_quality;
var menu_quality;
Symbol 992 MovieClip Frame 2
game_getQuality(this);
Instance of Symbol 970 MovieClip in Symbol 992 MovieClip Frame 2
on (release) {
}
Instance of Symbol 965 MovieClip in Symbol 993 MovieClip Frame 1
on (release) {
_root.setMusic(this);
}
Instance of Symbol 967 MovieClip "sound_mc" in Symbol 993 MovieClip Frame 1
on (release) {
_root.setSound(this);
}
Symbol 998 MovieClip Frame 1
stop();
Instance of Symbol 190 MovieClip in Symbol 998 MovieClip Frame 2
//component parameters
onClipEvent (construct) {
_game_name = "";
score_var = "";
}
Symbol 1005 Button
on (press) {
stopAllSounds();
musicStop();
gotoAndStop ("start");
}
Symbol 1009 MovieClip Frame 1
stop();
Symbol 1014 Button
on (press) {
musicStop();
gotoAndStop ("start");
}
Symbol 1019 Button
on (release) {
viewHighscore();
}