Frame 1
System.security.allowDomain("dev.warnerbros.com");
System.security.allowDomain("preview.warnerbros.com");
System.security.allowDomain("www2.warnerbros.com");
System.security.allowDomain("pdl.warnerbros.com");
Object.prototype.gameMC = this;
Object.prototype.containerMC = _parent;
if (containerMC != null) {
containerMC.init();
_root.gDebug = "InContainer\n";
}
gameMc.pathVideo = "video240x180.swf";
gameMC.gLevel = 1;
gameMC.gScore = 0;
gameMC.gLives = 3;
gameMC.gLevelCompleted = 0;
gameMC.gLevelFail = false;
gameMC.gLoadInit = false;
gameMC.gGameState = "INIT";
gameMC.gLoadStartTime = 0;
gameMC.gVersionNum = "1.0";
gameMC.gPaused = false;
gameMC.gInitGame = null;
gameMC.min_score = -1;
trace("GameParent: " + _parent);
if (gameMC.gGameID eq "") {
gameMC.gGameID = "smallville_kryptonsweeper";
}
if (gameMC.gHSRoot_swf eq "") {
gameMC.gHSRoot_swf = "../med/";
}
if (gameMC.gHSRoot_jsp eq "") {
gameMC.gHSRoot_jsp = "/web/load_variables/games/";
}
if (gameMC.gHSRoot_top100 eq "") {
gameMC.gHSRoot_top100 = "/web/games/";
}
function getScore() {
return(gameMC.gScore);
}
function showDebugWindow() {
gameMC.debug_clip.showDebug();
}
function hideDebugWindow() {
gameMC.debug_clip.hideDebug();
}
function pause() {
gameMC.gPaused = true;
}
function unPause() {
gameMC.gPaused = false;
}
function restart() {
containerMC.resetContainer();
containerMC.init();
gameMC.gScore = 0;
gameMC.gLevel = 1;
}
gameMC.HSLoading = function () {
if (gameMC.gLoadInit != true) {
gameMC.gGameState = "LOADING";
gameMC.gLoadStartTime = int(getTimer() / 1000);
gameMC.gLoadInit = true;
}
gameMC.gDebug = gameMC.gDebug + "HSLoading\n";
};
gameMC.HSLoaded = function () {
tellTarget (gameMC.hs_scripts) {
call("mLoaded");
};
loadVariablesNum ((((("http://www2.warnerbros.com/all/tracking.html?game=" add /:gGameID) add "&stage=0&timer=") add gameMC.gLoadStartTime) add "&random_id=") add gameMC.gLoadStartTime, 0);
trace((((("Tracking Called http://www2.warnerbros.com/all/tracking.html?game=" add /:gGameID) add "&stage=0&timer=") add gameMC.gLoadStartTime) add "&random_id=") add gameMC.gLoadStartTime);
gameMC.gDebug = gameMC.gDebug + "HSLoaded\n";
};
gameMC.HSPlay = function () {
tellTarget (gameMC.hs_scripts) {
call("mPlay");
};
gameMC.gDebug = gameMC.gDebug + "HSPlay\n";
};
gameMC.HSLevelStart = function () {
tellTarget (gameMC.hs_scripts) {
call("mLevelStart");
};
gameMC.gDebug = gameMC.gDebug + "HSLevelStart\n";
};
gameMC.HSGameOver = function () {
gameMC.gDebug = gameMC.gDebug + "Container : \n";
gameMC.gScore = Number(gameMC.gScore);
gameMC.gLevel = Number(gameMC.gLevel);
if (gameMC.gScore >= gameMC.min_score) {
if (containerMC != null) {
containerMC.hs_placeholder.loadMovie(gHSRoot_swf + "HSDialog.swf");
containerMC.hs_placeholder._x = 100;
containerMC.hs_placeholder._y = 100;
gameMC.gDebug = gameMC.gDebug + "load HSDialog from container\n";
} else {
gameMC.hs_placeholder.loadMovie(gHSRoot_swf + "HSDialog.swf");
gameMC.hs_placeholder._x = 100;
gameMC.hs_placeholder._y = 100;
gameMC.gDebug = gameMC.gDebug + "load HSDialog from game\n";
}
}
tellTarget (gameMC.hs_scripts) {
call("mGameOver");
};
gameMC.gLoadEndTime = int(getTimer() / 1000);
gameMC.gDebug = gameMC.gDebug + (("Final Score : " + gameMC.gScore) + newline);
loadVariablesNum ((((((("http://www2.warnerbros.com/all/tracking.html?game=" add /:gGameID) add "&stage=") add (gameMC.gLevelCompleted + 1)) add "&timer=") add (gameMC.gLoadEndTime - gameMC.gLoadStartTime)) add "&random_id=") add gameMC.gLoadEndTime, 0);
trace((((((("Tracking Called http://www2.warnerbros.com/all/tracking.html?game=" add /:gGameID) add "&stage=") add (gameMC.gLevelCompleted + 1)) add "&timer=") add (gameMC.gLoadEndTime - gameMC.gLoadStartTime)) add "&random_id=") add gameMC.gLoadEndTime);
};
function cTimer() {
this.startTime = getTimer();
}
cTimer.prototype.restartTimer = function () {
this.startTime = getTimer();
};
cTimer.prototype.milliseconds = function () {
return(getTimer() - this.startTime);
};
cTimer.prototype.seconds = function () {
return(this.getSeconds());
};
cTimer.prototype.getSeconds = function () {
return(int((getTimer() - this.startTime) / 1000));
};
gameMC.iReadyScreenTimer = new cTimer();
gameMC.iLevelPauseTimer = new cTimer();
gameMC.btn_handler_next_screen = function () {
gameMC.play();
};
gameMC.btn_handler_play = function () {
gameMC.gotoAndPlay("NextLevel");
};
gameMC.btn_handler_gameover = function () {
gameMC.gotoAndPlay("GameOver");
};
gameMC.btn_handler_restart = function () {
gameMC.gotoAndPlay(1);
};
Frame 4
ifFrameLoaded (95) {
if (gameMC.gLoadHSScripts == true) {
_root.gDebug = _root.gDebug + "WaitingForScripts\n";
if (gameMC.hs_scripts.gLoaded == true) {
gameMC.gotoAndPlay("loaded");
}
} else {
gameMC.gotoAndPlay("loaded");
}
}
gameMC.HSLoading();
Instance of Symbol 63 MovieClip "debug_clip" in Frame 4
onClipEvent (load) {
function showDebug() {
_visible = true;
_x = 200;
}
function hideDebug() {
_visible = false;
_x = -200;
}
function displayDebugSettings() {
var _local2 = _root;
_local2.gDebug = "Settings:\n";
_local2.gDebug = _local2.gDebug + (("ID: " + gameMC.gGameID) + newline);
_local2.gDebug = _local2.gDebug + (("Domain: " + gameMC.gDB_domain) + newline);
_local2.gDebug = _local2.gDebug + (("HSRoot_swf: " + gameMC.gHSRoot_swf) + newline);
_local2.gDebug = _local2.gDebug + (("HSRoot_jsp: " + gameMC.gHSRoot_jsp) + newline);
_local2.gDebug = _local2.gDebug + (("HSRoot_top100: " + gameMC.gHSRoot_top100) + newline);
}
_root.gDebug = _root.gDebug + "Loaded";
if (gameMC.gDebugMode == true) {
showDebug();
}
}
Instance of Symbol 269 MovieClip "ks" in Frame 4
onClipEvent (load) {
this.onLevelInit = function () {
var _local2 = 0;
var _local1 = 0;
var _local3 = 0;
if (gameMC.gLevel == 1) {
main.timerSec = 120;
main.timerTxt = "0:00";
_local2 = 8;
_local1 = 8;
_local3 = 10;
if (gameStyle != "gameClassic") {
(sweeper.gotoAndStop("level1Skew"));// not popped
} else {
(sweeper.gotoAndStop("level1"));// not popped
}
} else if (gameMC.gLevel == 2) {
main.timerSec = 180;
main.timerTxt = "0:00";
_local2 = 10;
_local1 = 10;
_local3 = 20;
if (gameStyle != "gameClassic") {
(sweeper.gotoAndStop("level2Skew"));// not popped
} else {
(sweeper.gotoAndStop("level2"));// not popped
}
} else if (gameMC.gLevel >= 3) {
main.timerSec = 240;
main.timerTxt = "0:00";
_local2 = 15;
_local1 = 10;
_local3 = 30;
if (gameStyle != "gameClassic") {
(sweeper.gotoAndStop("level3Skew"));// not popped
} else {
(sweeper.gotoAndStop("level3"));// not popped
}
}
main.reset(_local2, _local1, _local3);
};
}
Frame 6
gameMC.gotoAndPlay("loading");
Frame 9
dynamicVideo.loadMovie(gameMC.pathVideo);
gameMC.HSLoaded();
Instance of Symbol 275 MovieClip "dynamicVideo" in Frame 9
onClipEvent (load) {
this.gotoAndStop(1);
}
Frame 15
screen_title.gotoAndPlay("title");
masqueInvisible.useHandCursor = false;
Instance of Symbol 284 MovieClip "Cr_clip" in Frame 15
onClipEvent (load) {
function mKeyStroke() {
var _local1;
var _local2 = -1;
if ((getTimer() - pCrTimer) > 400) {
_local1 = 1;
while (_local1 < 91) {
if (Key.isDown(_local1)) {
_local2 = _local1;
}
_local1++;
}
if (_local2 >= 48) {
pCrCheck = (pCrCheck + _local2) + ":";
trace("CrCheck: " + pCrCheck);
pCrTimer = getTimer();
if (pCrCheck == "87:66:67:72:48:52:") {
trace("OK");
pCrCheck = "";
pCrOn = true;
mCr();
}
} else if ((_local2 == 13) || (_local2 == 32)) {
pCrCheck = "";
pCrTimer = getTimer();
}
}
}
function mCr() {
trace("mCr");
this.gotoAndPlay("show");
gameMC.debug_clip.showDebug();
gameMC.debug_clip.displayDebugSettings();
}
}
onClipEvent (enterFrame) {
mKeyStroke();
}
Frame 16
stop();
Frame 21
screen_title.gotoAndStop("instructions");
Frame 22
stop();
Frame 29
gameMC.HSPlay();
Frame 30
stop();
Frame 34
screen_instructions._visible = false;
AsBroadcaster.initialize(gameMC);
gameMC.addListener(ks.board.lifeCpt);
gameMC.addListener(ks);
if (!gameMC.gLevelFail) {
gameMC.broadcastMessage("onLevelInit");
}
gameMC.broadcastMessage("onLifeChange");
gameMC.gLevelFail = false;
gameMC.gotoAndPlay("Ready");
gameMC.HSLevelStart();
Frame 40
gameMC.iReadyScreenTimer.restartTimer();
Frame 41
if (iReadyScreenTimer.getSeconds() < 1) {
} else {
gameMC.gotoAndPlay("MainLoop");
}
Frame 42
gameMC.gotoAndPlay(_currentframe - 1);
Frame 47
if (!gameMC.gPaused) {
if (Key.isDown(81)) {
gameMC.gotoAndPlay("GameOver");
}
}
Frame 48
gameMC.gotoAndPlay("MainLoop");
Frame 56
gameMC.iLevelPauseTimer.restartTimer();
masqueInvisible.useHandCursor = false;
Frame 57
if (_root.iLevelPauseTimer.seconds() > 0) {
gameMC.gLives--;
gameMC.broadcastMessage("onLifeChange");
gameMC.gotoAndPlay("screenFailedShow");
}
Frame 58
gameMC.gotoAndPlay(_currentframe - 1);
gameMC.gLevelCompleted = 0;
gameMC.gLevelFail = true;
Frame 59
stop();
Frame 65
gameMC.iLevelPauseTimer.restartTimer();
masqueInvisible.useHandCursor = false;
Frame 66
if (_root.iLevelPauseTimer.seconds() > 1) {
gameMC.gotoAndPlay("screenCompleteShow");
}
Frame 67
gameMC.gotoAndPlay(_currentframe - 1);
Frame 68
dynamicVideo._x = 10;
dynamicVideo._y = 125.2;
dynamicVideo.gotoAndPlay(1);
gameMC.gLevelCompleted++;
stop();
Frame 82
gameMC.iLevelPauseTimer.restartTimer();
masqueInvisible.useHandCursor = false;
gameMC.HSGameOver();
Frame 83
if (_root.iLevelPauseTimer.seconds() > 2) {
gameMC.gotoAndPlay("screenGameOverShow");
}
Frame 84
gameMC.gotoAndPlay(_currentframe - 1);
Frame 85
gameMC.broadcastMessage("onLifeChange");
restart.onRelease = gameMC.btn_handler_restart;
stop();
Frame 103
stop();
Symbol 4 MovieClip [hs_placeholder] Frame 5
stop();
Instance of Symbol 25 MovieClip "loader" in Symbol 26 MovieClip Frame 1
onClipEvent (load) {
var total = _root.getBytesTotal();
var pourcent = 0;
}
onClipEvent (enterFrame) {
var loading = _root.getBytesLoaded();
pourcent = pourcent - ((pourcent - ((loading / total) * 100)) * 0.25);
per = int(pourcent);
pourcentage = per + "%";
barLoad._width = (per / 100) * 91;
}
Symbol 58 MovieClip Frame 1
this.loadMovie(gameMC.gHSRoot_swf + "HSScripts.swf");
Symbol 58 MovieClip Frame 4
stop();
Symbol 61 Button
on (press) {
startDrag ("");
}
on (release) {
stopDrag();
}
Symbol 62 Button
on (release) {
gameMC.gDebug = "";
}
Symbol 63 MovieClip Frame 5
stop();
Symbol 76 Button
on (press) {
sweeper.board.timer.onEnterFrame = main.startTimer;
main.clickSquare(this.X, this.Y);
}
Symbol 110 MovieClip Frame 21
stop();
Symbol 112 MovieClip Frame 21
stop();
Symbol 114 MovieClip Frame 21
stop();
Symbol 116 MovieClip Frame 21
stop();
Symbol 118 MovieClip Frame 21
stop();
Symbol 120 MovieClip Frame 21
stop();
Symbol 122 MovieClip Frame 21
stop();
Symbol 124 MovieClip Frame 21
stop();
Symbol 163 MovieClip Frame 17
stop();
Symbol 179 MovieClip Frame 21
stop();
Symbol 181 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 1
stop();
_global.main = this;
var levelStart = false;
var nbrBomb = 10;
var loadSquare = 0;
var grilleWidth = 8;
var grilleHeight = 8;
var grille_array = new Array();
var depthSquare = 100;
var cptB = 0;
var cptF = 0;
var timerSec = 120;
var timerLevel = 0;
var timerTxt = "0:00";
var cptFrame = -5;
this.initGrille = function (x, y) {
grille_array.splice(0);
var _local4 = 0;
while (_local4 < grilleHeight) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < grilleWidth) {
var _local5 = (("squareL" + _local4) + "C") + _local2;
_local3.push(square.duplicateMovieClip(_local5, depthSquare++));
_local3[_local2]._x = _local2 * square._width;
_local3[_local2]._y = _local4 * square._height;
_local2++;
}
grille_array.push(_local3);
_local4++;
}
this.onEnterFrame = function () {
if (loadSquare >= (grilleWidth * grilleHeight)) {
delete this.onEnterFrame;
initSquare(x, y);
}
};
cpt_bomb = nbrBomb;
};
this.initSquare = function (posX, posY) {
var _local2 = 0;
while (_local2 < nbrBomb) {
var _local5 = random(grilleHeight - 1);
var _local4 = random(grilleWidth);
if (((_local5 != posX) || (_local4 != posY)) && (grille_array[_local5][_local4].frame != "bombe")) {
grille_array[_local5][_local4].frame = "bombe";
} else {
_local2--;
}
_local2++;
}
_local2 = 0;
while (_local2 < grilleHeight) {
var _local1 = 0;
while (_local1 < grilleWidth) {
if (grille_array[_local2][_local1].frame != "bombe") {
var _local3 = 0;
var _local5 = _local2 - 1;
var _local4 = _local1 - 1;
if (grille_array[_local5][_local4].frame == "bombe") {
_local3++;
}
_local5 = _local2 - 1;
_local4 = _local1;
if (grille_array[_local5][_local4].frame == "bombe") {
_local3++;
}
_local5 = _local2 - 1;
_local4 = _local1 + 1;
if (grille_array[_local5][_local4].frame == "bombe") {
_local3++;
}
_local5 = _local2;
_local4 = _local1 - 1;
if (grille_array[_local5][_local4].frame == "bombe") {
_local3++;
}
_local5 = _local2;
_local4 = _local1 + 1;
if (grille_array[_local5][_local4].frame == "bombe") {
_local3++;
}
_local5 = _local2 + 1;
_local4 = _local1 - 1;
if (grille_array[_local5][_local4].frame == "bombe") {
_local3++;
}
_local5 = _local2 + 1;
_local4 = _local1;
if (grille_array[_local5][_local4].frame == "bombe") {
_local3++;
}
_local5 = _local2 + 1;
_local4 = _local1 + 1;
if (grille_array[_local5][_local4].frame == "bombe") {
_local3++;
}
switch (_local3) {
case 0 :
grille_array[_local2][_local1].frame = "nothing";
break;
case 1 :
grille_array[_local2][_local1].frame = "2";
break;
case 2 :
grille_array[_local2][_local1].frame = "3";
break;
case 3 :
grille_array[_local2][_local1].frame = "4";
break;
case 4 :
grille_array[_local2][_local1].frame = "5";
break;
case 5 :
grille_array[_local2][_local1].frame = "6";
break;
case 6 :
grille_array[_local2][_local1].frame = "7";
break;
case 7 :
grille_array[_local2][_local1].frame = "8";
break;
case 8 :
grille_array[_local2][_local1].frame = "9";
}
}
grille_array[_local2][_local1].X = _local2;
grille_array[_local2][_local1].Y = _local1;
_local1++;
}
_local2++;
}
cpt_bomb = nbrBomb;
if (Key.isDown(17)) {
grille_array[posX][posY].flag = true;
cpt_bomb--;
if (sweeper.gameStyle != "gameSkew") {
(grille_array[posX][posY].gotoAndStop("flag"));// not popped
} else {
(grille_array[posX][posY].gotoAndStop("flagSkew"));// not popped
}
} else {
if (grille_array[posX][posY].frame == "nothing") {
checkEmpty(posX, posY);
}
grille_array[posX][posY].gotoAndStop(grille_array[posX][posY].frame);
}
grille_array[posX][posY].turned = true;
};
this.reset = function (width, height, bomb, x, y) {
var _local2 = 0;
while (_local2 < grilleHeight) {
var _local1 = 0;
while (_local1 < grilleWidth) {
removeMovieClip(grille_array[_local2][_local1]);
_local1++;
}
_local2++;
}
timerLevel = 0;
nbrBomb = bomb;
grilleWidth = width;
grilleHeight = height;
initGrille(x, y);
};
this.checkEmpty = function (x, y) {
var _local2 = y;
var _local1 = x;
if ((grille_array[_local1][_local2].turned != true) && (grille_array[_local1][_local2].frame == "nothing")) {
grille_array[_local1][_local2].turned = true;
grille_array[_local1][_local2].gotoAndStop(grille_array[_local1][_local2].frame);
checkEmpty(_local1 - 1, _local2 - 1);
checkEmpty(_local1, _local2 - 1);
checkEmpty(_local1 + 1, _local2 - 1);
checkEmpty(_local1 - 1, _local2);
checkEmpty(_local1 + 1, _local2);
checkEmpty(_local1 - 1, _local2 + 1);
checkEmpty(_local1, _local2 + 1);
checkEmpty(_local1 + 1, _local2 + 1);
} else if (!grille_array[_local1][_local2].flag) {
grille_array[_local1][_local2].turned = true;
grille_array[_local1][_local2].gotoAndStop(grille_array[_local1][_local2].frame);
}
};
this.checkEndOfLevel = function () {
var _local3 = true;
var _local2 = 0;
while (_local2 < grilleHeight) {
var _local1 = 0;
while (_local1 < grilleWidth) {
if (!grille_array[_local2][_local1].turned) {
_local3 = false;
}
_local1++;
}
_local2++;
}
if (_local3 && (cpt_bomb == 0)) {
levelStart = false;
delete sweeper.board.timer.onEnterFrame;
compileScore();
gameMC.gotoAndPlay("LevelComplete");
}
};
this.testShiftClick = function (x, y) {
var _local2 = y;
var _local1 = x;
cptB = 0;
cptF = 0;
(((grille_array[_local1 - 1][_local2 - 1].frame == "bombe") || (grille_array[_local1 - 1][_local2 - 1].frame == "bombeDiscover")) ? (cptB++) : null);
(((grille_array[_local1][_local2 - 1].frame == "bombe") || (grille_array[_local1][_local2 - 1].frame == "bombeDiscover")) ? (cptB++) : null);
(((grille_array[_local1 + 1][_local2 - 1].frame == "bombe") || (grille_array[_local1 + 1][_local2 - 1].frame == "bombeDiscover")) ? (cptB++) : null);
(((grille_array[_local1 - 1][_local2].frame == "bombe") || (grille_array[_local1 - 1][_local2].frame == "bombeDiscover")) ? (cptB++) : null);
(((grille_array[_local1 + 1][_local2].frame == "bombe") || (grille_array[_local1 + 1][_local2].frame == "bombeDiscover")) ? (cptB++) : null);
(((grille_array[_local1 - 1][_local2 + 1].frame == "bombe") || (grille_array[_local1 - 1][_local2 + 1].frame == "bombeDiscover")) ? (cptB++) : null);
(((grille_array[_local1][_local2 + 1].frame == "bombe") || (grille_array[_local1][_local2 + 1].frame == "bombeDiscover")) ? (cptB++) : null);
(((grille_array[_local1 + 1][_local2 + 1].frame == "bombe") || (grille_array[_local1 + 1][_local2 + 1].frame == "bombeDiscover")) ? (cptB++) : null);
((grille_array[_local1 - 1][_local2 - 1].flag || (grille_array[_local1 - 1][_local2 - 1].frame == "bombeDiscover")) ? (cptF++) : null);
((grille_array[_local1][_local2 - 1].flag || (grille_array[_local1][_local2 - 1].frame == "bombeDiscover")) ? (cptF++) : null);
((grille_array[_local1 + 1][_local2 - 1].flag || (grille_array[_local1 + 1][_local2 - 1].frame == "bombeDiscover")) ? (cptF++) : null);
((grille_array[_local1 - 1][_local2].flag || (grille_array[_local1 - 1][_local2].frame == "bombeDiscover")) ? (cptF++) : null);
((grille_array[_local1 + 1][_local2].flag || (grille_array[_local1 + 1][_local2].frame == "bombeDiscover")) ? (cptF++) : null);
((grille_array[_local1 - 1][_local2 + 1].flag || (grille_array[_local1 - 1][_local2 + 1].frame == "bombeDiscover")) ? (cptF++) : null);
((grille_array[_local1][_local2 + 1].flag || (grille_array[_local1][_local2 + 1].frame == "bombeDiscover")) ? (cptF++) : null);
((grille_array[_local1 + 1][_local2 + 1].flag || (grille_array[_local1 + 1][_local2 + 1].frame == "bombeDiscover")) ? (cptF++) : null);
if (cptB == cptF) {
return(true);
}
return(false);
};
this.checkBomb = function (x, y) {
var _local3 = y;
if (((grille_array[x][_local3].frame != "bombe") && (grille_array[x][_local3].frame != "bombeDiscover")) && (grille_array[x][_local3].flag)) {
if (gameMC.gLives > 1) {
cpt_bomb++;
grille_array[x][_local3].turned = true;
grille_array[x][_local3].gotoAndStop("noBomb");
gameMC.gotoAndPlay("LevelFail");
} else {
var _local2 = 0;
while (_local2 < grilleHeight) {
var _local1 = 0;
while (_local1 < grilleWidth) {
if ((grille_array[_local2][_local1].frame == "bombe") && (grille_array[_local2][_local1].flag)) {
if (sweeper.gameStyle != "gameSkew") {
(grille_array[_local2][_local1].gotoAndStop("flag"));// not popped
} else {
(grille_array[_local2][_local1].gotoAndStop("flagSkew"));// not popped
}
} else if (grille_array[_local2][_local1].flag) {
grille_array[_local2][_local1].gotoAndStop("noBomb");
} else if (grille_array[_local2][_local1].frame == "bombe") {
if (sweeper.gameStyle != "gameSkew") {
(grille_array[_local2][_local1].gotoAndStop("bombe"));// not popped
} else {
(grille_array[_local2][_local1].gotoAndStop("bombeSkew"));// not popped
}
}
_local1++;
}
_local2++;
}
levelStart = false;
gameMC.gLives = 0;
gameMC.gotoAndPlay("GameOver");
}
delete sweeper.board.timer.onEnterFrame;
}
if ((grille_array[x][_local3].frame != "bombe") && (grille_array[x][_local3].flag)) {
grille_array[x][_local3].flag = false;
return(true);
}
return(false);
};
this.uncoverSquare = function (x, y) {
var _local2 = y;
var _local1 = x;
if ((!grille_array[_local1][_local2].flag) && (grille_array[_local1][_local2].frame != "bombeDiscover")) {
if (grille_array[_local1][_local2].frame == "nothing") {
checkEmpty(_local1, _local2);
}
grille_array[_local1][_local2].turned = true;
grille_array[_local1][_local2].gotoAndStop(grille_array[_local1][_local2].frame);
}
};
this.clickSquare = function (coordX, coordY) {
var _local3 = coordY;
if (!levelStart) {
levelStart = true;
reset(grilleWidth, grilleHeight, nbrBomb, coordX, _local3);
}
if (Key.isDown(17)) {
if (grille_array[coordX][_local3].flag) {
grille_array[coordX][_local3].flag = false;
grille_array[coordX][_local3].turned = false;
cpt_bomb++;
grille_array[coordX][_local3].gotoAndStop("idle");
} else if (!grille_array[coordX][_local3].turned) {
grille_array[coordX][_local3].flag = true;
grille_array[coordX][_local3].turned = true;
cpt_bomb--;
if (sweeper.gameStyle != "gameSkew") {
(grille_array[coordX][_local3].gotoAndStop("flag"));// not popped
} else {
(grille_array[coordX][_local3].gotoAndStop("flagSkew"));// not popped
}
}
} else if (Key.isDown(16)) {
if (testShiftClick(coordX, _local3)) {
var _local5 = false;
if (grille_array[coordX][_local3].turned) {
if (((((((checkBomb(coordX - 1, _local3 - 1) || (checkBomb(coordX, _local3 - 1))) || (checkBomb(coordX + 1, _local3 - 1))) || (checkBomb(coordX - 1, _local3))) || (checkBomb(coordX + 1, _local3))) || (checkBomb(coordX - 1, _local3 + 1))) || (checkBomb(coordX, _local3 + 1))) || (checkBomb(coordX + 1, _local3 + 1))) {
_local5 = true;
}
}
if ((!_local5) && (grille_array[coordX][_local3].turned)) {
uncoverSquare(coordX - 1, _local3 - 1);
uncoverSquare(coordX, _local3 - 1);
uncoverSquare(coordX + 1, _local3 - 1);
uncoverSquare(coordX - 1, _local3);
uncoverSquare(coordX + 1, _local3);
uncoverSquare(coordX - 1, _local3 + 1);
uncoverSquare(coordX, _local3 + 1);
uncoverSquare(coordX + 1, _local3 + 1);
}
}
} else if (!grille_array[coordX][_local3].turned) {
if (grille_array[coordX][_local3].frame == "bombe") {
if (sweeper.gameStyle != "gameSkew") {
(grille_array[coordX][_local3].gotoAndStop("bombe"));// not popped
} else {
(grille_array[coordX][_local3].gotoAndStop("bombeSkew"));// not popped
}
if (gameMC.gLives > 1) {
cpt_bomb--;
grille_array[coordX][_local3].turned = true;
grille_array[coordX][_local3].frame = "bombeDiscover";
if (sweeper.gameStyle != "gameSkew") {
(grille_array[coordX][_local3].gotoAndStop("bombeDiscover"));// not popped
} else {
(grille_array[coordX][_local3].gotoAndStop("bombeDiscoverSkew"));// not popped
}
gameMC.gotoAndPlay("LevelFail");
} else {
var _local2 = 0;
while (_local2 < grilleHeight) {
var _local1 = 0;
while (_local1 < grilleWidth) {
if ((grille_array[_local2][_local1].frame == "bombe") && (grille_array[_local2][_local1].flag)) {
if (sweeper.gameStyle != "gameSkew") {
} else {
}
grille_array[_local2][_local1].gotoAndStop("flag");
} else if (grille_array[_local2][_local1].flag) {
grille_array[_local2][_local1].gotoAndStop("noBomb");
} else if (grille_array[_local2][_local1].frame == "bombe") {
if (sweeper.gameStyle != "gameSkew") {
} else {
}
grille_array[_local2][_local1].gotoAndStop("bombeSkew");
}
_local1++;
}
_local2++;
}
levelStart = false;
gameMC.gLives = 0;
gameMC.gotoAndPlay("GameOver");
}
delete sweeper.board.timer.onEnterFrame;
} else {
if (grille_array[coordX][_local3].frame == "nothing") {
checkEmpty(coordX, _local3);
}
grille_array[coordX][_local3].turned = true;
grille_array[coordX][_local3].gotoAndStop(grille_array[coordX][_local3].frame);
}
}
checkEndOfLevel();
};
this.startTimer = function () {
cptFrame++;
if ((cptFrame % 30) == 0) {
timerLevel++;
cptFrame = 0;
var _local2 = 0;
var _local1 = timerLevel;
if (_local1 > 59) {
_local2 = _local1 / 60;
_local1 = _local1 % 60;
}
((_local2 < 10) ? ((timerTxt = ("( " + Math.floor(_local2)) + ":")) : ((timerTxt = ("( " + Math.floor(_local2)) + ":")));
((_local1 < 10) ? ((timerTxt = timerTxt + (("0" + Math.floor(_local1)) + " )"))) : ((timerTxt = timerTxt + (Math.floor(_local1) + " )"))));
}
};
this.compileScore = function () {
var _local2 = gameMC.gLevel * 500;
if (timerLevel <= timerSec) {
_local2 = _local2 + ((timerSec - timerLevel) * 25);
}
gameMC.gLevelScore = _local2;
gameMC.gScore = gameMC.gScore + _local2;
var _local3 = 0;
var _local1 = timerLevel;
if (_local1 > 59) {
_local3 = _local1 / 60;
_local1 = _local1 % 60;
}
((_local3 < 10) ? ((gameMC.gLevelTime = ("( " + Math.floor(_local3)) + ":")) : ((gameMC.gLevelTime = ("( " + Math.floor(_local3)) + ":")));
((_local1 < 10) ? ((gameMC.gLevelTime = gameMC.gLevelTime + (("0" + Math.floor(_local1)) + " )"))) : ((gameMC.gLevelTime = gameMC.gLevelTime + (Math.floor(_local1) + " )"))));
};
reset(grilleWidth, grilleHeight, nbrBomb);
Instance of Symbol 181 MovieClip "square" in Symbol 182 MovieClip Frame 1
onClipEvent (load) {
var turned = false;
var frame = 1;
var X = 0;
var Y = 0;
var flag = false;
_parent.loadSquare++;
}
Symbol 187 MovieClip Frame 1
stop();
Instance of Symbol 188 MovieClip "lifeCpt" in Symbol 222 MovieClip Frame 1
onClipEvent (load) {
this.onLifeChange = function () {
if (gameMC.glives == 3) {
life3.gotoAndStop("on");
life2.gotoAndStop("on");
life1.gotoAndStop("on");
} else if (gameMC.glives == 2) {
life3.gotoAndStop("off");
life2.gotoAndStop("on");
life1.gotoAndStop("on");
} else if (gameMC.glives == 1) {
life3.gotoAndStop("off");
life2.gotoAndStop("off");
life1.gotoAndStop("on");
} else if (gameMC.glives == 0) {
life3.gotoAndStop("off");
life2.gotoAndStop("off");
life1.gotoAndStop("off");
}
};
}
Symbol 234 Button
on (release) {
gotoAndStop ("gameClassic");
}
Symbol 244 Button
on (release) {
gameMC.gScore = 0;
gameMC.gLevel = 1;
gameMC.gLives = 3;
game.levelStart = false;
gameMC.gotoAndPlay("NextLevel");
}
Symbol 250 Button
on (release) {
gameMC.screen_instructions.gotoAndStop("instructions");
gameMC.screen_instructions._visible = true;
}
Symbol 262 Button
on (release) {
gotoAndStop ("gameSkew");
}
Symbol 269 MovieClip Frame 1
stop();
_global.sweeper = this;
Stage.showMenu = false;
masque_btn.useHandCursor = false;
masque_btn._visible = false;
gameStyle = "gameSkew";
var i = 0;
while (i < main.grilleHeight) {
var j = 0;
while (j < main.grilleWidth) {
if (main.grille_array[i][j].flag) {
main.grille_array[i][j].gotoAndStop("flagSkew");
}
if (main.grille_array[i][j].frame == "bombeDiscover") {
main.grille_array[i][j].gotoAndStop("bombeDiscoverSkew");
}
j++;
}
i++;
}
if (gameMC.gLevel == 1) {
gotoAndStop ("level1Skew");
} else if (gameMC.gLevel == 2) {
gotoAndStop ("level2Skew");
} else if (gameMC.gLevel >= 3) {
gotoAndStop ("level3Skew");
}
Symbol 269 MovieClip Frame 2
stop();
_global.sweeper = this;
Stage.showMenu = false;
masque_btn.useHandCursor = false;
masque_btn._visible = false;
gameStyle = "gameSkew";
var i = 0;
while (i < main.grilleHeight) {
var j = 0;
while (j < main.grilleWidth) {
if (main.grille_array[i][j].flag) {
main.grille_array[i][j].gotoAndStop("flagSkew");
}
if (main.grille_array[i][j].frame == "bombeDiscover") {
main.grille_array[i][j].gotoAndStop("bombeDiscoverSkew");
}
j++;
}
i++;
}
if (gameMC.gLevel == 1) {
gotoAndStop ("level1Skew");
} else if (gameMC.gLevel == 2) {
gotoAndStop ("level2Skew");
} else if (gameMC.gLevel >= 3) {
gotoAndStop ("level3Skew");
}
Symbol 269 MovieClip Frame 3
stop();
_global.sweeper = this;
Stage.showMenu = false;
masque_btn.useHandCursor = false;
masque_btn._visible = false;
gameStyle = "gameSkew";
var i = 0;
while (i < main.grilleHeight) {
var j = 0;
while (j < main.grilleWidth) {
if (main.grille_array[i][j].flag) {
main.grille_array[i][j].gotoAndStop("flagSkew");
}
if (main.grille_array[i][j].frame == "bombeDiscover") {
main.grille_array[i][j].gotoAndStop("bombeDiscoverSkew");
}
j++;
}
i++;
}
if (gameMC.gLevel == 1) {
gotoAndStop ("level1Skew");
} else if (gameMC.gLevel == 2) {
gotoAndStop ("level2Skew");
} else if (gameMC.gLevel >= 3) {
gotoAndStop ("level3Skew");
}
Symbol 269 MovieClip Frame 4
gameStyle = "gameClassic";
var i = 0;
while (i < main.grilleHeight) {
var j = 0;
while (j < main.grilleWidth) {
if (main.grille_array[i][j].flag) {
main.grille_array[i][j].gotoAndStop("flag");
}
if (main.grille_array[i][j].frame == "bombeDiscover") {
main.grille_array[i][j].gotoAndStop("bombeDiscover");
}
j++;
}
i++;
}
if (gameMC.gLevel == 1) {
gotoAndStop ("level1");
} else if (gameMC.gLevel == 2) {
gotoAndStop ("level2");
} else if (gameMC.gLevel >= 3) {
gotoAndStop ("level3");
}
Symbol 269 MovieClip Frame 5
gameStyle = "gameClassic";
var i = 0;
while (i < main.grilleHeight) {
var j = 0;
while (j < main.grilleWidth) {
if (main.grille_array[i][j].flag) {
main.grille_array[i][j].gotoAndStop("flag");
}
if (main.grille_array[i][j].frame == "bombeDiscover") {
main.grille_array[i][j].gotoAndStop("bombeDiscover");
}
j++;
}
i++;
}
if (gameMC.gLevel == 1) {
gotoAndStop ("level1");
} else if (gameMC.gLevel == 2) {
gotoAndStop ("level2");
} else if (gameMC.gLevel >= 3) {
gotoAndStop ("level3");
}
Symbol 269 MovieClip Frame 6
gameStyle = "gameClassic";
var i = 0;
while (i < main.grilleHeight) {
var j = 0;
while (j < main.grilleWidth) {
if (main.grille_array[i][j].flag) {
main.grille_array[i][j].gotoAndStop("flag");
}
if (main.grille_array[i][j].frame == "bombeDiscover") {
main.grille_array[i][j].gotoAndStop("bombeDiscover");
}
j++;
}
i++;
}
if (gameMC.gLevel == 1) {
gotoAndStop ("level1");
} else if (gameMC.gLevel == 2) {
gotoAndStop ("level2");
} else if (gameMC.gLevel >= 3) {
gotoAndStop ("level3");
}
Symbol 273 MovieClip Frame 1
_visible = false;
this.loadMovie(gameMC.gHSRoot_swf + "HSMinScore.swf");
Symbol 273 MovieClip Frame 4
stop();
Symbol 276 Button
on (release) {
gameMC.gotoAndPlay("GameOver");
}
Symbol 284 MovieClip Frame 4
stop();
Symbol 284 MovieClip Frame 9
stop();
Symbol 304 Button
on (press) {
nextFrame();
}
Symbol 325 Button
on (press) {
prevFrame();
}
Symbol 344 MovieClip Frame 1
stop();
next_btn.onRelease = function () {
gotoAndStop ("instructions2");
};
Symbol 344 MovieClip Frame 3
playBtn.onRelease = gameMC.btn_handler_play;
previous_btn.onRelease = function () {
gotoAndStop ("instructions");
};
Symbol 350 MovieClip Frame 1
stop();
masqueInvisible.useHandCursor = false;
next_btn.onRelease = function () {
gotoAndStop ("instructions2");
};
Symbol 350 MovieClip Frame 2
playBtn.onRelease = function () {
_visible = false;
};
previous_btn.onRelease = function () {
gotoAndStop ("instructions");
};
Symbol 350 MovieClip Frame 3
playBtn.onRelease = function () {
_visible = false;
};
previous_btn.onRelease = function () {
gotoAndStop ("instructions");
};
Symbol 366 Button
on (release) {
sweeper.board.timer.onEnterFrame = main.startTimer;
gameMC.gotoAndPlay("NextLevel");
}
Symbol 367 MovieClip Frame 29
stop();
Symbol 435 Button
on (release) {
gameMC.gLevel = gameMC.gLevel + 1;
gameMC.dynamicVideo._x = 20;
gameMC.dynamicVideo._y = 500;
gameMC.dynamicVideo.gotoAndStop(1);
gameMC.gotoAndPlay("NextLevel");
}
Symbol 439 Button
on (release) {
gameMC.dynamicVideo._x = 20;
gameMC.dynamicVideo._y = 500;
gameMC.dynamicVideo.gotoAndStop(1);
gameMC.gScore = 0;
gameMC.gLevel = 1;
gameMC.gLives = 3;
gameMC.ks.game.levelStart = false;
gameMC.gotoAndPlay("NextLevel");
}
Symbol 440 MovieClip Frame 1
gainLifeMessage._visible = false;
if ((gameMC.gLevelCompleted >= 2) && (gameMC.gLives < 3)) {
gameMC.gLives++;
gainLifeMessage._visible = true;
}
Symbol 440 MovieClip Frame 19
stop();
Symbol 442 MovieClip Frame 1
_visible = true;
Symbol 442 MovieClip Frame 5
stop();
Symbol 475 Button
on (release) {
gameMC.gScore = 0;
gameMC.gLevel = 1;
gameMC.gLives = 3;
gameMC.ks.game.levelStart = false;
gameMC.gotoAndPlay("NextLevel");
}
Symbol 476 MovieClip Frame 63
stop();