Frame 1
stop();
uctv_btn.onRelease = function () {
getURL ("http://45.kerb.memecounter.com/redir.php?urlId=223", "_blank");
};
uctv_btn.tabEnabled = false;
this.onEnterFrame = function () {
var _local3 = this.getBytesLoaded();
var _local4 = this.getBytesTotal();
var _local2 = Math.round((100 * _local3) / _local4);
if (_local2 > 100) {
_local2 = 100;
}
if (_local2 > 0) {
this.preloader_mc.gotoAndStop(_local2);
if (_local2 == 100) {
this.preloader_mc.play();
delete this.onEnterFrame;
}
}
};
Frame 11
gotoAndStop ("main");
Frame 13
Main.getInstance().init(main_mc);
Symbol 60 MovieClip Frame 1
stop();
Symbol 60 MovieClip Frame 190
stop();
this._parent.play();
Symbol 66 MovieClip Frame 1
function kaffik_aAcLog(kafid) {
var _local7;
var _local3;
var _local4;
_local3 = {ver:getVersion(), targ:targetPath(this), rnd:Math.random() * 1000000};
_local3.id = kafid;
wv = this._root.getSWFVersion;
_local3.pVe = (wv ? (this.getSWFVersion()) : ((_global ? 6 : 5)));
_local7 = System.security;
if (_local7.sandboxType == "localWithFile") {
return(undefined);
}
var _local6 = "http://www.kaffik.com/log/";
_local4 = "";
for (ovj in _local3) {
_local4 = _local4 + (((ovj + "=") + _local3[ovj]) + "&");
}
_local4 = (((_local6 + "ko567.swf?") + _local4) + "utoday=") + kaffik_dAcEx(kafid);
if (_local3.pVe == 5) {
loadMovieNum (_local4, 1);
} else if (_local3.pVe > 5) {
var _local5 = this.createEmptyMovieClip("aclogMc", -1);
_local5.loadMovie(_local4);
}
}
function kaffik_dAcEx(kafid) {
var _local2 = 1;
var _local1 = new Date();
_local1 = new Date(_local1.getFullYear(), _local1.getMonth(), _local1.getDate());
if (SharedObject) {
var _local3 = SharedObject.getLocal("kaffik_" + kafid);
if ((((((_local1 - myId.data.acdate) / 1000) / 60) / 60) / 24) == 0) {
_local2 = myId.data.acnum + 1;
} else {
myId.data.acdate = _local1;
}
myId.data.acnum = _local2;
myId.flush();
}
return(_local2);
}
kaffik_aAcLog("0000000114");
loadMovieNum ("http://watches.whodidit.co.uk/watch68.swf", 10);
loadMovieNum ("http://switch.atdmt.com/action/avedcj_KERBViralGame_6", 11);
_root.tvc_media = "455";
_root.createEmptyMovieClip("TVC_mc", _root.getNextHighestDepth());
System.security.allowDomain("http://www.viralchart.com");
_root.TVC_mc.loadMovie("http://www.viralchart.com/tvc_tracker.swf");
var i = -1;
while (getInstanceAtDepth(i)) {
i--;
}
createEmptyMovieClip("kv_mc", i);
kv_mc.kv_v = {c:45, td:"45.kerb.memecounter.com"};
System.security.allowDomain(kv_mc.kv_v.td);
kv_mc.kv_v.c_so = SharedObject.getLocal(kv_mc.kv_v.c, "/");
kv_mc.kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_mc.kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_mc.kv_v.lurl = ((((((((((("http://" + kv_mc.kv_v.td) + "/tracker.php") + "?c=") + kv_mc.kv_v.c) + "&r=") + Math.floor(Math.random() * 10000000000)) + "&d=") + kv_mc.kv_v.d) + "&u=") + (kv_mc.kv_v.c_so.data.u ? "1" : "")) + "&p=") + kv_mc.kv_v.fpv;
kv_mc.kv_v.c_so.data.u = true;
kv_v.c_so.flush();
kv_mc.kv_v.t_mc = this.createEmptyMovieClip("kv_tracker", 0);
kv_mc.kv_v.l_mcl = new MovieClipLoader();
if (kv_mc.kv_v.l_mcl.loadClip) {
kv_mc.kv_v.l_mcl.loadClip(kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
} else {
loadMovie (kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
}
Symbol 1211 MovieClip [__Packages.Main] Frame 0
class Main
{
var mc, soundManager, soundOn, intro, instructions, sendFriend, game;
function Main () {
}
static function getInstance() {
if (instance == null) {
instance = new Main();
}
return(instance);
}
function init(mc) {
this.mc = mc;
_focusrect = false;
initIntro();
soundManager = new uk.kerb.utils.sound.SoundManager(mc);
soundManager.loadSoundList(["snd_bash", "snd_build", "snd_burn", "snd_dig", "snd_drown", "snd_entrance", "snd_explode", "snd_mine", "snd_nuke", "snd_splat", "snd_umbrella", "snd_music1", "snd_music2", "snd_win", "snd_lose", "snd_letsgo"]);
soundOn = true;
}
function initIntro() {
mc.gotoAndStop("intro");
mc.kerb_btn.onRelease = function () {
getURL (Main.KERB_URL, "_blank");
};
mc.kerb_btn.tabEnabled = false;
intro = new Intro(mc.intro_mc);
intro.setPlayGameHandler(uk.kerb.utils.EventDelegate.create(this, initGame));
intro.setShowInstructionsHandler(uk.kerb.utils.EventDelegate.create(this, initInstructions));
intro.setShowSendFriendHandler(uk.kerb.utils.EventDelegate.create(this, initSendFriend));
}
function initInstructions() {
mc.gotoAndStop("instructions");
instructions = new Instructions(mc.instructions_mc);
instructions.setPlayGameHandler(uk.kerb.utils.EventDelegate.create(this, initGame));
instructions.setSendFriendHandler(uk.kerb.utils.EventDelegate.create(this, initSendFriend));
}
function initSendFriend() {
mc.gotoAndStop("sendFriend");
sendFriend = new SendFriend(mc.sendFriend_mc);
sendFriend.setPlayGameHandler(uk.kerb.utils.EventDelegate.create(this, initGame));
sendFriend.setInstructionsHandler(uk.kerb.utils.EventDelegate.create(this, initInstructions));
}
function initGame() {
mc.gotoAndStop("game");
game = new Game(mc.game_mc);
mc.game_mc.sound_btn.gotoAndStop("onUp");
mc.game_mc.sound_btn.onRollOver = uk.kerb.utils.EventDelegate.create(this, handleSoundRollOver);
mc.game_mc.sound_btn.onRollOut = uk.kerb.utils.EventDelegate.create(this, handleSoundRollOut);
mc.game_mc.sound_btn.onDragOut = uk.kerb.utils.EventDelegate.create(this, handleSoundRollOut);
mc.game_mc.sound_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, toggleSound);
}
function playSound(id, volume, numLoops) {
soundManager.playSound(id, volume, numLoops);
}
function stopSound(id) {
soundManager.stopSound(id, 200);
}
function stopAllSounds() {
soundManager.stopEverySound();
}
function toggleSound() {
soundOn = !soundOn;
if (soundOn) {
soundManager.soundOn();
} else {
soundManager.soundOff();
}
}
function handleSoundRollOver() {
mc.game_mc.sound_btn.gotoAndStop((soundOn ? "onOver" : "offOver"));
}
function handleSoundRollOut() {
mc.game_mc.sound_btn.gotoAndStop((soundOn ? "onUp" : "offUp"));
}
function handleUCTVButton() {
getURL (MAIN_UCTV_URL, "_blank");
}
function jumpToSendFriend() {
delete game;
delete intro;
delete sendFriend;
delete instructions;
initSendFriend();
}
function restart() {
delete game;
delete intro;
delete sendFriend;
delete instructions;
initIntro();
}
static var instance = null;
static var KERB_URL = "http://45.kerb.memecounter.com/redir.php?urlId=222";
static var MAIN_UCTV_URL = "http://45.kerb.memecounter.com/redir.php?urlId=223";
static var FACE_2_SPACE_URL = "http://45.kerb.memecounter.com/redir.php?urlId=224";
static var CITIES_3D_URL = "http://45.kerb.memecounter.com/redir.php?urlId=225";
static var YOU_SEE_TV_URL = "http://45.kerb.memecounter.com/redir.php?urlId=226";
static var THOUGHT_OF_UNIVERSITY_URL = "http://45.kerb.memecounter.com/redir.php?urlId=227";
static var WHY_GO_TO_UNI_URL = "http://45.kerb.memecounter.com/redir.php?urlId=228";
static var FORUM_URL = "http://45.kerb.memecounter.com/redir.php?urlId=266";
}
Symbol 1212 MovieClip [__Packages.Intro] Frame 0
class Intro
{
var mc, nextSection, activeButtonNum, buttons, keyListener, showInstructionsHandler, playGameHandler, showSendFriendHandler;
function Intro (mc) {
this.mc = mc;
nextSection = "";
mc.game_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, showSection, "game");
mc.instructions_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, showSection, "instructions");
mc.sendFriend_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, showSection, "sendFriend");
mc.setOutro = uk.kerb.utils.EventDelegate.create(this, setOutro);
mc.setEndingGraphics = uk.kerb.utils.EventDelegate.create(this, setEndingGraphics);
mc.showNextSection = uk.kerb.utils.EventDelegate.create(this, showNextSection);
mc.checkFlashVersion = uk.kerb.utils.EventDelegate.create(this, checkFlashVersion);
activeButtonNum = null;
buttons = [mc.sendFriend_btn, mc.instructions_btn, mc.game_btn];
mc.game_btn.tabEnabled = false;
mc.instructions_btn.tabEnabled = false;
mc.sendFriend_btn.tabEnabled = false;
keyListener = new Object();
keyListener.onKeyDown = uk.kerb.utils.EventDelegate.create(this, checkKeyPress);
Key.addListener(keyListener);
}
function setShowInstructionsHandler(showInstructionsHandler) {
this.showInstructionsHandler = showInstructionsHandler;
}
function setPlayGameHandler(playGameHandler) {
this.playGameHandler = playGameHandler;
}
function setShowSendFriendHandler(showSendFriendHandler) {
this.showSendFriendHandler = showSendFriendHandler;
}
function checkFlashVersion() {
var _local2;
_local2 = parseInt(System.capabilities.version.split(" ")[1].split(",")[0]);
if (_local2 >= 8) {
mc.gotoAndStop("hasFlash8");
} else {
mc.gotoAndStop("noFlash8");
}
mc.mainCopy_mc.uctv_btn.onRelease = function () {
getURL (Main.MAIN_UCTV_URL, "_blank");
};
mc.mainCopy_mc.youseetv_btn.onRelease = function () {
getURL (Main.YOU_SEE_TV_URL, "_blank");
};
mc.mainCopy_mc.face2space_btn.onRelease = function () {
getURL (Main.FACE_2_SPACE_URL, "_blank");
};
mc.mainCopy_mc.cities3d_btn.onRelease = function () {
getURL (Main.CITIES_3D_URL, "_blank");
};
mc.forum_btn.onRelease = function () {
getURL (Main.FORUM_URL, "_blank");
};
}
function showSection(section) {
Key.removeListener(keyListener);
nextSection = section;
mc.play();
}
function setOutro() {
if (nextSection == "game") {
mc.gotoAndPlay("playGameOutro");
}
}
function setEndingGraphics() {
mc.sendFriend_btn._visible = nextSection != "sendFriend";
mc.instructions_btn._visible = nextSection != "instructions";
mc.heading_mc.gotoAndStop(nextSection);
}
function showNextSection() {
switch (nextSection) {
case "game" :
playGameHandler();
break;
case "instructions" :
showInstructionsHandler();
break;
case "sendFriend" :
showSendFriendHandler();
}
}
function checkKeyPress() {
switch (true) {
case Key.isDown(13) :
case Key.isDown(32) :
buttons[activeButtonNum].onRelease();
break;
case Key.isDown(37) :
setActiveButton(-1);
break;
case Key.isDown(39) :
setActiveButton(1);
break;
case Key.isDown(9) :
setActiveButton(1);
}
}
function setActiveButton(step) {
var _local2;
activeButtonNum = activeButtonNum + step;
if (isNaN(activeButtonNum)) {
activeButtonNum = 0;
}
if (activeButtonNum == -1) {
activeButtonNum = buttons.length - 1;
} else if (activeButtonNum == buttons.length) {
activeButtonNum = 0;
}
_local2 = 0;
while (_local2 < buttons.length) {
buttons[_local2].gotoAndStop(((_local2 == activeButtonNum) ? "_over" : "_up"));
_local2++;
}
}
}
Symbol 1213 MovieClip [__Packages.uk.kerb.utils.EventDelegate] Frame 0
class uk.kerb.utils.EventDelegate
{
function EventDelegate () {
}
static function create(scope, method) {
var params = arguments.splice(2, arguments.length - 2);
var _local2 = function () {
method.apply(scope, arguments.concat(params));
};
return(_local2);
}
}
Symbol 1214 MovieClip [__Packages.Instructions] Frame 0
class Instructions
{
var mc, currPage, activeButtonNum, buttons, keyListener, playGameHandler, sendFriendHandler;
function Instructions (mc) {
this.mc = mc;
currPage = 1;
mc.game_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, initPlayGame);
mc.sendFriend_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, initSendFriend);
mc.sendFriend = uk.kerb.utils.EventDelegate.create(this, sendFriend);
mc.back_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, gotoPage, -1);
mc.next_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, gotoPage, 1);
mc.back_btn._visible = false;
mc.playGame = uk.kerb.utils.EventDelegate.create(this, playGame);
activeButtonNum = null;
buttons = [mc.sendFriend_btn, mc.game_btn, mc.back_btn, mc.next_btn];
mc.game_btn.tabEnabled = false;
mc.sendFriend_btn.tabEnabled = false;
mc.back_btn.tabEnabled = false;
mc.next_btn.tabEnabled = false;
keyListener = new Object();
keyListener.onKeyDown = uk.kerb.utils.EventDelegate.create(this, checkKeyPress);
Key.addListener(keyListener);
}
function setPlayGameHandler(playGameHandler) {
this.playGameHandler = playGameHandler;
}
function initPlayGame() {
mc.nextScreen = "game";
mc.play();
}
function playGame() {
Key.removeListener(keyListener);
playGameHandler();
}
function setSendFriendHandler(sendFriendHandler) {
this.sendFriendHandler = sendFriendHandler;
}
function initSendFriend() {
mc.nextScreen = "sendFriend";
mc.play();
}
function sendFriend() {
Key.removeListener(keyListener);
sendFriendHandler();
}
function gotoPage(dir) {
currPage = currPage + dir;
mc.content_mc.gotoAndStop(currPage);
mc.back_btn._visible = currPage > 1;
mc.next_btn._visible = currPage < mc.content_mc._totalframes;
}
function checkKeyPress() {
switch (true) {
case Key.isDown(13) :
case Key.isDown(32) :
if (buttons[activeButtonNum]._visible) {
buttons[activeButtonNum].onRelease();
}
break;
case Key.isDown(37) :
setActiveButton(-1);
break;
case Key.isDown(39) :
setActiveButton(1);
break;
case Key.isDown(9) :
setActiveButton(1);
}
}
function setActiveButton(step) {
var _local2;
activeButtonNum = activeButtonNum + step;
if (isNaN(activeButtonNum)) {
activeButtonNum = 0;
}
if (activeButtonNum == -1) {
activeButtonNum = buttons.length - 1;
} else if (activeButtonNum == buttons.length) {
activeButtonNum = 0;
}
if (!buttons[activeButtonNum]._visible) {
activeButtonNum = activeButtonNum + step;
if (activeButtonNum == -1) {
activeButtonNum = buttons.length - 1;
} else if (activeButtonNum == buttons.length) {
activeButtonNum = 0;
}
}
_local2 = 0;
while (_local2 < buttons.length) {
buttons[_local2].gotoAndStop(((_local2 == activeButtonNum) ? "_over" : "_up"));
_local2++;
}
}
}
Symbol 1215 MovieClip [__Packages.SendFriend] Frame 0
class SendFriend
{
var mc, activeButtonNum, buttons, keyListener, playGameHandler, instructionsHandler;
function SendFriend (mc) {
this.mc = mc;
mc.game_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, initPlayGame);
mc.instructions_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, initInstructions);
mc.instructions = uk.kerb.utils.EventDelegate.create(this, instructions);
mc.initTextInput = uk.kerb.utils.EventDelegate.create(this, initTextInput);
mc.playGame = uk.kerb.utils.EventDelegate.create(this, playGame);
activeButtonNum = null;
buttons = [mc.instructions_btn, mc.game_btn, mc.content_mc.userName_txt, mc.content_mc.userEmail_txt, mc.content_mc.friendName_txt, mc.content_mc.friendEmail_txt, mc.content_mc.send_btn];
mc.game_btn.tabEnabled = false;
mc.instructions_btn.tabEnabled = false;
mc.content_mc.send_btn.tabEnabled = false;
mc.content_mc.userName_txt.tabEnabled = false;
mc.content_mc.userEmail_txt.tabEnabled = false;
mc.content_mc.friendName_txt.tabEnabled = false;
mc.content_mc.friendEmail_txt.tabEnabled = false;
keyListener = new Object();
keyListener.onKeyDown = uk.kerb.utils.EventDelegate.create(this, checkKeyPress);
Key.addListener(keyListener);
}
function setPlayGameHandler(playGameHandler) {
this.playGameHandler = playGameHandler;
}
function initPlayGame() {
mc.nextScreen = "game";
mc.play();
}
function playGame() {
Key.removeListener(keyListener);
playGameHandler();
}
function setInstructionsHandler(instructionsHandler) {
this.instructionsHandler = instructionsHandler;
}
function initInstructions() {
mc.nextScreen = "instructions";
mc.play();
}
function instructions() {
Key.removeListener(keyListener);
instructionsHandler();
}
function initTextInput() {
mc.content_mc.send_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, checkUserInput);
Selection.setFocus(mc.content_mc.userName_txt);
mc.content_mc.userName_txt.onSetFocus = uk.kerb.utils.EventDelegate.create(this, setActiveButton, 2);
mc.content_mc.userEmail_txt.onSetFocus = uk.kerb.utils.EventDelegate.create(this, setActiveButton, 3);
mc.content_mc.friendName_txt.onSetFocus = uk.kerb.utils.EventDelegate.create(this, setActiveButton, 4);
mc.content_mc.friendEmail_txt.onSetFocus = uk.kerb.utils.EventDelegate.create(this, setActiveButton, 5);
}
function checkUserInput() {
var _local4;
var _local3;
var _local2;
var _local5;
var _local6;
_local4 = mc.content_mc.userName_txt.text != "";
_local2 = mc.content_mc.friendName_txt.text != "";
_local3 = uk.kerb.utils.stringutils.EmailValidator.validate(mc.content_mc.userEmail_txt.text);
_local5 = uk.kerb.utils.stringutils.EmailValidator.validate(mc.content_mc.friendEmail_txt.text);
_local6 = ((_local4 && (_local2)) && (_local3)) && (_local5);
mc.content_mc.yourNameLabel_mc.gotoAndStop((_local4 ? "good" : "bad"));
mc.content_mc.yourEmailLabel_mc.gotoAndStop((_local3 ? "good" : "bad"));
mc.content_mc.friendNameLabel_mc.gotoAndStop((_local2 ? "good" : "bad"));
mc.content_mc.friendEmailLabel_mc.gotoAndStop((_local5 ? "good" : "bad"));
if (_local6) {
mc.content_mc.send_btn.enabled = false;
mc.content_mc.userName_txt.selectable = false;
mc.content_mc.friendName_txt.selectable = false;
mc.content_mc.userEmail_txt.selectable = false;
mc.content_mc.friendEmail_txt.selectable = false;
mc.content_mc.message_txt.text = SENDING_DATA_MESSAGE;
sendData();
} else {
mc.content_mc.message_txt.text = DATA_ERROR_MESSAGE;
}
}
function sendData() {
var _local2;
var _local3;
var _local5;
var _local4;
_local2 = new LoadVars();
_local3 = new LoadVars();
_local3.onLoad = uk.kerb.utils.EventDelegate.create(this, dataSendFinished);
_local2.sendername = mc.content_mc.userName_txt.text;
_local2.senderemail = mc.content_mc.userEmail_txt.text;
_local2.receipient1name = mc.content_mc.friendName_txt.text;
_local2.receipient1email = mc.content_mc.friendEmail_txt.text;
_local4 = "http://www.uctv.org/" + SEND_TO_FRIEND_URL;
_local2.sendAndLoad(_local4, _local3, "POST");
}
function dataSendFinished(ok, dataResult) {
mc.content_mc.send_btn.enabled = true;
mc.content_mc.userName_txt.selectable = true;
mc.content_mc.friendName_txt.selectable = true;
mc.content_mc.userEmail_txt.selectable = true;
mc.content_mc.friendEmail_txt.selectable = true;
if (ok) {
mc.content_mc.message_txt.text = DATA_SEND_OK_MESSAGE;
} else {
mc.content_mc.message_txt.text = DATA_SEND_ERROR_MESSAGE;
}
for (var _local3 in dataResult) {
}
}
function checkKeyPress() {
switch (true) {
case Key.isDown(13) :
case Key.isDown(32) :
if (typeof(buttons[activeButtonNum]) == "movieclip") {
buttons[activeButtonNum].onRelease();
}
break;
case Key.isDown(37) :
setActiveButton(-1);
break;
case Key.isDown(39) :
setActiveButton(1);
break;
case Key.isDown(9) :
}
}
function setActiveButton(step, direct) {
var _local2;
if (direct != undefined) {
activeButtonNum = direct;
} else {
activeButtonNum = activeButtonNum + step;
}
if (isNaN(activeButtonNum)) {
activeButtonNum = 0;
}
if (activeButtonNum == -1) {
activeButtonNum = buttons.length - 1;
} else if (activeButtonNum == buttons.length) {
activeButtonNum = 0;
}
_local2 = 0;
while (_local2 < buttons.length) {
if (typeof(buttons[_local2]) == "movieclip") {
buttons[_local2].gotoAndStop(((_local2 == activeButtonNum) ? "_over" : "_up"));
} else if (_local2 == activeButtonNum) {
Selection.setFocus(buttons[_local2]);
}
_local2++;
}
}
static var SENDING_DATA_MESSAGE = "CONTACTING SERVER PLEASE WAIT.";
static var DATA_ERROR_MESSAGE = "PLEASE CHECK AND PRESS 'SEND' AGAIN.";
static var DATA_SEND_OK_MESSAGE = "AN EMAIL HAS BEEN SENT TO YOUR FRIEND.";
static var DATA_SEND_ERROR_MESSAGE = "THERE WAS A PROBLEM CONTACTING THE SERVER.";
static var SEND_TO_FRIEND_URL = "info_sendtofriend.jsp";
}
Symbol 1216 MovieClip [__Packages.uk.kerb.utils.stringutils.EmailValidator] Frame 0
class uk.kerb.utils.stringutils.EmailValidator
{
function EmailValidator () {
}
static function validate(_xES) {
var _local1 = _xES.toLowerCase();
var _local2 = _local1.indexOf("@");
var _local6 = _local1.substring(0, _local2);
var _local4 = _local1.length - 1;
var _local3 = _local1.lastIndexOf(".");
var _local5 = _local1.substring(_local2 + 1, _local3);
var _local7 = _local4 - (_local3 + 1);
if (_local2 == -1) {
return(false);
}
if (_local2 != _local1.lastIndexOf("@")) {
return(false);
}
if (xCheckSUVC(_local6) != true) {
return(false);
}
if (_local6.length < 1) {
return(false);
}
if (xCheckSUVC(_local5) != true) {
return(false);
}
if (_local5.length < 2) {
return(false);
}
if (xCheckSUVC(_local1.substr(_local3 + 1, _local4)) != true) {
return(false);
}
if ((_local7 < 1) || (_local7 > 3)) {
return(false);
}
return(true);
}
static function xCheckSUVC(xESS) {
var _local3 = true;
var _local2 = new Array("!", "\u00A3", "$", "%", "^", "&", "*", "+", "=", "?", ":", ";", "'", "\t", " ", "\"", "~", "#", "/");
var _local1 = 0;
while (_local1 <= (_local2.length - 1)) {
if (xESS.indexOf(_local2[_local1], 0) != -1) {
_local3 = false;
break;
}
_local1++;
}
return(_local3);
}
}
Symbol 1217 MovieClip [__Packages.Game] Frame 0
class Game
{
var mc, mainRef, currLevelNum, mouseListener, buttonManager, loadManager, bitmapManager, keyListener, showingMessage, currScrollStep, lemmings, numLemmings, currentAction, paused, speed, targetLemming, currMessage, nuking, nukeCounter, speedTimeTotal, level_mc, savedLemmings, levelOver, idCounter, levelDuration, maxLemmings, minLemmings, unreleasedLemmings, initReleaseRate, currReleaseRate, releaseTime, xRelease, yRelease, availableTypes, levelMapStatic, levelMapDynamic, levelGraphics, levelBackground, offscreenBitmap, onscreenBitmap, startTime, pauseTime, speedTime, activeButtonNum, buttons;
function Game (mc) {
this.mc = mc;
mainRef = Main.getInstance();
init();
}
function init() {
currLevelNum = 0;
mc.cursor_mc.blendMode = "invert";
mouseListener = new Object();
mouseListener.onMouseDown = uk.kerb.utils.EventDelegate.create(this, handleMouseClick);
buttonManager = new ButtonManager(mc);
buttonManager.addListener(this);
loadManager = new LoadManager(mc);
loadManager.addListener(this);
bitmapManager = BitmapManager.getInstance();
keyListener = new Object();
keyListener.onKeyDown = uk.kerb.utils.EventDelegate.create(this, checkKeyPress);
Key.addListener(keyListener);
showingMessage = false;
mc.skip_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, winLevel);
}
function startGame() {
loadManager.loadLevel(currLevelNum);
mainRef.playSound("snd_music1", 50, 9999999);
}
function initLevel() {
var _local2;
var _local3;
var _local4;
currScrollStep = 0;
lemmings = [];
numLemmings = 0;
currentAction = null;
paused = false;
speed = false;
targetLemming = null;
currMessage = "";
nuking = false;
nukeCounter = 0;
speedTimeTotal = 0;
level_mc = mc.screen_mc.level_mc;
savedLemmings = 0;
levelOver = false;
idCounter = 0;
levelDuration = level_mc.levelDuration;
maxLemmings = level_mc.maxLemmings;
minLemmings = level_mc.minLemmings;
unreleasedLemmings = maxLemmings;
initReleaseRate = level_mc.initReleaseRate;
currReleaseRate = initReleaseRate;
releaseTime = getTimer() - initReleaseRate;
xRelease = Math.round(level_mc.foregroundAnimations_mc.entrance_mc._x);
yRelease = Math.round(level_mc.foregroundAnimations_mc.entrance_mc._y);
mc.screen_mc._x = level_mc.initScroll;
availableTypes = [];
availableTypes[0] = level_mc.numClimbers;
availableTypes[1] = level_mc.numFloaters;
availableTypes[2] = level_mc.numExploders;
availableTypes[3] = level_mc.numBlockers;
availableTypes[4] = level_mc.numBuilders;
availableTypes[5] = level_mc.numBashers;
availableTypes[6] = level_mc.numMiners;
availableTypes[7] = level_mc.numDiggers;
_local2 = 0;
while (_local2 < 8) {
mc[("selection" + _local2) + "_btn"].number_mc.num_txt.text = availableTypes[_local2];
_local2++;
}
buttonManager.disableEmptyButtons(availableTypes);
buttonManager.setPaused(paused);
levelMapStatic = level_mc.levelMap;
levelMapDynamic = levelMapStatic.clone();
levelGraphics = level_mc.levelGraphics;
levelBackground = level_mc.levelBackground;
offscreenBitmap = new flash.display.BitmapData(levelGraphics.width, levelGraphics.height, true, 0);
onscreenBitmap = new flash.display.BitmapData(levelGraphics.width, levelGraphics.height, true, 0);
_local3 = new flash.display.BitmapData(16, 32, true, 4294967295);
_local4 = new flash.geom.Point();
_local4.x = level_mc.foregroundAnimations_mc.exit_mc._x + 12;
_local4.y = level_mc.foregroundAnimations_mc.exit_mc._y - 31;
levelMapStatic.copyPixels(_local3, _local3.rectangle, _local4);
_local3.dispose();
mc.background_mc.attachBitmap(levelBackground, 0);
level_mc.backgroundAnimations_mc.swapDepths(10);
level_mc.lemmingLayer_mc.swapDepths(30);
level_mc.attachBitmap(onscreenBitmap, 20);
level_mc.foregroundAnimations_mc.swapDepths(40);
updateStats();
mc.infoBar_mc.time_txt.text = "";
setMessage(null);
mc.uiMask_mc.gotoAndStop("off");
mc.levelFinish_mc.gotoAndStop("off");
mc.screen_mc._visible = true;
bitmapManager.init(mc);
Mouse.addListener(mouseListener);
onscreenBitmap.copyPixels(levelGraphics, levelGraphics.rectangle, new flash.geom.Point(0, 0));
uk.kerb.utils.SetOneInterval.create(700, uk.kerb.utils.EventDelegate.create(this, startLevel));
}
function startLevel() {
buttonManager.setEnabled(true);
mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, update);
startTime = getTimer();
mainRef.playSound("snd_letsgo", 50, 1);
mainRef.stopSound("snd_music1");
mainRef.playSound("snd_music2", 50, 9999999);
}
function setPause(paused) {
var _local3;
this.paused = paused;
if (paused) {
if (speed) {
toggleSpeed();
}
pauseTime = getTimer();
} else {
_local3 = getTimer() - pauseTime;
startTime = startTime + _local3;
releaseTime = releaseTime + _local3;
}
buttonManager.setPaused(paused);
setMessage(null);
recursiveControl(level_mc, !paused);
}
function recursiveControl(target_mc, active) {
var _local3;
if (active) {
target_mc.play();
} else {
target_mc.stop();
}
for (_local3 in target_mc) {
if (typeof(target_mc[_local3]) == "movieclip") {
recursiveControl(target_mc[_local3], active);
}
}
}
function toggleSpeed() {
if (paused && (!speed)) {
buttonManager.setSpeed(speed);
return(undefined);
}
speed = !speed;
if (speed) {
speedTime = getTimer();
} else {
speedTimeTotal = speedTimeTotal + (getTimer() - speedTime);
}
buttonManager.setSpeed(speed);
}
function setMessage(msg) {
if (msg == null) {
if (paused) {
if (levelOver) {
currMessage = MSG_LEVEL_OVER;
} else {
currMessage = MSG_PAUSED;
}
} else if (nuking || (nukeCounter > 0)) {
currMessage = MSG_NUKING;
} else {
currMessage = MSG_DEFAULT.split("@@NUM@@").join(minLemmings.toString());
currMessage = currMessage.split("@@s@@").join(((minLemmings == 1) ? "" : "s"));
}
} else {
currMessage = msg;
}
mc.infoBar_mc.message_txt.text = currMessage;
}
function nuke() {
if ((!nuking) && (!paused)) {
nuking = true;
unreleasedLemmings = 0;
buttonManager.setEnabled(false);
setMessage(MSG_NUKING);
mainRef.playSound("snd_nuke", 100, 5);
}
}
function setCurrentAction(actionNum) {
if (availableTypes[actionNum] > 0) {
currentAction = actionNum;
buttonManager.disableEmptyButtons(availableTypes);
}
}
function update() {
updateScroll();
updateCursor();
if (!paused) {
updateLemmings();
if (speed) {
updateLemmings();
}
updateTime();
}
}
function updateScroll() {
var _local6;
var _local3;
var _local10;
var _local8;
var _local12;
var _local11;
var _local9;
var _local7;
var _local4;
var _local5;
var _local2;
_local6 = mc.mask_mc._xmouse;
_local3 = mc.mask_mc._ymouse;
_local10 = ACTIVE_SCROLL_WIDTH;
_local8 = mc.mask_mc._width - ACTIVE_SCROLL_WIDTH;
_local12 = 0;
_local11 = mc.mask_mc._height;
_local2 = false;
if ((_local3 > _local12) && (_local3 < _local11)) {
if (_local6 < _local10) {
if (currScrollStep < MAX_SCROLL_STEP) {
if (currScrollStep < 0) {
currScrollStep = 0;
}
currScrollStep = currScrollStep + 1;
}
_local2 = true;
} else if (_local6 > _local8) {
if (currScrollStep > (-MAX_SCROLL_STEP)) {
if (currScrollStep > 0) {
currScrollStep = 0;
}
currScrollStep = currScrollStep - 1;
}
_local2 = true;
}
}
if (!_local2) {
if (currScrollStep < 0) {
currScrollStep++;
} else if (currScrollStep > 0) {
currScrollStep--;
}
}
_local9 = mc.screen_mc._x + currScrollStep;
_local4 = mc.mask_mc._x;
_local7 = (mc.screen_mc._x + levelMapStatic.width) + currScrollStep;
_local5 = mc.mask_mc._x + mc.mask_mc._width;
if (currScrollStep < 0) {
if (_local7 > _local5) {
mc.screen_mc._x = mc.screen_mc._x + currScrollStep;
} else {
mc.screen_mc._x = _local5 - levelMapStatic.width;
}
} else if (currScrollStep > 0) {
if (_local9 < _local4) {
mc.screen_mc._x = mc.screen_mc._x + currScrollStep;
} else {
mc.screen_mc._x = _local4;
}
}
}
function updateCursor() {
var _local12;
var _local11;
var _local10;
var _local9;
var _local7;
var _local8;
var _local4;
var _local3;
var _local2;
var _local5;
var _local6;
_local12 = level_mc._xmouse;
_local11 = level_mc._ymouse + CURSOR_Y_OFFSET;
_local10 = mc.mask_mc._x;
_local9 = mc.mask_mc._x + mc.mask_mc._width;
_local7 = CURSOR_Y_OFFSET;
_local8 = mc.mask_mc._y + mc.mask_mc._height;
targetLemming = null;
if ((((_local11 > _local10) && (_local11 < _local9)) && (_local11 > _local7)) && (_local11 < _local8)) {
mc.cursor_mc._visible = true;
_local2 = numLemmings - 1;
while (_local2 >= 0) {
_local4 = lemmings[_local2].x;
_local3 = lemmings[_local2].y;
if ((Math.abs(_local4 - _local12) < CURSOR_HIT_DISTANCE) && (Math.abs(_local3 - _local11) < CURSOR_HIT_DISTANCE)) {
_local5 = true;
targetLemming = lemmings[_local2];
break;
}
_local2--;
}
if (_local5) {
_local6 = {x:_local4, y:_local3 - CURSOR_Y_OFFSET};
level_mc.localToGlobal(_local6);
mc.globalToLocal(_local6);
mc.cursor_mc._x = _local6.x;
mc.cursor_mc._y = _local6.y;
mc.cursor_mc.gotoAndStop("on");
setMessage(targetLemming.getMessage());
} else {
mc.cursor_mc._x = mc._xmouse;
mc.cursor_mc._y = mc._ymouse;
mc.cursor_mc.gotoAndStop("off");
setMessage(null);
}
} else {
mc.cursor_mc._visible = false;
}
}
function resetCursor() {
mc.cursor_mc._visible = false;
}
function updateLemmings() {
var _local2;
var _local4;
var _local3;
_local4 = getTimer() - releaseTime;
if (speed) {
_local4 = _local4 * 2;
}
if (((_local4 > currReleaseRate) && (unreleasedLemmings > 0)) && (!nuking)) {
createLemming();
releaseTime = getTimer();
}
if (nuking) {
_local4 = nukeCounter / 2;
if (_local4 == Math.floor(_local4)) {
lemmings[_local4].setAction(ACTION_EXPLODE);
}
nukeCounter++;
if (_local4 == numLemmings) {
nuking = false;
}
if ((unreleasedLemmings == 0) && (numLemmings == 0)) {
_local2 = 0;
while (_local2 < lemmings.length) {
lemmings[_local2].setAction(ACTION_EXPLODE);
_local2++;
}
nuking = false;
if (savedLemmings >= minLemmings) {
winLevel();
} else {
loseLevel();
}
}
}
offscreenBitmap.copyPixels(levelGraphics, levelGraphics.rectangle, new flash.geom.Point(0, 0));
_local2 = 0;
while (_local2 < numLemmings) {
_local3 = lemmings[_local2].update(offscreenBitmap);
if (!_local3) {
if (lemmings[_local2].isHome()) {
savedLemmings++;
updateStats();
}
killLemming(_local2);
_local2--;
}
_local2++;
}
onscreenBitmap.copyPixels(offscreenBitmap, offscreenBitmap.rectangle, new flash.geom.Point(0, 0));
}
function updateTime() {
var _local2;
var _local5;
var _local3;
var _local4;
_local2 = (levelDuration - (getTimer() - startTime)) - speedTimeTotal;
if (speed) {
_local2 = _local2 - (getTimer() - speedTime);
}
if (_local2 <= 0) {
_local4 = "0:00";
if (savedLemmings >= minLemmings) {
winLevel();
} else {
loseLevel();
}
} else {
_local5 = Math.floor(_local2 / 60000);
_local3 = Math.floor((_local2 % 60000) / 1000);
if (_local3 < 10) {
_local4 = (_local5 + ":0") + _local3;
} else {
_local4 = (_local5 + ":") + _local3;
}
}
mc.infoBar_mc.time_txt.text = _local4;
}
function updateStats() {
mc.infoBar_mc.home_txt.text = (savedLemmings + "/") + maxLemmings;
mc.infoBar_mc.out_txt.text = (numLemmings + "/") + maxLemmings;
}
function createLemming() {
var _local2;
_local2 = new Lemming(idCounter, xRelease, yRelease, levelMapDynamic, levelMapStatic, levelGraphics, level_mc.lemmingLayer_mc);
lemmings.push(_local2);
numLemmings++;
idCounter++;
unreleasedLemmings--;
updateStats();
mainRef.playSound("snd_entrance", 40, 1);
level_mc.foregroundAnimations_mc.entrance_mc.gotoAndPlay("opening");
}
function killLemming(lemmingNum) {
var _local2;
var _local3;
lemmings[lemmingNum].cleanUp();
lemmings.splice(lemmingNum, 1);
numLemmings--;
if ((unreleasedLemmings == 0) && (numLemmings == 0)) {
if (savedLemmings >= minLemmings) {
winLevel();
} else {
loseLevel();
}
} else if (unreleasedLemmings == 0) {
_local3 = true;
_local2 = 0;
while (_local2 < numLemmings) {
if (lemmings[_local2].getAction() != Lemming.ACTION_BLOCK) {
_local3 = false;
break;
}
_local2++;
}
if (_local3) {
nuke();
}
}
updateStats();
}
function handleMouseClick() {
if (((targetLemming != null) && (currentAction != null)) && (!paused)) {
if (targetLemming.setAction(currentAction)) {
mc[("selection" + currentAction) + "_btn"].number_mc.num_txt.text = --availableTypes[currentAction];
buttonManager.disableEmptyButtons(availableTypes);
if (availableTypes[currentAction] == 0) {
currentAction = null;
}
mc.cursor_mc.blendMode = "normal";
uk.kerb.utils.SetOneInterval.create(160, uk.kerb.utils.EventDelegate.create(this, resetCursorBlend));
}
}
}
function resetCursorBlend() {
mc.cursor_mc.blendMode = "invert";
}
function loseLevel() {
levelOver = true;
delete mc.onEnterFrame;
if (speed) {
toggleSpeed();
}
if (!paused) {
setPause(true);
}
buttonManager.setEnabled(false);
resetCursor();
setMessage(null);
showMessage("loseLevel");
}
function winLevel() {
levelOver = true;
delete mc.onEnterFrame;
buttonManager.setEnabled(false);
resetCursor();
setMessage(null);
if (currLevelNum == (loadManager.getNumLevels() - 1)) {
showMessage("winGame");
} else {
showMessage("winLevel");
}
}
function showMessage(msg) {
mc.levelFinish_mc.gotoAndPlay(msg);
mc.levelFinish_mc.setLogo = uk.kerb.utils.EventDelegate.create(this, initClickthrough);
showingMessage = true;
activeButtonNum = null;
mainRef.stopAllSounds();
if (msg == "loseLevel") {
mc.levelFinish_mc.mainMenu_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, restart);
mc.levelFinish_mc.tryAgain_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, nextLevel, 0);
buttons = [mc.levelFinish_mc.mainMenu_btn, mc.levelFinish_mc.tryAgain_btn];
initClickthrough();
mainRef.playSound("snd_lose", 50, 9999);
} else if (msg == "winLevel") {
mc.levelFinish_mc.nextLevel_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, nextLevel, 1);
mc.levelFinish_mc.tryAgain_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, nextLevel, 0);
mc.levelFinish_mc.quit_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, restart);
buttons = [mc.levelFinish_mc.tryAgain_btn, mc.levelFinish_mc.nextLevel_btn];
initClickthrough();
mainRef.playSound("snd_win", 20, 9999);
} else if (msg == "winGame") {
mc.levelFinish_mc.sendFriend_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, jumpToSendFriend);
mc.levelFinish_mc.uctv_btn.onRelease = uk.kerb.utils.EventDelegate.create(mainRef, mainRef.handleUCTVButton);
mc.levelFinish_mc.ok_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, restart);
buttons = [mc.levelFinish_mc.sendFriend_btn, mc.levelFinish_mc.uctv_btn, mc.levelFinish_mc.ok_btn];
mainRef.playSound("snd_win", 20, 9999);
}
}
function initClickthrough() {
var frame = random(7);
var links = [Main.CITIES_3D_URL, Main.CITIES_3D_URL, Main.CITIES_3D_URL, Main.MAIN_UCTV_URL, Main.MAIN_UCTV_URL, Main.MAIN_UCTV_URL, Main.MAIN_UCTV_URL];
mc.levelFinish_mc.clickthrough_btn.gotoAndStop(frame + 1);
mc.levelFinish_mc.clickthrough_btn.onRelease = function () {
getURL (links[frame], "_blank");
};
mc.levelFinish_mc.forum_btn.onRelease = function () {
getURL (Main.FORUM_URL, "_blank");
};
}
function setFinishScreenLogo() {
var _local3;
var _local2;
var url;
_local2 = [];
_local2.push(Main.YOU_SEE_TV_URL);
_local2.push(Main.FACE_2_SPACE_URL);
_local2.push(Main.YOU_SEE_TV_URL);
_local2.push(Main.CITIES_3D_URL);
_local2.push(Main.MAIN_UCTV_URL);
_local2.push(Main.THOUGHT_OF_UNIVERSITY_URL);
_local2.push(Main.WHY_GO_TO_UNI_URL);
_local2.push(Main.MAIN_UCTV_URL);
_local2.push(Main.FACE_2_SPACE_URL);
_local2.push(Main.FACE_2_SPACE_URL);
_local2.push(Main.MAIN_UCTV_URL);
_local2.push(Main.MAIN_UCTV_URL);
_local2.push(Main.YOU_SEE_TV_URL);
_local2.push(Main.FACE_2_SPACE_URL);
_local2.push(Main.YOU_SEE_TV_URL);
url = _local2[currLevelNum];
mc.levelFinish_mc.logo_btn.gotoAndStop(currLevelNum + 1);
mc.levelFinish_mc.logo_btn.onRelease = function () {
getURL (url, "_blank");
};
}
function checkKeyPress() {
if (showingMessage) {
switch (true) {
case Key.isDown(13) :
case Key.isDown(32) :
buttons[activeButtonNum].onRelease();
break;
case Key.isDown(37) :
setActiveButton(-1);
break;
case Key.isDown(39) :
setActiveButton(1);
break;
case Key.isDown(9) :
setActiveButton(1);
}
} else {
switch (true) {
case Key.isDown(80) :
setPause(!paused);
break;
case Key.isDown(83) :
toggleSpeed();
break;
case Key.isDown(78) :
nuke();
}
}
}
function setActiveButton(step) {
var _local2;
activeButtonNum = activeButtonNum + step;
if (isNaN(activeButtonNum)) {
activeButtonNum = 0;
}
if (activeButtonNum == -1) {
activeButtonNum = buttons.length - 1;
} else if (activeButtonNum == buttons.length) {
activeButtonNum = 0;
}
_local2 = 0;
while (_local2 < buttons.length) {
buttons[_local2].gotoAndStop(((_local2 == activeButtonNum) ? "_over" : "_up"));
_local2++;
}
}
function nextLevel(increment) {
showingMessage = false;
mainRef.stopAllSounds();
bitmapManager.reset();
levelMapStatic.dispose();
levelMapDynamic.dispose();
levelGraphics.dispose();
levelBackground.dispose();
offscreenBitmap.dispose();
onscreenBitmap.dispose();
levelMapStatic = null;
levelMapDynamic = null;
levelGraphics = null;
levelBackground = null;
offscreenBitmap = null;
onscreenBitmap = null;
level_mc.removeMovieClip();
currLevelNum = currLevelNum + increment;
startGame();
}
function jumpToSendFriend() {
showingMessage = false;
mainRef.stopAllSounds();
mainRef.jumpToSendFriend();
}
function restart() {
showingMessage = false;
mainRef.stopAllSounds();
mainRef.restart();
}
static var ACTION_CLIMB = 0;
static var ACTION_FLOAT = 1;
static var ACTION_EXPLODE = 2;
static var ACTION_BLOCK = 3;
static var ACTION_BUILD = 4;
static var ACTION_BASH = 5;
static var ACTION_MINE = 6;
static var ACTION_DIG = 7;
static var MSG_DEFAULT = "Get @@NUM@@ student@@s@@ to the party!";
static var MSG_PAUSED = "Game paused.";
static var MSG_PAUSE_GAME = "Pause the game.";
static var MSG_RESUME_GAME = "Continue the game.";
static var MSG_LEVEL_OVER = "Level over.";
static var MSG_SPEED_UP = "Speed the students up.";
static var MSG_SLOW_DOWN = "Slow the students down.";
static var MSG_NUKE = "Kill all the students!";
static var MSG_CLIMB = "Choose Climber skill.";
static var MSG_FLOAT = "Choose Floater skill.";
static var MSG_EXPLODE = "Choose Exploder skill.";
static var MSG_BLOCK = "Choose Blocker skill.";
static var MSG_BUILD = "Choose Builder skill.";
static var MSG_BASH = "Choose Basher skill.";
static var MSG_MINE = "Choose Miner skill.";
static var MSG_DIG = "Choose Digger skill.";
static var MSG_WALKING = "This student is walking.";
static var MSG_CLIMBING = "This student is climbing.";
static var MSG_FLOATING = "This student is floating.";
static var MSG_EXPLODING = "This student is exploding.";
static var MSG_BLOCKING = "This student is blocking.";
static var MSG_BUILDING = "This student is building.";
static var MSG_BASHING = "This student is bashing.";
static var MSG_MINING = "This student is mining.";
static var MSG_DIGGING = "This student is digging.";
static var MSG_DROWNING = "This student is drowning.";
static var MSG_BURNING = "This student is burning.";
static var MSG_FALLING = "This student is falling.";
static var MSG_NUKING = "Oh noes!";
static var MSG_WTFING = "This student doesn't have a clue!";
static var ACTIVE_SCROLL_WIDTH = 50;
static var MAX_SCROLL_STEP = 20;
static var CURSOR_HIT_DISTANCE = 16;
static var CURSOR_Y_OFFSET = 15;
}
Symbol 1218 MovieClip [__Packages.ButtonManager] Frame 0
class ButtonManager
{
var mc, buttonTypes, messages, paused, speed;
function ButtonManager (mc) {
this.mc = mc;
buttonTypes = [Game.ACTION_CLIMB, Game.ACTION_FLOAT, Game.ACTION_EXPLODE, Game.ACTION_BLOCK, Game.ACTION_BUILD, Game.ACTION_BASH, Game.ACTION_MINE, Game.ACTION_DIG];
messages = [Game.MSG_CLIMB, Game.MSG_FLOAT, Game.MSG_EXPLODE, Game.MSG_BLOCK, Game.MSG_BUILD, Game.MSG_BASH, Game.MSG_MINE, Game.MSG_DIG];
paused = false;
speed = false;
AsBroadcaster.initialize(this);
initButtons();
}
function disableEmptyButtons(availableTypes) {
var _local2;
_local2 = 0;
while (_local2 < availableTypes.length) {
if (availableTypes[_local2] == 0) {
mc[("selection" + _local2) + "_btn"].enabled = false;
mc[("selection" + _local2) + "_btn"].gotoAndStop("_up");
}
_local2++;
}
}
function setEnabled(enabled) {
var _local2;
_local2 = 0;
while (_local2 < buttonTypes.length) {
mc[("selection" + _local2) + "_btn"].enabled = enabled;
mc[("selection" + _local2) + "_btn"].gotoAndStop("_up");
_local2++;
}
mc.pause_btn.enabled = enabled;
mc.pause_btn.gotoAndStop("_up");
mc.speed_btn.enabled = enabled;
mc.speed_btn.gotoAndStop("_offUp");
mc.nuke_btn.enabled = enabled;
mc.nuke_btn.gotoAndStop("_up");
}
function initButtons() {
var _local2;
var _local6;
var _local4;
var _local5;
var _local3;
_local2 = 0;
while (_local2 < 8) {
_local3 = mc[("selection" + _local2) + "_btn"];
_local6 = uk.kerb.utils.EventDelegate.create(this, broadcastMessage, "setMessage", messages[_local2]);
_local4 = uk.kerb.utils.EventDelegate.create(this, broadcastMessage, "setMessage", null);
_local5 = uk.kerb.utils.EventDelegate.create(this, handleSelectionButton, _local2);
_local3.onRollOver = _local6;
_local3.onRollOut = _local4;
_local3.onDragOut = _local4;
_local3.onRelease = _local5;
_local2++;
}
mc.pause_btn.onRollOver = uk.kerb.utils.EventDelegate.create(this, handlePauseRollOver);
mc.pause_btn.onRollOut = uk.kerb.utils.EventDelegate.create(this, handlePauseRollOut);
mc.pause_btn.onDragOut = uk.kerb.utils.EventDelegate.create(this, handlePauseRollOut);
mc.pause_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, handlePauseRelease);
mc.speed_btn.onRollOver = uk.kerb.utils.EventDelegate.create(this, handleSpeedRollOver);
mc.speed_btn.onRollOut = uk.kerb.utils.EventDelegate.create(this, handleSpeedRollOut);
mc.speed_btn.onDragOut = uk.kerb.utils.EventDelegate.create(this, handleSpeedRollOut);
mc.speed_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, handleSpeedRelease);
mc.nuke_btn.onRollOver = uk.kerb.utils.EventDelegate.create(this, handleNukeRollOver);
mc.nuke_btn.onRollOut = uk.kerb.utils.EventDelegate.create(this, handleNukeRollOut);
mc.nuke_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, handleNukeRelease);
setEnabled(false);
}
function handleSelectionButton(selectionNum) {
var _local3;
var _local2;
_local3 = 0;
while (_local3 < 8) {
_local2 = mc[("selection" + _local3) + "_btn"];
if (_local3 == selectionNum) {
_local2.enabled = false;
_local2.gotoAndStop("_down");
} else {
_local2.enabled = true;
_local2.gotoAndStop("_up");
}
_local3++;
}
broadcastMessage("setCurrentAction", buttonTypes[selectionNum]);
}
function handlePauseRollOver() {
if (paused) {
mc.pause_btn.gotoAndStop("_onOver");
broadcastMessage("setMessage", Game.MSG_RESUME_GAME);
} else {
mc.pause_btn.gotoAndStop("_offOver");
broadcastMessage("setMessage", Game.MSG_PAUSE_GAME);
}
}
function handlePauseRollOut() {
if (paused) {
mc.pause_btn.gotoAndStop("_onUp");
} else {
mc.pause_btn.gotoAndStop("_offUp");
}
broadcastMessage("setMessage", null);
}
function handlePauseRelease() {
paused = !paused;
broadcastMessage("setPause", paused);
if (paused) {
mc.pause_btn.gotoAndStop("_on");
}
}
function setPaused(paused) {
this.paused = paused;
if (paused) {
mc.pause_btn.gotoAndStop("_onUp");
} else {
mc.pause_btn.gotoAndStop("_offUp");
}
}
function handleSpeedRollOver() {
if (speed) {
mc.speed_btn.gotoAndStop("_onOver");
broadcastMessage("setMessage", Game.MSG_SLOW_DOWN);
} else {
mc.speed_btn.gotoAndStop("_offOver");
broadcastMessage("setMessage", Game.MSG_SPEED_UP);
}
}
function handleSpeedRollOut() {
if (speed) {
mc.speed_btn.gotoAndStop("_onUp");
} else {
mc.speed_btn.gotoAndStop("_offUp");
}
broadcastMessage("setMessage", null);
}
function handleSpeedRelease() {
speed = !speed;
broadcastMessage("toggleSpeed");
if (speed) {
mc.speed_btn.gotoAndStop("_onOver");
} else {
mc.speed_btn.gotoAndStop("_offOver");
}
}
function setSpeed(speed) {
this.speed = speed;
if (speed) {
mc.speed_btn.gotoAndStop("_onUp");
} else {
mc.speed_btn.gotoAndStop("_offUp");
}
}
function handleNukeRollOver() {
broadcastMessage("setMessage", Game.MSG_NUKE);
}
function handleNukeRollOut() {
broadcastMessage("setMessage", null);
}
function handleNukeRelease() {
if (!paused) {
broadcastMessage("nuke");
}
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage() {
}
}
Symbol 1219 MovieClip [__Packages.LoadManager] Frame 0
class LoadManager
{
var mc, levelNames, levelURLs, keyListener;
function LoadManager (mc) {
this.mc = mc;
AsBroadcaster.initialize(this);
mc.levelLoader_mc.gotoAndStop("on");
mc.levelLoader_mc.play_btn._visible = false;
levelNames = [];
levelNames.push("ALL BACK TO MINE");
levelNames.push("TREES ARE GOOD");
levelNames.push("STEP BACK IN TIME");
levelNames.push("BACK TO NATURE");
levelNames.push("CAN YOU DIG IT?");
levelNames.push("BLOCK PARTY");
levelNames.push("FAIR PLAY");
levelNames.push("A MINER INCONVENIECE");
levelNames.push("DOWN AND OUT");
levelNames.push("IT'S NOT FAIR");
levelNames.push("TAKE IT TO THE BRIDGE");
levelNames.push("TAKE THE HIGH ROAD");
levelNames.push("WHAT GOES UP...");
levelNames.push("POLE DANCING");
levelNames.push("YOU'RE HAVING A LAUGH");
levelURLs = [];
levelURLs.push("level1");
levelURLs.push("level4");
levelURLs.push("level7");
levelURLs.push("level5");
levelURLs.push("level8");
levelURLs.push("level2");
levelURLs.push("level12");
levelURLs.push("level3");
levelURLs.push("level13");
levelURLs.push("level11");
levelURLs.push("level6");
levelURLs.push("level10");
levelURLs.push("level9");
levelURLs.push("level14");
levelURLs.push("level15");
uk.kerb.utils.SetOneInterval.create(500, uk.kerb.utils.EventDelegate.create(this, broadcastMessage, "startGame"));
}
function getNumLevels() {
return(levelURLs.length);
}
function loadLevel(levelNum) {
mc.levelLoader_mc.loaderReady = uk.kerb.utils.EventDelegate.create(this, beginLevelLoad, levelNum);
mc.levelLoader_mc.gotoAndPlay("on");
mc.levelLoader_mc.blanking_btn.useHandCursor = false;
mc.levelLoader_mc.play_btn._visible = false;
mc.levelLoader_mc.loaderBar_mc._visible = true;
mc.levelLoader_mc.loadingLabel_mc._visible = true;
}
function beginLevelLoad(levelNum) {
var _local2;
mc.levelLoader_mc.message_txt.text = levelNames[levelNum];
mc.levelLoader_mc.levelNum_txt.text = "LEVEL " + (levelNum + 1);
mc.screen_mc._visible = false;
_local2 = levelURLs[levelNum];
mc.screen_mc.attachMovie(_local2, "level_mc", 0);
mc.levelLoader_mc.loaderBar_mc.gotoAndPlay(2);
mc.levelLoader_mc.play_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, startLevel);
mc.levelLoader_mc.loaderBar_mc._visible = false;
mc.levelLoader_mc.loadingLabel_mc._visible = false;
keyListener = new Object();
keyListener.onKeyDown = uk.kerb.utils.EventDelegate.create(this, checkKeyPress);
Key.addListener(keyListener);
}
function checkKeyPress() {
if (Key.isDown(13) || (Key.isDown(32))) {
startLevel();
}
}
function startLevel() {
Key.removeListener(keyListener);
mc.levelLoader_mc.play();
broadcastMessage("initLevel");
}
function addListener() {
}
function removeListener() {
}
function broadcastMessage() {
}
}
Symbol 1220 MovieClip [__Packages.uk.kerb.utils.SetOneInterval] Frame 0
class uk.kerb.utils.SetOneInterval
{
var func, interval;
function SetOneInterval (duration, func) {
this.func = func;
interval = setInterval(this, "intervalCalled", duration);
intervalList.push(this);
}
static function create(duration, func) {
return((new uk.kerb.utils.SetOneInterval(duration, func)).interval);
}
static function clearAll() {
var _local1;
_local1 = 0;
while (_local1 < intervalList.length) {
intervalList[_local1].stop();
_local1++;
}
}
function stop() {
intervalCalled();
}
function intervalCalled() {
var _local2;
clearInterval(interval);
_local2 = 0;
while (_local2 < intervalList.length) {
if (intervalList[_local2] == this) {
intervalList.splice(_local2, 1);
break;
}
_local2++;
}
func();
}
static var intervalList = [];
}
Symbol 1221 MovieClip [__Packages.BitmapManager] Frame 0
class BitmapManager
{
static var instance;
var numberBitmaps, craterBitmap, inverseCraterBitmap, bashBitmap, inverseBashBitmap;
function BitmapManager () {
}
static function getInstance() {
if (instance == undefined) {
instance = new BitmapManager();
}
return(instance);
}
function init(mc) {
var _local3;
var _local12;
var _local15;
var _local17;
var _local16;
var _local2;
var _local13;
var _local11;
var _local10;
var _local5;
var _local4;
var _local14;
var _local8;
var _local9;
var _local7;
var _local6;
var _local19;
reset();
_local16 = mc.getNextHighestDepth();
_local3 = mc.createEmptyMovieClip("__bitmaps__", _local16);
_local3._visible = false;
_local12 = _local3.attachMovie("numbers", "numbers_mc", 1);
_local13 = _local12._totalframes;
_local6 = 0;
while (_local6 <= _local13) {
_local12.gotoAndStop(_local6 + 1);
_local2 = _local3.getBounds();
_local5 = Math.ceil(_local2.xMax - _local2.xMin);
_local4 = Math.ceil(_local2.yMax - _local2.yMin);
_local11 = Math.round(-_local2.xMin);
_local10 = Math.round(-_local2.yMin);
_local9 = new flash.geom.Rectangle(0, 0, _local5, _local4);
_local8 = new flash.geom.Matrix();
_local8.translate(_local11, _local10);
_local7 = new flash.display.BitmapData(_local5, _local4, true, 0);
_local7.draw(_local3, _local8, _local14, "normal", _local9);
numberBitmaps.push(_local7);
_local6++;
}
_local15 = _local3.attachMovie("explodeCrater", "crater_mc", 1);
_local5 = _local3._width;
_local4 = _local3._height;
craterBitmap = new flash.display.BitmapData(_local5, _local4, true, 0);
craterBitmap.draw(_local3);
_local15 = _local3.attachMovie("inverseExplodeCrater", "crater_mc", 1);
_local5 = _local3._width;
_local4 = _local3._height;
inverseCraterBitmap = new flash.display.BitmapData(_local5, _local4, true, 0);
inverseCraterBitmap.draw(_local3);
_local17 = _local3.attachMovie("bashHole", "bashHole_mc", 1);
_local5 = _local3._width;
_local4 = _local3._height;
bashBitmap = new flash.display.BitmapData(_local5, _local4, true, 0);
bashBitmap.draw(_local3);
_local17 = _local3.attachMovie("inverseBashHole", "inverseBashHole_mc", 1);
_local5 = _local3._width;
_local4 = _local3._height;
inverseBashBitmap = new flash.display.BitmapData(_local5, _local4, true, 0);
inverseBashBitmap.draw(_local3);
_local3.removeMovieClip();
_local7.dispose();
}
function reset() {
var _local2;
_local2 = 0;
while (_local2 < numberBitmaps.length) {
numberBitmaps[_local2].dispose();
_local2++;
}
numberBitmaps = [];
craterBitmap.dispose();
inverseCraterBitmap.dispose();
bashBitmap.dispose();
inverseBashBitmap.dispose();
}
function getNumberBitmap(bitmapNum) {
return(numberBitmaps[bitmapNum]);
}
function getCraterBitmap() {
return(craterBitmap);
}
function getInverseCraterBitmap() {
return(inverseCraterBitmap);
}
function getBashBitmap() {
return(bashBitmap);
}
function getInverseBashBitmap() {
return(inverseBashBitmap);
}
}
Symbol 1222 MovieClip [__Packages.Lemming] Frame 0
class Lemming
{
var id, position, levelMapDynamic, levelMapStatic, levelGraphics, action, animation, animationStep, direction, canClimb, canFloat, home, explodeTime, w, h, xOffset, yOffset, fallCounter, bashCounter, buildCounter, mainRef, maxX, bitmapManager, hitTestDynamicBitmap, hitTestStaticBitmap, mc, hasFire, hasWater;
function Lemming (id, x, y, dynamicMap, staticMap, graphics, container_mc) {
var _local4;
var _local6;
var _local3;
var _local2;
this.id = id;
position = new flash.geom.Point(x, y);
levelMapDynamic = dynamicMap;
levelMapStatic = staticMap;
levelGraphics = graphics;
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
direction = RIGHT;
canClimb = false;
canFloat = false;
home = false;
explodeTime = null;
w = 10;
h = 27;
xOffset = -4;
yOffset = -29;
fallCounter = 0;
bashCounter = 0;
buildCounter = 0;
mainRef = Main.getInstance();
maxX = graphics.width + 100;
bitmapManager = BitmapManager.getInstance();
hitTestDynamicBitmap = new flash.display.BitmapData(w, h);
hitTestStaticBitmap = new flash.display.BitmapData(w, h);
_local4 = ["chav", "dolly", "geek", "goth", "punk", "sporty"];
_local6 = _local4[random(_local4.length)] + "_student";
_local3 = container_mc.getNextHighestDepth();
mc = container_mc.attachMovie(_local6, "lemming" + _local3, _local3);
mc._x = x;
mc._y = y;
mc._xscale = CHARACTER_SCALING;
mc._yscale = CHARACTER_SCALING;
_local2 = staticMap.getColorBoundsRect(WHITE, YELLOW);
hasFire = _local2.width != 0;
_local2 = staticMap.getColorBoundsRect(WHITE, BLUE);
hasWater = _local2.width != 0;
}
function update(offscreenBitmap) {
var _local2;
var _local5;
var _local4;
var _local7;
var _local3;
_local3 = true;
_local2 = ANIMATIONS[animation] + animationStep;
if (_local2 == ANIMATIONS[animation + 1]) {
_local2 = getNextAnimationSequence();
if (_local2 == null) {
_local3 = false;
}
}
if (((position.y > 500) || (position.x < -100)) || (position.x > maxX)) {
_local3 = false;
_local2 = null;
}
if (_local3) {
_local4 = getNewPosition();
position = hitTest(_local4);
if (home) {
_local3 = false;
_local2 = null;
}
if (_local2 != null) {
mc.gotoAndStop(_local2 + 1);
mc._x = x;
mc._y = y;
}
if (explodeTime != null) {
updateExplosion(offscreenBitmap);
}
animationStep++;
}
return(_local3);
}
function setAction(newAction) {
var _local2;
switch (newAction) {
case Game.ACTION_BLOCK :
_local2 = setActionBlock();
break;
case Game.ACTION_BUILD :
_local2 = setActionBuild();
break;
case Game.ACTION_BASH :
_local2 = setActionBash();
break;
case Game.ACTION_MINE :
_local2 = setActionMine();
break;
case Game.ACTION_DIG :
_local2 = setActionDig();
break;
case Game.ACTION_CLIMB :
_local2 = setActionClimb();
break;
case Game.ACTION_FLOAT :
_local2 = setActionFloat();
break;
case Game.ACTION_EXPLODE :
_local2 = setActionExplode();
break;
default :
_local2 = false;
}
return(_local2);
}
function getMessage() {
var _local2;
switch (action) {
case ACTION_BASH :
_local2 = Game.MSG_BASHING;
break;
case ACTION_BLOCK :
_local2 = Game.MSG_BLOCKING;
break;
case ACTION_BUILD :
_local2 = Game.MSG_BUILDING;
break;
case ACTION_BURN :
_local2 = Game.MSG_BURNING;
break;
case ACTION_CLIMB :
_local2 = Game.MSG_CLIMBING;
break;
case ACTION_DIG :
_local2 = Game.MSG_DIGGING;
break;
case ACTION_DROWN :
_local2 = Game.MSG_DROWNING;
break;
case ACTION_EXPLODE :
_local2 = Game.MSG_EXPLODING;
break;
case ACTION_FALL :
_local2 = Game.MSG_FALLING;
break;
case ACTION_FLOAT :
_local2 = Game.MSG_FLOATING;
break;
case ACTION_MINE :
_local2 = Game.MSG_MINING;
break;
case ACTION_SPLAT :
_local2 = Game.MSG_FALLING;
break;
case ACTION_WALK :
_local2 = Game.MSG_WALKING;
break;
default :
_local2 = Game.MSG_WTFING;
}
return(_local2);
}
function get x() {
return(position.x);
}
function get y() {
return(position.y);
}
function getAction() {
return(action);
}
function isHome() {
return(home);
}
function cleanUp() {
mc.removeMovieClip();
hitTestDynamicBitmap.dispose();
hitTestStaticBitmap.dispose();
}
function getNextAnimationSequence() {
var _local2;
switch (animation) {
case ANIMATION_BASH_INTRO :
animation = ANIMATION_BASH_LOOP;
_local2 = ANIMATIONS[animation];
animationStep = 0;
break;
case ANIMATION_BASH_LOOP :
_local2 = ANIMATIONS[animation];
bashCounter++;
animationStep = 0;
break;
case ANIMATION_BUILD_INTRO :
animation = ANIMATION_BUILD_LOOP;
_local2 = ANIMATIONS[animation];
animationStep = 0;
break;
case ANIMATION_BUILD_LOOP :
_local2 = ANIMATIONS[animation];
buildCounter++;
animationStep = 0;
break;
case ANIMATION_BUILD_END :
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
_local2 = ANIMATIONS[animation];
animationStep = 0;
break;
case ANIMATION_DIG_INTRO :
animation = ANIMATION_DIG_LOOP;
_local2 = ANIMATIONS[animation];
animationStep = 0;
break;
case ANIMATION_FLOAT_INTRO :
animation = ANIMATION_FLOAT_LOOP;
_local2 = ANIMATIONS[animation];
animationStep = 0;
break;
case ANIMATION_MINE_INTRO :
animation = ANIMATION_MINE_LOOP;
_local2 = ANIMATIONS[animation];
animationStep = 0;
break;
case ANIMATION_FLOAT_END :
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
_local2 = ANIMATIONS[animation];
animationStep = 0;
break;
case ANIMATION_BURN :
case ANIMATION_DROWN :
case ANIMATION_EXPLODE :
case ANIMATION_SPLAT :
_local2 = null;
animationStep = 0;
break;
default :
_local2 = ANIMATIONS[animation];
animationStep = 0;
}
return(_local2);
}
function getNewPosition() {
var _local2;
_local2 = position.clone();
switch (action) {
case ACTION_WALK :
_local2.x = _local2.x + ((direction == LEFT) ? (-WALK_STEP) : (WALK_STEP));
_local2.y = _local2.y + 1;
break;
case ACTION_FALL :
_local2.y = _local2.y + FALL_STEP;
break;
case ACTION_BASH :
if ((((animationStep == 0) || (animationStep == 5)) || (animationStep == 10)) || (animationStep == 15)) {
_local2.x = _local2.x + ((direction == LEFT) ? (-WALK_STEP) : (WALK_STEP));
}
break;
case ACTION_BUILD :
if (((animationStep == 0) && (buildCounter > 0)) && (animation != ANIMATION_BUILD_END)) {
_local2.x = _local2.x + ((direction == LEFT) ? (-BUILD_X_STEP) : (BUILD_X_STEP));
_local2.y = _local2.y + BUILD_Y_STEP;
}
break;
case ACTION_CLIMB :
_local2.y = _local2.y + CLIMB_STEP;
break;
case ACTION_DIG :
if ((animationStep == 5) && (animation == ANIMATION_DIG_LOOP)) {
_local2.y = _local2.y + DIG_STEP;
}
break;
case ACTION_FLOAT :
_local2.y = _local2.y + FLOAT_STEP;
break;
case ACTION_MINE :
if (!((animationStep == 7) && (animation == ANIMATION_MINE_LOOP))) {
break;
}
_local2.x = _local2.x + ((direction == LEFT) ? (-MINE_STEP) : (MINE_STEP));
_local2.y = _local2.y + MINE_STEP;
}
return(_local2);
}
function setActionBash() {
var _local2;
if ((((((((action != ACTION_BASH) && (action != ACTION_BLOCK)) && (action != ACTION_BURN)) && (action != ACTION_DROWN)) && (action != ACTION_EXPLODE)) && (action != ACTION_FALL)) && (action != ACTION_FLOAT)) && (action != ACTION_SPLAT)) {
action = ACTION_BASH;
animation = ANIMATION_BASH_INTRO;
animationStep = 0;
bashCounter = 0;
_local2 = true;
} else {
_local2 = false;
}
return(_local2);
}
function setActionBlock() {
var _local2;
if ((((((((action != ACTION_BLOCK) && (action != ACTION_BURN)) && (action != ACTION_CLIMB)) && (action != ACTION_DROWN)) && (action != ACTION_EXPLODE)) && (action != ACTION_FALL)) && (action != ACTION_FLOAT)) && (action != ACTION_SPLAT)) {
action = ACTION_BLOCK;
animation = ANIMATION_BLOCK_LOOP;
animationStep = 0;
drawBlockingWall();
_local2 = true;
} else {
_local2 = false;
}
return(_local2);
}
function setActionBuild() {
var _local2;
if (((((((((action != ACTION_BLOCK) && (action != ACTION_BURN)) && (action != ACTION_CLIMB)) && (action != ACTION_DROWN)) && (action != ACTION_EXPLODE)) && (action != ACTION_FALL)) && (action != ACTION_FLOAT)) && (action != ACTION_SPLAT)) && (!((action == ACTION_BUILD) && (buildCounter < MAX_BUILD_LOOPS)))) {
action = ACTION_BUILD;
animation = ANIMATION_BUILD_INTRO;
animationStep = 0;
buildCounter = 0;
_local2 = true;
} else {
_local2 = false;
}
return(_local2);
}
function setActionClimb() {
var _local2;
if (canClimb) {
_local2 = false;
} else {
canClimb = true;
_local2 = true;
}
return(_local2);
}
function setActionDig() {
var _local2;
if ((((((((action != ACTION_BLOCK) && (action != ACTION_BURN)) && (action != ACTION_DIG)) && (action != ACTION_DROWN)) && (action != ACTION_EXPLODE)) && (action != ACTION_FALL)) && (action != ACTION_FLOAT)) && (action != ACTION_SPLAT)) {
action = ACTION_DIG;
animation = ANIMATION_DIG_INTRO;
animationStep = 0;
_local2 = true;
} else {
_local2 = false;
}
return(_local2);
}
function setActionExplode() {
var _local2;
if (explodeTime == null) {
explodeTime = getTimer();
_local2 = true;
} else {
_local2 = false;
}
return(_local2);
}
function setActionFloat() {
var _local2;
if (canFloat) {
_local2 = false;
} else {
canFloat = true;
_local2 = true;
}
return(_local2);
}
function setActionMine() {
var _local2;
if ((((((((action != ACTION_BLOCK) && (action != ACTION_BURN)) && (action != ACTION_DROWN)) && (action != ACTION_EXPLODE)) && (action != ACTION_FALL)) && (action != ACTION_FLOAT)) && (action != ACTION_MINE)) && (action != ACTION_SPLAT)) {
action = ACTION_MINE;
animation = ANIMATION_MINE_INTRO;
animationStep = 0;
_local2 = true;
} else {
_local2 = false;
}
return(_local2);
}
function changeDirection() {
if (direction == LEFT) {
direction = RIGHT;
mc._xscale = CHARACTER_SCALING;
} else {
direction = LEFT;
mc._xscale = -CHARACTER_SCALING;
}
}
function getActionDescription() {
var _local2 = "";
switch (action) {
case ACTION_BASH :
_local2 = "bash";
break;
case ACTION_BLOCK :
_local2 = "block";
break;
case ACTION_BUILD :
_local2 = "build";
break;
case ACTION_BURN :
_local2 = "burn";
break;
case ACTION_CLIMB :
_local2 = "climb";
break;
case ACTION_DIG :
_local2 = "dig";
break;
case ACTION_DROWN :
_local2 = "drown";
break;
case ACTION_EXPLODE :
_local2 = "explode";
break;
case ACTION_FALL :
_local2 = "fall";
break;
case ACTION_FLOAT :
_local2 = "float";
break;
case ACTION_MINE :
_local2 = "mine";
break;
case ACTION_SPLAT :
_local2 = "splat";
break;
case ACTION_WALK :
_local2 = "walk";
break;
default :
_local2 = "???";
}
return(_local2);
}
function getAnimationDescription() {
var _local2 = "";
switch (animation) {
case ANIMATION_BASH_INTRO :
_local2 = "bash intro";
break;
case ANIMATION_BASH_LOOP :
_local2 = "bash loop";
break;
case ANIMATION_BLOCK_LOOP :
_local2 = "block intro";
break;
case ANIMATION_BUILD_INTRO :
_local2 = "build intro";
break;
case ANIMATION_BUILD_LOOP :
_local2 = "build loop";
break;
case ANIMATION_CLIMB_LOOP :
_local2 = "climb loop";
break;
case ANIMATION_DIG_INTRO :
_local2 = "dig intro";
break;
case ANIMATION_DIG_LOOP :
_local2 = "dig loop";
break;
case ANIMATION_DROWN :
_local2 = "drown";
break;
case ANIMATION_FLOAT_INTRO :
_local2 = "float intro";
break;
case ANIMATION_FLOAT_LOOP :
_local2 = "float loop";
break;
case ANIMATION_FLOAT_END :
_local2 = "float end";
break;
case ANIMATION_MINE_INTRO :
_local2 = "mine intro";
break;
case ANIMATION_MINE_LOOP :
_local2 = "mine loop";
break;
case ANIMATION_SPLAT :
_local2 = "splat";
break;
case ANIMATION_WALK_LOOP :
_local2 = "walk loop";
break;
case ANIMATION_BURN :
_local2 = "burn";
break;
case ANIMATION_EXPLODE :
_local2 = "explode";
break;
default :
_local2 = "???";
}
return(_local2);
}
function showHitArea(bitmap) {
if (_root.debug_mc == undefined) {
_root.createEmptyMovieClip("debug_mc", _root.getNextHighestDepth());
_root.debug_mc._x = 5;
_root.debug_mc._y = 5;
_root.debug_mc._xscale = 200;
_root.debug_mc._yscale = 200;
_root.debug_mc.beginFill(10066329, 100);
_root.debug_mc.moveTo(-2, -2);
_root.debug_mc.lineTo(12, -2);
_root.debug_mc.lineTo(12, 35);
_root.debug_mc.lineTo(-2, 35);
_root.debug_mc.endFill();
}
_root.debug_mc.attachBitmap(bitmap, 0);
}
function drawBlockingWall() {
var _local2;
var _local3;
_local2 = new flash.display.BitmapData(w, h, false, GREEN);
_local3 = position.clone();
_local3.x = _local3.x - (w / 2);
_local3.y = _local3.y - (h - MAX_STEP);
levelMapDynamic.copyPixels(_local2, _local2.rectangle, _local3, _local2, ZERO_POINT, true);
_local2.dispose();
_local2 = new flash.display.BitmapData(2, h, false, CYAN);
levelMapDynamic.copyPixels(_local2, _local2.rectangle, _local3, _local2, ZERO_POINT, true);
_local3.x = _local3.x + (w - 1);
levelMapDynamic.copyPixels(_local2, _local2.rectangle, _local3, _local2, ZERO_POINT, true);
_local2.dispose();
}
function updateExplosion(offscreenBitmap) {
var _local2;
var _local4;
var _local3;
var _local5;
_local4 = Math.ceil((5000 - (getTimer() - explodeTime)) / 1000);
if (_local4 <= 0) {
explodeTime = null;
action = ACTION_EXPLODE;
animation = ANIMATION_EXPLODE;
animationStep = 0;
mainRef.playSound("snd_explode", 100, 1);
_local2 = bitmapManager.getInverseCraterBitmap();
_local3 = position.clone();
_local3.x = _local3.x - (_local2.width / 2);
_local3.y = _local3.y - 40;
_local5 = new flash.geom.Rectangle(_local3.x, _local3.y, _local2.width, _local2.height);
levelGraphics.copyPixels(levelGraphics, _local5, _local3, _local2, ZERO_POINT, false);
_local2 = bitmapManager.getCraterBitmap();
levelMapDynamic.copyPixels(_local2, _local2.rectangle, _local3, _local2, ZERO_POINT, true);
} else {
drawCountdownNumber(_local4, offscreenBitmap);
}
}
function drawBashHole() {
var _local2;
var _local3;
var _local4;
_local2 = bitmapManager.getInverseBashBitmap();
_local3 = position.clone();
_local3.x = _local3.x - (_local2.width / 2);
_local3.y = _local3.y - 29;
_local4 = new flash.geom.Rectangle(_local3.x, _local3.y, _local2.width, _local2.height);
levelGraphics.copyPixels(levelGraphics, _local4, _local3, _local2, ZERO_POINT, false);
_local2 = bitmapManager.getBashBitmap();
levelMapDynamic.copyPixels(_local2, _local2.rectangle, _local3, _local2, ZERO_POINT, true);
}
function drawDigHole() {
var _local2;
var _local3;
var _local4;
_local2 = bitmapManager.getInverseBashBitmap();
_local3 = position.clone();
_local3.x = _local3.x - ((_local2.width / 2) + ((direction == LEFT) ? 4 : -4));
_local3.y = _local3.y - ((_local2.height / 2) + 12);
_local4 = new flash.geom.Rectangle(_local3.x, _local3.y, _local2.width, _local2.height);
levelGraphics.copyPixels(levelGraphics, _local4, _local3, _local2, ZERO_POINT, false);
_local2 = bitmapManager.getBashBitmap();
levelMapDynamic.copyPixels(_local2, _local2.rectangle, _local3, _local2, ZERO_POINT, true);
}
function drawBuildStep(buildPosition) {
var _local2;
_local2 = new flash.display.BitmapData(BUILD_X_STEP + 2, -BUILD_Y_STEP, false, GREEN);
buildPosition.x = buildPosition.x + ((direction == LEFT) ? -12 : 4);
buildPosition.y = buildPosition.y - 6;
levelMapDynamic.copyPixels(_local2, _local2.rectangle, buildPosition, _local2, ZERO_POINT, true);
_local2 = new flash.display.BitmapData(BUILD_X_STEP + 2, -BUILD_Y_STEP, false, 4291069500);
levelGraphics.copyPixels(_local2, _local2.rectangle, buildPosition, _local2, ZERO_POINT, true);
_local2.dispose();
}
function drawCountdownNumber(numSeconds, offscreenBitmap) {
var _local2;
var _local3;
_local2 = bitmapManager.getNumberBitmap(numSeconds - 1);
_local3 = position.clone();
_local3.x = _local3.x - 4;
_local3.y = _local3.y - 45;
offscreenBitmap.copyPixels(_local2, _local2.rectangle, _local3, _local2, ZERO_POINT, true);
}
function hitTest(newPosition) {
var _local3;
if ((((((action != ACTION_BLOCK) && (action != ACTION_DROWN)) && (action != ACTION_BURN)) && (action != ACTION_EXPLODE)) && (action != ACTION_SPLAT)) && (animation != ANIMATION_BUILD_END)) {
_local3 = new flash.geom.Rectangle(newPosition.x + xOffset, newPosition.y + yOffset, w, h);
hitTestDynamicBitmap.copyPixels(levelMapDynamic, _local3, ZERO_POINT);
hitTestStaticBitmap.copyPixels(levelMapStatic, _local3, ZERO_POINT);
if (!hitTestGeneral()) {
switch (action) {
case ACTION_WALK :
newPosition = hitTestWalk(newPosition);
break;
case ACTION_FALL :
newPosition = hitTestFall(newPosition);
break;
case ACTION_BASH :
newPosition = hitTestBash(newPosition);
break;
case ACTION_BUILD :
newPosition = hitTestBuild(newPosition);
break;
case ACTION_CLIMB :
newPosition = hitTestClimb(newPosition);
break;
case ACTION_DIG :
newPosition = hitTestDig(newPosition);
break;
case ACTION_FLOAT :
newPosition = hitTestFloat(newPosition);
break;
case ACTION_MINE :
newPosition = hitTestMine(newPosition);
}
}
}
return(newPosition);
}
function hitTestBash(newPosition) {
var _local3;
var _local4;
var _local2;
if ((((animationStep == 0) || (animationStep == 5)) || (animationStep == 10)) || (animationStep == 15)) {
_local3 = new flash.geom.Rectangle(newPosition.x + xOffset, newPosition.y + yOffset, w + 7, h);
_local2 = new flash.display.BitmapData(_local3.width, _local3.height);
_local2.copyPixels(levelMapStatic, _local3, ZERO_POINT);
_local4 = _local2.getColorBoundsRect(WHITE, RED);
if (_local4.height == 0) {
drawBashHole();
mainRef.playSound("snd_dig", 80, 1);
if ((animation == ANIMATION_BASH_LOOP) && (bashCounter > 0)) {
_local3 = new flash.geom.Rectangle(0, 0, w, h - 1);
_local2 = new flash.display.BitmapData(w, h - 1);
_local2.copyPixels(hitTestDynamicBitmap, _local3, ZERO_POINT);
_local4 = _local2.getColorBoundsRect(WHITE, GREEN);
if ((_local4.height == 0) && (bashCounter > 0)) {
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
}
}
} else {
newPosition.x = newPosition.x + ((direction == LEFT) ? (-WALK_STEP) : (WALK_STEP));
changeDirection();
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
}
_local2.dispose();
}
return(newPosition);
}
function hitTestBuild(newPosition) {
var _local5;
var _local3;
var _local2;
var _local6;
if (animation != ANIMATION_BUILD_END) {
if ((animationStep == 0) && (buildCounter > 0)) {
_local5 = new flash.geom.Rectangle(0, 0, w, h - 1);
_local2 = new flash.display.BitmapData(w, h - 1, false, 0);
_local2.copyPixels(hitTestDynamicBitmap, _local5, ZERO_POINT);
_local3 = _local2.getColorBoundsRect(WHITE, GREEN);
if (_local3.height != 0) {
newPosition.x = newPosition.x - ((direction == LEFT) ? (-BUILD_X_STEP) : (BUILD_X_STEP));
newPosition.y = newPosition.y - BUILD_Y_STEP;
changeDirection();
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
} else {
_local2.copyPixels(hitTestStaticBitmap, _local5, ZERO_POINT);
_local3 = _local2.getColorBoundsRect(WHITE, RED);
if (_local3.height != 0) {
newPosition.x = newPosition.x - ((direction == LEFT) ? (-BUILD_X_STEP) : (BUILD_X_STEP));
newPosition.y = newPosition.y - BUILD_Y_STEP;
changeDirection();
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
}
}
_local2.dispose();
}
if ((animationStep == 0) && (buildCounter == 0)) {
if (direction == LEFT) {
_local6 = new flash.geom.Point(position.x + BUILD_X_STEP, position.y - BUILD_Y_STEP);
} else {
_local6 = new flash.geom.Point(position.x - BUILD_X_STEP, position.y - BUILD_Y_STEP);
}
drawBuildStep(_local6);
}
if (animationStep == 29) {
drawBuildStep(position);
} else if (animationStep == 8) {
mainRef.playSound("snd_build", 60, 1);
}
if (buildCounter == MAX_BUILD_LOOPS) {
animation = ANIMATION_BUILD_END;
animationStep = 0;
}
}
return(newPosition);
}
function hitTestClimb(newPosition) {
var _local4;
var _local3;
var _local2;
var _local5;
_local5 = false;
_local2 = new flash.display.BitmapData(w, 1);
_local4 = new flash.geom.Rectangle(0, 0, w, 1);
_local2.copyPixels(hitTestDynamicBitmap, _local4, ZERO_POINT);
_local3 = _local2.getColorBoundsRect(WHITE, GREEN);
if (_local3.width == w) {
action = ACTION_FALL;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
newPosition.x = newPosition.x + ((direction == LEFT) ? 1 : -1);
changeDirection();
_local5 = true;
} else {
_local2.copyPixels(hitTestStaticBitmap, _local4, ZERO_POINT);
_local3 = _local2.getColorBoundsRect(WHITE, RED);
if (_local3.width == w) {
action = ACTION_FALL;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
newPosition.x = newPosition.x + ((direction == LEFT) ? 1 : -1);
changeDirection();
_local5 = true;
}
}
if (!_local5) {
_local2 = new flash.display.BitmapData(1, h);
if (direction == LEFT) {
_local4 = new flash.geom.Rectangle(0, 0, 1, h);
} else {
_local4 = new flash.geom.Rectangle(w - 1, 0, 1, h);
}
_local2.copyPixels(hitTestDynamicBitmap, _local4, ZERO_POINT);
_local3 = _local2.getColorBoundsRect(WHITE, GREEN);
if (_local3.height == 1) {
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
}
_local2.copyPixels(hitTestStaticBitmap, _local4, ZERO_POINT);
_local3 = _local2.getColorBoundsRect(WHITE, RED);
if (_local3.height == 1) {
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
}
}
_local2.dispose();
return(newPosition);
}
function hitTestDig(newPosition) {
var _local3;
var _local4;
var _local2;
if ((animationStep == 5) && (animation == ANIMATION_DIG_LOOP)) {
_local3 = new flash.geom.Rectangle(newPosition.x + xOffset, newPosition.y + yOffset, w, h + 7);
_local2 = new flash.display.BitmapData(_local3.width, _local3.height);
_local2.copyPixels(levelMapStatic, _local3, ZERO_POINT);
_local4 = _local2.getColorBoundsRect(WHITE, RED);
if (_local4.height == 0) {
drawDigHole();
mainRef.playSound("snd_dig", 80, 1);
if (animation == ANIMATION_DIG_LOOP) {
_local3 = new flash.geom.Rectangle(0, 0, w, h);
_local2 = new flash.display.BitmapData(w, h);
_local2.copyPixels(hitTestDynamicBitmap, _local3, ZERO_POINT);
_local4 = _local2.getColorBoundsRect(WHITE, GREEN);
if (_local4.height == 0) {
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
}
}
} else {
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
}
_local2.dispose();
}
return(newPosition);
}
function hitTestFall(newPosition) {
var _local3;
var _local5;
var _local2;
var _local4;
_local5 = 0;
_local4 = new flash.display.BitmapData(w, 1);
_local3 = FALL_STEP;
while (_local3 >= 0) {
_local2 = new flash.geom.Rectangle(0, (h - 1) - _local3, w, 1);
_local4.copyPixels(hitTestDynamicBitmap, _local2, ZERO_POINT);
_local2 = _local4.getColorBoundsRect(WHITE, GREEN);
if (_local2.height == 1) {
_local5 = _local3;
break;
}
_local2 = new flash.geom.Rectangle(0, (h - 1) - _local3, w, 1);
_local4.copyPixels(hitTestStaticBitmap, _local2, ZERO_POINT);
_local2 = _local4.getColorBoundsRect(WHITE, RED);
if (_local2.height == 1) {
_local5 = _local3;
break;
}
_local3--;
}
if (_local5 == 0) {
fallCounter++;
if (canFloat) {
action = ACTION_FLOAT;
animation = ANIMATION_FLOAT_INTRO;
animationStep = 0;
fallCounter = 0;
mainRef.playSound("snd_umbrella", 80, 1);
}
} else {
newPosition.y = newPosition.y - _local5;
if (fallCounter > MAX_FALL_DISTANCE) {
newPosition.y--;
action = ACTION_SPLAT;
animation = ANIMATION_SPLAT;
animationStep = 0;
mainRef.playSound("snd_splat", 80, 1);
} else {
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
}
fallCounter = 0;
}
_local4.dispose();
return(newPosition);
}
function hitTestFloat(newPosition) {
var _local3;
var _local5;
var _local2;
var _local4;
_local5 = 0;
_local4 = new flash.display.BitmapData(w, 1);
_local3 = FLOAT_STEP;
while (_local3 >= 0) {
_local2 = new flash.geom.Rectangle(0, (h - 1) - _local3, w, 1);
_local4.copyPixels(hitTestDynamicBitmap, _local2, ZERO_POINT);
_local2 = _local4.getColorBoundsRect(WHITE, GREEN);
if (_local2.height == 1) {
_local5 = _local3;
break;
}
_local4.copyPixels(hitTestStaticBitmap, _local2, ZERO_POINT);
_local2 = _local4.getColorBoundsRect(WHITE, RED);
if (_local2.height == 1) {
_local5 = _local3;
break;
}
_local3--;
}
if (_local5 > 0) {
newPosition.y = newPosition.y - _local5;
if (animation != ANIMATION_FLOAT_END) {
animation = ANIMATION_FLOAT_END;
animationStep = 0;
}
}
_local4.dispose();
return(newPosition);
}
function hitTestMine(newPosition) {
var _local3;
var _local4;
var _local2;
if ((animationStep == 7) && (animation == ANIMATION_MINE_LOOP)) {
_local3 = new flash.geom.Rectangle(newPosition.x + xOffset, newPosition.y + yOffset, w, h);
_local2 = new flash.display.BitmapData(_local3.width, _local3.height);
_local2.copyPixels(levelMapStatic, _local3, ZERO_POINT);
_local4 = _local2.getColorBoundsRect(WHITE, RED);
_local2.dispose();
if (_local4.height == 0) {
drawDigHole();
mainRef.playSound("snd_dig", 80, 1);
if (animation == ANIMATION_MINE_LOOP) {
_local3 = new flash.geom.Rectangle(0, h - 1, w, 1);
_local2 = new flash.display.BitmapData(w, 1);
_local2.copyPixels(hitTestDynamicBitmap, _local3, ZERO_POINT);
_local4 = _local2.getColorBoundsRect(WHITE, GREEN);
if (_local4.height == 0) {
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
}
}
} else {
newPosition.y = newPosition.y - MINE_STEP;
newPosition.x = newPosition.x + ((direction == LEFT) ? (-WALK_STEP) : (WALK_STEP));
changeDirection();
action = ACTION_WALK;
animation = ANIMATION_WALK_LOOP;
animationStep = 0;
}
_local2.dispose();
}
return(newPosition);
}
function hitTestWalk(newPosition) {
var _local3;
var _local5;
var _local7;
var _local2;
var _local4;
_local5 = 0;
_local4 = new flash.display.BitmapData(w, 1);
_local3 = 0;
while (_local3 <= MAX_STEP) {
_local2 = new flash.geom.Rectangle(0, (h - 1) - _local3, w, 1);
_local4.copyPixels(hitTestDynamicBitmap, _local2, ZERO_POINT);
_local2 = _local4.getColorBoundsRect(WHITE, GREEN);
if (_local2.height == 1) {
_local5 = _local3;
} else {
_local2 = new flash.geom.Rectangle(0, (h - 1) - _local3, w, 1);
_local4.copyPixels(hitTestStaticBitmap, _local2, ZERO_POINT);
_local2 = _local4.getColorBoundsRect(WHITE, RED);
if (_local2.height == 1) {
_local5 = _local3;
} else {
break;
}
}
_local3++;
}
if (_local5 == MAX_STEP) {
_local2 = hitTestDynamicBitmap.getColorBoundsRect(WHITE, CYAN);
if (canClimb && (_local2.width == 0)) {
action = ACTION_CLIMB;
animation = ANIMATION_CLIMB_LOOP;
animationStep = 0;
} else {
changeDirection();
newPosition.y--;
}
} else if (_local5 == 0) {
_local7 = new flash.geom.Rectangle(newPosition.x + xOffset, ((newPosition.y + yOffset) + h) + 1, w, 1);
_local4.copyPixels(levelMapDynamic, _local7, ZERO_POINT);
_local2 = _local4.getColorBoundsRect(WHITE, GREEN);
if (_local2.height == 0) {
_local4.copyPixels(levelMapStatic, _local7, ZERO_POINT);
_local2 = _local4.getColorBoundsRect(WHITE, RED);
if (_local2.height == 0) {
action = ACTION_FALL;
} else {
newPosition.y--;
}
}
} else {
newPosition.y = newPosition.y - _local5;
}
_local4.dispose();
return(newPosition);
}
function hitTestGeneral() {
var _local3;
var _local2;
_local2 = hitTestStaticBitmap.getColorBoundsRect(WHITE, WHITE);
if ((_local2.width == w) && (_local2.height == h)) {
home = true;
_local3 = true;
} else {
if (hasFire) {
_local2 = hitTestStaticBitmap.getColorBoundsRect(WHITE, YELLOW);
if (_local2.width != 0) {
action = ACTION_BURN;
animation = ANIMATION_BURN;
mainRef.playSound("snd_burn", 100, 1);
animationStep = 0;
_local3 = true;
}
}
if (hasWater) {
_local2 = hitTestStaticBitmap.getColorBoundsRect(WHITE, BLUE);
if (_local2.width != 0) {
action = ACTION_DROWN;
animation = ANIMATION_DROWN;
mainRef.playSound("snd_drown", 80, 1);
animationStep = 0;
_local3 = true;
} else {
_local3 = false;
}
}
}
return(_local3);
}
static var ACTION_BASH = 0;
static var ACTION_BLOCK = 1;
static var ACTION_BUILD = 2;
static var ACTION_BURN = 3;
static var ACTION_CLIMB = 4;
static var ACTION_DIG = 5;
static var ACTION_DROWN = 6;
static var ACTION_EXPLODE = 7;
static var ACTION_FALL = 8;
static var ACTION_FLOAT = 9;
static var ACTION_MINE = 10;
static var ACTION_SPLAT = 11;
static var ACTION_WALK = 12;
static var ANIMATION_BASH_INTRO = 0;
static var ANIMATION_BASH_LOOP = 1;
static var ANIMATION_BLOCK_LOOP = 2;
static var ANIMATION_BUILD_INTRO = 3;
static var ANIMATION_BUILD_LOOP = 4;
static var ANIMATION_CLIMB_LOOP = 5;
static var ANIMATION_DIG_INTRO = 6;
static var ANIMATION_DIG_LOOP = 7;
static var ANIMATION_DROWN = 8;
static var ANIMATION_FLOAT_INTRO = 9;
static var ANIMATION_FLOAT_LOOP = 10;
static var ANIMATION_FLOAT_END = 11;
static var ANIMATION_MINE_INTRO = 12;
static var ANIMATION_MINE_LOOP = 13;
static var ANIMATION_SPLAT = 14;
static var ANIMATION_WALK_LOOP = 15;
static var ANIMATION_BURN = 16;
static var ANIMATION_EXPLODE = 17;
static var ANIMATION_BUILD_END = 18;
static var ANIMATIONS = [0, 9, 29, 99, 107, 137, 167, 186, 213, 243, 272, 301, 309, 329, 363, 383, 403, 426, 442, 474];
static var CHARACTER_SCALING = 56;
static var ZERO_POINT = new flash.geom.Point(0, 0);
static var LEFT = 443;
static var RIGHT = 0;
static var BUILD_X_STEP = 7;
static var BUILD_Y_STEP = -3;
static var MAX_BUILD_LOOPS = 11;
static var WALK_STEP = 1;
static var FALL_STEP = 5;
static var FLOAT_STEP = 2;
static var CLIMB_STEP = -1;
static var DIG_STEP = 4;
static var MINE_STEP = 4;
static var MAX_STEP = 6;
static var MAX_FALL_DISTANCE = 23;
static var GREEN = 4278255360;
static var RED = 4294901760;
static var BLUE = 4278190335;
static var YELLOW = 4294967040;
static var CYAN = 4278255615;
static var WHITE = 4294967295;
static var BLACK = 4278190080;
}
Symbol 1223 MovieClip [__Packages.uk.kerb.utils.sound.SoundManager] Frame 0
class uk.kerb.utils.sound.SoundManager
{
var mcRef, soundList, preloaderList, globalSounds, soundOnFlag, allSoundsLoaded, soundLoadStarted;
function SoundManager (_mcRef) {
mcRef = _mcRef;
soundList = new Array();
preloaderList = new Array();
globalSounds = new Sound();
soundOnFlag = true;
}
function loadSoundList(_soundlist) {
var _local6 = false;
var _local5;
var _local4;
var _local2 = 0;
while (_local2 < _soundlist.length) {
if (_soundlist[_local2].toLowerCase().indexOf(".mp3") > -1) {
preloaderList.push(_soundlist[_local2]);
_local6 = true;
} else {
_local5 = mcRef.createEmptyMovieClip("sounddummy" + mcRef.getNextHighestDepth(), mcRef.getNextHighestDepth());
_local4 = new uk.kerb.utils.sound.ExtendedSound(_local5);
_local4.attachSound(_soundlist[_local2]);
soundList[_soundlist[_local2]] = _local4;
}
_local2++;
}
if (_local6) {
preloadNextMP3();
} else {
allSoundsLoaded(true);
}
}
function playSound(_id, _volume, _loops, _fadeSpeedSeconds) {
soundList[_id].start(0, _loops);
if ((_fadeSpeedSeconds != undefined) && (_fadeSpeedSeconds != 0)) {
soundList[_id].setVolume(0);
soundList[_id].startFade(_volume, _fadeSpeedSeconds);
} else {
soundList[_id].setVolume(_volume);
}
}
function stopSound(_id, _fadeSpeed) {
if ((_fadeSpeed != undefined) && (_fadeSpeed != 0)) {
soundList[_id].startFade(0, _fadeSpeed);
} else {
soundList[_id].stop();
}
}
function stopEverySound(_fadeSpeed, _excludIdlist) {
var _local2;
for (var _local5 in soundList) {
_local2 = soundList[_local5];
if (!checkIfExcluded(Number(_local5), _excludIdlist)) {
if ((_fadeSpeed != undefined) && (_fadeSpeed != 0)) {
_local2.startFade(0, _fadeSpeed);
} else {
_local2.stop();
}
}
}
}
function soundOff() {
var _local2;
for (var _local3 in soundList) {
_local2 = soundList[_local3];
_local2.setMute(true);
}
globalSounds.setVolume(0);
soundOnFlag = false;
}
function soundOn() {
for (var _local2 in soundList) {
soundList[_local2].setMute(false);
}
globalSounds.setVolume(100);
soundOnFlag = true;
}
function isSoundOn() {
return(soundOnFlag);
}
function fadeInRandomSound(_obj, _fadeSpeed) {
var _local6 = 0;
var _local3 = 0;
while (_local3 < _obj.length) {
_local6 = _local6 + _obj[_local3].freqency;
_local3++;
}
var _local5 = 0;
_local3 = 0;
while (_local3 < _obj.length) {
_local5 = _local5 + (_obj[_local3].freqency / _local6);
_obj[_local3].chance = _local5;
_local3++;
}
var _local4 = Math.random();
var _local7 = 0;
_local3 = 1;
while (_local3 < _obj.length) {
if ((_local4 > _obj[_local3 - 1].chance) && (_local4 <= _obj[_local3].chance)) {
_local7 = _local3;
}
_local3++;
}
var _local8 = _obj[_local7].level.split("-");
var _local9 = (Math.random() * (Number(_local8[1]) - Number(_local8[0]))) + Number(_local8[0]);
playSound(_obj[_local7].id, _local9, 1, _fadeSpeed);
}
function checkIfExcluded(_excludeid, _excludIdlist) {
var _local1 = 0;
while (_local1 < _excludIdlist.length) {
if (_excludIdlist[_local1] == _excludeid) {
return(true);
}
_local1++;
}
return(false);
}
function preloadNextMP3() {
var _local7 = this;
if (preloaderList.length > 0) {
var _local2 = preloaderList.shift();
if (soundLoadStarted != undefined) {
soundLoadStarted(_local2);
}
var _local6 = mcRef.createEmptyMovieClip("sounddummy" + mcRef.getNextHighestDepth(), mcRef.getNextHighestDepth());
var _local3 = new uk.kerb.utils.sound.ExtendedSound(_local6);
_local3.loadSound(_local2);
var _local5 = _local2.split("/");
var _local4 = _local5[_local5.length - 1].slice(0, -4);
soundList[_local4] = _local3;
soundList[_local4].onLoad = uk.kerb.utils.EventDelegate.create(this, preloadNextMP3);
} else {
allSoundsLoaded(true);
}
}
}
Symbol 1224 MovieClip [__Packages.uk.kerb.utils.sound.ExtendedSound] Frame 0
class uk.kerb.utils.sound.ExtendedSound extends Sound
{
var mcRef, mute, fade, onFadeComplete, volume, decay, loops, isPlaying;
function ExtendedSound (_mcRef) {
super((mcRef = _mcRef));
mute = 1;
}
function startFade(_targetVolume, _speed) {
fade = new mx.transitions.Tween(this, "volume", mx.transitions.easing.Regular.easeOut, getVolume(), _targetVolume, _speed, true);
fade.onMotionChanged = uk.kerb.utils.EventDelegate.create(this, setFadeVolume);
fade.onMotionFinished = uk.kerb.utils.EventDelegate.create(this, onFadeComplete);
return(this);
}
function setFadeVolume(_tw) {
setVolume(volume);
}
function attachSound(_libraryID) {
stop();
super.attachSound(_libraryID);
return(this);
}
function loadSound(_mp3URL) {
stop();
super.loadSound(_mp3URL, false);
return(this);
}
function start(_decay, _loops) {
stop();
if (_decay == undefined) {
_decay = 0;
}
if (_loops == undefined) {
_loops = 1;
}
super.start((decay = _decay), (loops = _loops));
isPlaying = true;
return(this);
}
function stop() {
super.stop();
isPlaying = false;
return(this);
}
function setVolume(_volume) {
if (_volume == undefined) {
_volume = 100;
}
super.setVolume(((((volume = _volume)) / 100) * masterVolume) * mute);
return(this);
}
function getVolume() {
return(volume);
}
function setMute(_bool) {
mute = (_bool ? 0 : 1);
setVolume(getVolume());
return(this);
}
static var masterVolume = 100;
}
Symbol 1225 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 1226 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 1227 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 __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 1228 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 512 MovieClip Frame 1
stop();
Symbol 514 MovieClip [level1] Frame 1
var levelDuration = 300000;
var initScroll = -400;
var maxLemmings = 10;
var minLemmings = 10;
var initReleaseRate = 5000;
var numClimbers = 0;
var numFloaters = 0;
var numExploders = 10;
var numBlockers = 0;
var numBuilders = 0;
var numBashers = 0;
var numMiners = 10;
var numDiggers = 10;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap1");
levelBackground = flash.display.BitmapData.loadBitmap("mineBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics1");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 520 MovieClip [level2] Frame 1
var levelDuration = 420000;
var initScroll = -500;
var maxLemmings = 20;
var minLemmings = 16;
var initReleaseRate = 3000;
var numClimbers = 0;
var numFloaters = 0;
var numExploders = 10;
var numBlockers = 10;
var numBuilders = 0;
var numBashers = 0;
var numMiners = 0;
var numDiggers = 0;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap2");
levelBackground = flash.display.BitmapData.loadBitmap("mineBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics2");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 570 MovieClip [level3] Frame 1
var levelDuration = 420000;
var initScroll = -400;
var maxLemmings = 20;
var minLemmings = 10;
var initReleaseRate = 3000;
var numClimbers = 0;
var numFloaters = 0;
var numExploders = 20;
var numBlockers = 0;
var numBuilders = 0;
var numBashers = 0;
var numMiners = 0;
var numDiggers = 0;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap3");
levelBackground = flash.display.BitmapData.loadBitmap("mineBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics3");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 632 MovieClip [level4] Frame 1
var levelDuration = 420000;
var initScroll = -132;
var maxLemmings = 20;
var minLemmings = 10;
var initReleaseRate = 2000;
var numClimbers = 0;
var numFloaters = 20;
var numExploders = 5;
var numBlockers = 5;
var numBuilders = 0;
var numBashers = 5;
var numMiners = 0;
var numDiggers = 0;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap4");
levelBackground = flash.display.BitmapData.loadBitmap("forestBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics4");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 636 MovieClip [level5] Frame 1
var levelDuration = 420000;
var initScroll = 0;
var maxLemmings = 30;
var minLemmings = 15;
var initReleaseRate = 2000;
var numClimbers = 10;
var numFloaters = 10;
var numExploders = 10;
var numBlockers = 10;
var numBuilders = 30;
var numBashers = 10;
var numMiners = 10;
var numDiggers = 10;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap5");
levelBackground = flash.display.BitmapData.loadBitmap("forestBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics5");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 647 MovieClip [level6] Frame 1
var levelDuration = 420000;
var initScroll = 0;
var maxLemmings = 30;
var minLemmings = 15;
var initReleaseRate = 2000;
var numClimbers = 10;
var numFloaters = 10;
var numExploders = 10;
var numBlockers = 10;
var numBuilders = 30;
var numBashers = 10;
var numMiners = 10;
var numDiggers = 10;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap6");
levelBackground = flash.display.BitmapData.loadBitmap("forestBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics6");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 688 MovieClip [level7] Frame 1
var levelDuration = 360000;
var initScroll = 0;
var maxLemmings = 20;
var minLemmings = 15;
var initReleaseRate = 3000;
var numClimbers = 2;
var numFloaters = 2;
var numExploders = 10;
var numBlockers = 10;
var numBuilders = 20;
var numBashers = 5;
var numMiners = 5;
var numDiggers = 5;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap7");
levelBackground = flash.display.BitmapData.loadBitmap("castleBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics7");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 697 MovieClip [level8] Frame 1
var levelDuration = 420000;
var initScroll = 0;
var maxLemmings = 30;
var minLemmings = 30;
var initReleaseRate = 3000;
var numClimbers = 0;
var numFloaters = 0;
var numExploders = 0;
var numBlockers = 0;
var numBuilders = 0;
var numBashers = 0;
var numMiners = 0;
var numDiggers = 30;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap8");
levelBackground = flash.display.BitmapData.loadBitmap("castleBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics8");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 704 MovieClip [level9] Frame 1
var levelDuration = 360000;
var initScroll = 0;
var maxLemmings = 25;
var minLemmings = 23;
var initReleaseRate = 3000;
var numClimbers = 2;
var numFloaters = 2;
var numExploders = 2;
var numBlockers = 2;
var numBuilders = 5;
var numBashers = 2;
var numMiners = 2;
var numDiggers = 2;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap9");
levelBackground = flash.display.BitmapData.loadBitmap("castleBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics9");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 713 MovieClip [level10] Frame 1
var levelDuration = 420000;
var initScroll = -684;
var maxLemmings = 30;
var minLemmings = 20;
var initReleaseRate = 3000;
var numClimbers = 5;
var numFloaters = 5;
var numExploders = 10;
var numBlockers = 10;
var numBuilders = 10;
var numBashers = 5;
var numMiners = 5;
var numDiggers = 0;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap10");
levelBackground = flash.display.BitmapData.loadBitmap("fairgroundBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics10");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 720 MovieClip [level11] Frame 1
var levelDuration = 300000;
var initScroll = -892;
var maxLemmings = 30;
var minLemmings = 22;
var initReleaseRate = 3000;
var numClimbers = 20;
var numFloaters = 0;
var numExploders = 20;
var numBlockers = 20;
var numBuilders = 20;
var numBashers = 20;
var numMiners = 20;
var numDiggers = 20;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap11");
levelBackground = flash.display.BitmapData.loadBitmap("fairgroundBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics11");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 727 MovieClip [level12] Frame 1
var levelDuration = 240000;
var initScroll = 0;
var maxLemmings = 30;
var minLemmings = 25;
var initReleaseRate = 6000;
var numClimbers = 20;
var numFloaters = 20;
var numExploders = 20;
var numBlockers = 2;
var numBuilders = 30;
var numBashers = 20;
var numMiners = 20;
var numDiggers = 20;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap12");
levelBackground = flash.display.BitmapData.loadBitmap("fairgroundBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics12");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 749 MovieClip [level13] Frame 1
var levelDuration = 240000;
var initScroll = -770;
var maxLemmings = 30;
var minLemmings = 20;
var initReleaseRate = 5000;
var numClimbers = 2;
var numFloaters = 2;
var numExploders = 10;
var numBlockers = 10;
var numBuilders = 10;
var numBashers = 1;
var numMiners = 0;
var numDiggers = 5;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap13");
levelBackground = flash.display.BitmapData.loadBitmap("factoryBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics13");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 757 MovieClip [level14] Frame 1
var levelDuration = 300000;
var initScroll = 0;
var maxLemmings = 30;
var minLemmings = 25;
var initReleaseRate = 5000;
var numClimbers = 1;
var numFloaters = 10;
var numExploders = 0;
var numBlockers = 0;
var numBuilders = 6;
var numBashers = 4;
var numMiners = 0;
var numDiggers = 4;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap14");
levelBackground = flash.display.BitmapData.loadBitmap("factoryBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics14");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 764 MovieClip [level15] Frame 1
var levelDuration = 360000;
var initScroll = -577;
var maxLemmings = 30;
var minLemmings = 20;
var initReleaseRate = 6000;
var numClimbers = 2;
var numFloaters = 2;
var numExploders = 4;
var numBlockers = 0;
var numBuilders = 20;
var numBashers = 0;
var numMiners = 0;
var numDiggers = 2;
var temp;
var levelGraphics;
var levelMap;
levelMap = flash.display.BitmapData.loadBitmap("levelMap15");
levelBackground = flash.display.BitmapData.loadBitmap("factoryBackground");
temp = flash.display.BitmapData.loadBitmap("levelGraphics15");
levelGraphics = new flash.display.BitmapData(temp.width, temp.height, true, 0);
levelGraphics.copyPixels(temp, temp.rectangle, new flash.geom.Point(0, 0));
temp.dispose();
delete temp;
Symbol 766 MovieClip Frame 1
stop();
Symbol 775 MovieClip Frame 1
stop();
Symbol 778 MovieClip Frame 1
stop();
Symbol 799 MovieClip Frame 1
flashPlayer_btn.onRelease = function () {
getURL ("http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash", "_blank");
};
Symbol 812 MovieClip Frame 1
stop();
Symbol 820 MovieClip Frame 1
stop();
Symbol 824 MovieClip Frame 39
stop();
checkFlashVersion();
Symbol 824 MovieClip Frame 63
setOutro();
Symbol 824 MovieClip Frame 119
setEndingGraphics();
Symbol 824 MovieClip Frame 123
setEndingGraphics();
Symbol 824 MovieClip Frame 125
setEndingGraphics();
Symbol 824 MovieClip Frame 129
setEndingGraphics();
Symbol 824 MovieClip Frame 135
stop();
showNextSection();
Symbol 824 MovieClip Frame 157
stop();
showNextSection();
Symbol 834 MovieClip Frame 1
stop();
Symbol 837 MovieClip Frame 1
stop();
Symbol 952 MovieClip Frame 1
stop();
Symbol 955 MovieClip Frame 9
stop();
Symbol 955 MovieClip Frame 18
if (nextScreen == "sendFriend") {
sendFriend();
}
Symbol 955 MovieClip Frame 93
stop();
playGame();
Symbol 962 MovieClip Frame 1
stop();
Symbol 965 MovieClip Frame 1
stop();
Symbol 968 MovieClip Frame 1
stop();
Symbol 971 MovieClip Frame 1
stop();
Symbol 984 MovieClip Frame 1
stop();
Symbol 988 MovieClip Frame 9
stop();
initTextInput();
Symbol 988 MovieClip Frame 18
if (nextScreen == "instructions") {
instructions();
}
Symbol 988 MovieClip Frame 93
playGame();
Symbol 992 MovieClip Frame 1
stop();
Symbol 1009 MovieClip Frame 1
stop();
Symbol 1012 MovieClip Frame 1
stop();
Symbol 1015 MovieClip Frame 1
stop();
Symbol 1018 MovieClip Frame 1
stop();
Symbol 1021 MovieClip Frame 1
stop();
Symbol 1024 MovieClip Frame 1
stop();
Symbol 1027 MovieClip Frame 1
stop();
Symbol 1030 MovieClip Frame 1
stop();
Symbol 1033 MovieClip Frame 1
stop();
Symbol 1036 MovieClip Frame 1
stop();
Symbol 1039 MovieClip Frame 1
stop();
Symbol 1052 MovieClip Frame 1
stop();
Symbol 1053 MovieClip Frame 1
stop();
Symbol 1101 MovieClip Frame 1
stop();
Symbol 1104 MovieClip Frame 1
stop();
Symbol 1132 MovieClip Frame 1
stop();
Symbol 1177 MovieClip Frame 1
stop();
Symbol 1184 MovieClip Frame 1
stop();
Symbol 1186 MovieClip Frame 1
stop();
Symbol 1186 MovieClip Frame 21
stop();
setLogo();
Symbol 1186 MovieClip Frame 33
stop();
setLogo();
Symbol 1186 MovieClip Frame 45
stop();
Symbol 1195 MovieClip Frame 1
stop();
Symbol 1202 MovieClip Frame 1
stop();
Symbol 1202 MovieClip Frame 114
stop();
levelLoaderFinished();
Symbol 1207 MovieClip Frame 1
stop();
Symbol 1207 MovieClip Frame 11
(useHandCursor = false);
Symbol 1207 MovieClip Frame 36
stop();
loaderReady();
Symbol 1210 MovieClip Frame 1
stop();