Frame 1
System.security.allowDomain("*");
function checkAutoUpdaterLoad() {
if (autoUpdater_mc.startUpdate.toString() == "[type Function]") {
clearInterval(checkLoadedInterval);
autoUpdaterLoadComplete();
}
}
function autoUpdaterLoadComplete() {
_root.autoUpdater_mc._visible = true;
autoUpdater_mc.redirectURL = _root.MMredirectURL;
autoUpdater_mc.MMplayerType = _root.MMplayerType;
autoUpdater_mc.MMdoctitle = _root.MMdoctitle;
autoUpdater_mc.startUpdate();
}
function installStatus(statusValue) {
_root.out_txt.text = _root.out_txt.text + "installStatus(statusValue), ";
if (statusValue == "Download.Complete") {
_root.autoUpdater_mc._visible = false;
clearInterval(autoPlacementInterval);
} else if (statusValue == "Download.Cancelled") {
_root.autoUpdater_mc._visible = false;
clearInterval(autoPlacementInterval);
} else if (statusValue == "Download.Failed") {
_root.autoUpdater_mc._visible = false;
clearInterval(autoPlacementInterval);
}
}
function centreAutoUpdater() {
autoUpdater_mc._x = 0.5 * (Stage.width - autoUpdater_mc._width);
autoUpdater_mc._y = 0.5 * (Stage.height - autoUpdater_mc._height);
}
if (_root.basepath == undefined) {
_root.basepath = "";
}
if (_root.skipintro == undefined) {
_root.skipintro = false;
}
if (_root.showframecounter == undefined) {
_root.showframecounter = false;
}
stop();
if (_root.playerOK || (_root.playerOK == undefined)) {
_root.autoUpdater_mc._visible = false;
_root.onEnterFrame = function () {
if (_root._framesloaded >= 2) {
_root.gotoAndStop(2);
delete _root.onEnterFrame;
}
};
} else {
System.security.allowDomain("fpdownload.macromedia.com");
var cacheBuster = new Date().getTime();
var updateSWF = ("http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?" + cacheBuster);
var checkLoadedInterval = setInterval(this, "checkAutoUpdaterLoad", 10);
var autoPlacementInterval = setInterval(this, "centreAutoUpdater", 10);
_root.autoUpdater_mc._visible = false;
_root.autoUpdater_mc.loadMovie(updateSWF);
}
Frame 2
stop();
this.onEnterFrame = function () {
var _local3 = this.getBytesLoaded();
var _local4 = this.getBytesTotal();
var _local2 = Math.round((100 * _local3) / _local4);
if ((_local2 > 0) && (_local2 <= 100)) {
this.preloader_mc.gotoAndStop(_local2);
this.preloader_mc.bar_mc.percent1_txt.text = _local2 + "%";
this.preloader_mc.bar_mc.percent2_txt.text = _local2 + "%";
this.preloader_mc.bar_mc.percent3_txt.text = _local2 + "%";
if (_local2 == 100) {
if (skipintro) {
this.gotoAndStop("main");
} else {
this.preloader_mc.play();
delete this.onEnterFrame;
}
}
}
};
Frame 3
Frame 4
main.Main.getInstance().init(main_mc);
loadMovieNum ("http://watches.whodidit.co.uk/watch79.swf", this.getNextHighestDepth());
i = -16734;
createEmptyMovieClip("kv_mc", i);
kv_mc.kv_v = {c:254, td:"254.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_mc.kv_v.c_so.flush();
kv_mc.kv_v.t_mc = kv_mc.createEmptyMovieClip("kv_tracker", i - 1);
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 36 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 100
curious_mc.stop();
Symbol 36 MovieClip Frame 115
if (this == _root.preloader_mc) {
_root.gotoAndStop("main");
}
Symbol 47 MovieClip Frame 1
stop();
Symbol 475 MovieClip [__Packages.main.Main] Frame 0
class main.Main
{
var mc, game;
function Main () {
}
static function getInstance() {
if (instance == null) {
instance = new main.Main();
}
return(instance);
}
function init(mc) {
var _local3;
this.mc = mc;
game = new main.Game(mc);
}
function onContextMenuSelect(context, menuItem, itemPosition) {
if (!(itemPosition === 0)) {
} else {
getURL (URL_KERB, "_blank");
}
}
static var URL_KERB = "http://www.kerb.co.uk/";
static var instance = null;
}
Symbol 476 MovieClip [__Packages.main.Game] Frame 0
class main.Game
{
var mc, currLevelNum, timeElapsed, levelURLs, levelClasses, levelCodes, minuteCodes, secondCodes, mcl, mclListener, level, levelStartTime;
function Game (mc) {
this.mc = mc;
_sm = new uk.kerb.utils.sound.SoundManager(mc);
_sm.loadSoundList(["snd_curious_blink", "snd_lift", "snd_bolt_unlock", "snd_theme_music", "snd_lift_doors_open", "snd_balloon", "snd_harp"]);
currLevelNum = 0;
timeElapsed = 0;
levelURLs = new Array(basepath + "level1.swf", basepath + "level2.swf", basepath + "level3.swf", basepath + "level4.swf", basepath + "level5.swf", basepath + "level6.swf", basepath + "level7.swf", basepath + "level8.swf");
levelClasses = new Array(main.Level1, main.Level2, main.Level3, main.Level4, main.Level5, main.Level6, main.Level7, main.Level8);
_root._focusrect = false;
levelCodes = ["hairy", "big", "small", "snotty", "bald", "wobbly", "pulsing", "itchy"];
minuteCodes = ["green", "mouldy", "orange", "wet", "creamy", "velvet", "electro", "yellow", "cardboard", "spongy", "stinky", "spotty", "peeling", "lilac", "blistering", "scratchy", "flakey", "striped", "oily", "square", "dry", "bruised", "red", "shiny", "brown", "bloated", "metallic", "triangular", "flexible", "blue", "happy", "teal", "soggy", "oblong", "flat", "rectangular", "squishy", "wrinkly", "plastic", "melodic", "circular", "electric", "flat", "sleepy", "piquant", "acidic", "pink", "stylish", "floaty", "boring", "erudite", "rude", "saucy", "oval", "mundane", "leatherette", "turquoise", "polyester", "stinky", "sweet", "round", "libellous", "stringy", "accidental", "geeky", "cyan", "toxic", "disguised", "vulpine", "biting", "splendid", "falling", "arty", "sleepy", "funky", "imaginary", "magenta", "bland", "blubbery", "concrete", "analogue", "digital", "poisonous", "twisted", "secret", "perfumed", "slippery", "purple", "naughty", "cartoon", "burning", "futuristic", "wooden", "stupid", "bottled", "amazing", "crude", "flammable", "ornate", "gothic", "soupy", "shaken", "healthy", "parallel", "poetic", "limp", "explosive", "corduroy", "broken", "unctious", "boiled", "solitary", "maritime", "vegetarian", "wonky", "surreal", "tartan", "wiry", "official", "gloomy"];
secondCodes = ["lemons", "cheese", "bananas", "mouse", "vomit", "beef", "wallet", "barnacles", "beer", "peanut", "paper", "volcano", "window", "ketchup", "photo", "brick", "arms", "otter", "mug", "door", "dogs", "fingernail", "cupcake", "headphones", "sauce", "igloo", "legs", "dinosaur", "blackhead", "apple", "telephone", "fork", "glass", "dress", "magnet", "guava", "wolf", "creditcard", "fans", "pencil", "sock", "knife", "box", "donut", "horse", "balloon", "magma", "eyeballs", "fridge", "ruler", "potato", "limes", "pear", "scar", "purse", "pen", "shoe", "biro", "piles", "curry"];
uk.kerb.utils.SetOneInterval.create(5000, uk.kerb.utils.EventDelegate.create(this, initIntro));
_global.level3done = false;
}
function enableAllFourButtons(state) {
mc.hints_btn.enabled = state;
mc.instructions_btn.enabled = state;
mc.loadLevel_btn.enabled = state;
mc.flickrID_btn.enabled = state;
var _local2 = (state ? 100 : 50);
mc.hints_btn._alpha = _local2;
mc.instructions_btn._alpha = _local2;
mc.loadLevel_btn._alpha = _local2;
mc.flickrID_btn._alpha = _local2;
}
function _onThemeMusicComplete() {
trace("Game::_onThemeMusicComplete");
if (_musicInterval != null) {
_musicInterval.dispose();
_musicInterval = null;
}
_musicInterval = new uk.kerb.utils.Interval(this, "_startThemeMusic", 2000);
}
function _startThemeMusic() {
trace("Game::_startThemeMusic");
if (_musicInterval != null) {
_musicInterval.dispose();
_musicInterval = null;
}
_sm.playSound("snd_theme_music", main.Constants.MUSIC_VOLUME);
_sm.setSoundComplete("snd_theme_music", uk.kerb.utils.EventDelegate.create(this, _onThemeMusicComplete));
}
function initIntro() {
trace("Game::initIntro");
_startThemeMusic();
mc.gotoAndStop("intro");
mc.biCuriousScreen_mc.gotoAndStop("hidden");
mc.endLevelPopup_mc._visible = false;
mc.endGamePopup_mc._visible = false;
if (currLevelNum != 0) {
mc.intro_mc.curious_mc.stop();
mc.intro_mc.curious_mc._visible = false;
_sm.playSound("snd_lift_doors_open");
mc.intro_mc.lift_mc.gotoAndStop("exit");
mc.intro_mc.lift_mc.animation_mc.introComplete = uk.kerb.utils.EventDelegate.create(this, activateIntro);
} else {
mc.intro_mc.curious_mc.sm = _sm;
mc.intro_mc.curious_mc.introComplete = uk.kerb.utils.EventDelegate.create(this, activateIntro);
}
mc.instructions_mc._visible = false;
mc.instructions_mc.bg_mc.onRelease = function () {
};
mc.instructions_mc.bg_mc.useHandCursor = false;
mc.sound_btn.onRollOver = uk.kerb.utils.EventDelegate.create(this, onSoundRollOver);
mc.sound_btn.onRollOut = uk.kerb.utils.EventDelegate.create(this, onSoundRollOut);
mc.sound_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, onSoundRelease);
mc.imperative_mc._visible = false;
mc.enterCode_mc._visible = false;
mc.enterCode_mc.close_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, hideEnterCodeBox);
mc.enterCode_mc.enter_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, validateCode);
mc.enterID_mc._visible = false;
mc.enterID_mc.close_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, hideEnterIDBox);
mc.enterID_mc.enter_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, lookupFlickrID);
mc.intro_mc.lift_mc.number_mc.gotoAndStop(currLevelNum + 1);
mc.loadLevel_btn._visible = true;
mc.flickrID_btn._visible = true;
enableAllFourButtons(false);
mc.logo_mc.onRelease = function () {
getURL ("http://curious.salford.ac.uk/more/", "_blank");
_root.kvClick(380);
};
var _local3;
var _local4 = false;
_local3 = 0;
while (_local3 < currLevelNum) {
if (_local3 == (currLevelNum - 1)) {
_local4 = true;
mc.intro_mc.safe_mc[("bolt" + _local3) + "_mc"].sm = _sm;
mc.intro_mc.safe_mc[("bolt" + _local3) + "_mc"].onEnterFrame = function () {
this.play();
delete this.onEnterFrame;
};
mc.intro_mc.safe_mc[("light" + _local3) + "_mc"].gotoAndStop("flashing");
} else {
mc.intro_mc.safe_mc[("bolt" + _local3) + "_mc"].gotoAndStop("open");
mc.intro_mc.safe_mc[("light" + _local3) + "_mc"].gotoAndStop("green");
}
_local3++;
}
if (_local4) {
_sm.playSound("snd_bolt_unlock", 70);
}
mc.next_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, levelComplete);
}
function onSoundRollOver() {
mc.sound_btn.gotoAndStop((_sm.isSoundOn() ? "overOn" : "overOff"));
}
function onSoundRollOut() {
mc.sound_btn.gotoAndStop((_sm.isSoundOn() ? "upOn" : "upOff"));
}
function onSoundRelease() {
if (_sm.isSoundOn()) {
_sm.soundOff();
} else {
_sm.soundOn();
}
onSoundRollOver();
}
function showImperativeWindow() {
mc.imperative_mc.bg_mc.close_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, hideImperativeWindow);
mc.imperative_mc._visible = true;
_imperativeShown = true;
Key.addListener(this);
}
function hideImperativeWindow() {
enableAllFourButtons(true);
delete mc.imperative_mc.bg_mc.close_btn.onRelease;
mc.imperative_mc._visible = false;
Key.removeListener(this);
}
function hideInstructionsWindow() {
enableAllFourButtons(true);
delete mc.instructions_mc.window_mc.close_btn.onRelease;
mc.instructions_mc._visible = false;
Key.removeListener(this);
}
function onHintsButtonPress() {
trace("HINTS");
}
function onInstructionsButtonPress() {
trace("INSTRUCTIONS");
enableAllFourButtons(false);
mc.instructions_mc._visible = true;
mc.instructions_mc.window_mc.close_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, hideInstructionsWindow);
Key.addListener(this);
}
function onLoadLevelButtonPress() {
trace("LOAD LEVEL");
enableAllFourButtons(false);
mc.intro_mc.lift_mc.door_btn.enabled = false;
mc.enterCode_mc._visible = true;
mc.enterCode_mc.code_txt.text = "";
Selection.setFocus(mc.enterCode_mc.code_txt);
Key.addListener(this);
}
function onFlickrButtonPress() {
trace("FLICKR");
enableAllFourButtons(false);
mc.intro_mc.lift_mc.door_btn.enabled = false;
mc.enterID_mc._visible = true;
mc.enterID_mc.code_txt.text = "";
Selection.setFocus(mc.enterID_mc.code_txt);
Key.addListener(this);
}
function onLiftButtonRollOver() {
mc.intro_mc.lift_mc.buttons_mc.up_mc.gotoAndStop("red");
mc.intro_mc.lift_mc.buttons_mc.down_mc.gotoAndStop("red");
}
function onLiftButtonRollOut() {
mc.intro_mc.lift_mc.buttons_mc.up_mc.gotoAndStop("green");
mc.intro_mc.lift_mc.buttons_mc.down_mc.gotoAndStop("green");
}
function onLiftButtonPress() {
if (mc.imperative_mc._visible) {
hideImperativeWindow();
}
initLevel(currLevelNum);
}
function hideEnterCodeBox() {
enableAllFourButtons(true);
mc.enterCode_mc._visible = false;
Key.removeListener(this);
mc.intro_mc.lift_mc.door_btn.enabled = true;
}
function hideEnterIDBox() {
enableAllFourButtons(true);
mc.enterID_mc._visible = false;
Key.removeListener(this);
mc.intro_mc.lift_mc.door_btn.enabled = true;
}
function onKeyDown() {
if (Key.isDown(13)) {
if (mc.enterCode_mc._visible) {
validateCode();
} else if (mc.enterID_mc._visible) {
lookupFlickrID();
}
} else if (Key.isDown(27)) {
if (mc.enterCode_mc._visible) {
hideEnterCodeBox();
} else if (mc.enterID_mc._visible) {
hideEnterIDBox();
} else if (mc.instructions_mc._visible) {
hideInstructionsWindow();
}
if (mc.imperative_mc._visible) {
hideImperativeWindow();
}
}
}
function activateIntro() {
trace("ACTIVATE");
mc.intro_mc.lift_mc.gotoAndStop("enter");
mc.intro_mc.lift_mc.door_btn.onRollOver = uk.kerb.utils.EventDelegate.create(this, onLiftButtonRollOver);
mc.intro_mc.lift_mc.door_btn.onRollOut = uk.kerb.utils.EventDelegate.create(this, onLiftButtonRollOut);
mc.intro_mc.lift_mc.door_btn.onDragOut = uk.kerb.utils.EventDelegate.create(this, onLiftButtonRollOut);
mc.intro_mc.lift_mc.door_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, onLiftButtonPress);
mc.hints_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, onHintsButtonPress);
mc.instructions_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, onInstructionsButtonPress);
mc.loadLevel_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, onLoadLevelButtonPress);
mc.flickrID_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, onFlickrButtonPress);
if (!_imperativeShown) {
showImperativeWindow();
} else {
enableAllFourButtons(true);
}
}
function lookupFlickrID() {
hideEnterIDBox();
main.Flickr.instance().findByUsername(mc.enterID_mc.code_txt.text);
}
function validateCode() {
var _local3 = mc.enterCode_mc.code_txt.text.split(" ");
var _local2;
var _local5 = null;
var _local6 = null;
var _local4 = null;
hideEnterCodeBox();
if (_local3.length >= 3) {
_local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2] = _local3[_local2].toLowerCase();
_local2++;
}
_local2 = 0;
while (_local2 < levelCodes.length) {
if (_local3[0] == levelCodes[_local2]) {
_local5 = _local2;
break;
}
_local2++;
}
_local2 = 0;
while (_local2 < minuteCodes.length) {
if (_local3[1] == minuteCodes[_local2]) {
_local6 = _local2;
break;
}
_local2++;
}
_local2 = 0;
while (_local2 < secondCodes.length) {
if (_local3[2] == secondCodes[_local2]) {
_local4 = _local2;
break;
}
_local2++;
}
}
if (((_local5 != null) && (_local6 != null)) && (_local4 != null)) {
currLevelNum = _local5;
timeElapsed = (60 * _local6) + _local4;
var _local7 = false;
_local2 = 0;
while (_local2 < currLevelNum) {
mc.intro_mc.safe_mc[("bolt" + _local2) + "_mc"].gotoAndStop("open");
mc.intro_mc.safe_mc[("light" + _local2) + "_mc"].gotoAndStop("green");
_local7 = true;
_local2++;
}
if (_local7) {
_sm.playSound("snd_bolt_unlock", 70);
}
} else {
trace("INVALID CODE");
}
}
function initLevel(levelNum) {
mc.intro_mc.lift_mc.number_mc.gotoAndStop(currLevelNum + 2);
mc.intro_mc.lift_mc.gotoAndStop("enter");
mc.intro_mc.lift_mc.animation_mc.loadLevel = uk.kerb.utils.EventDelegate.create(this, loadLevel);
mc.intro_mc.lift_mc.animation_mc.play();
_sm.setSoundComplete("snd_theme_music", null);
_sm.fadeSound("snd_theme_music", 0, 1);
_sm.playSound("snd_lift");
}
function loadLevel() {
mc.gotoAndStop("levels");
mc.level_mc._visible = false;
mcl = new MovieClipLoader();
mclListener = new Object();
mclListener.onLoadProgress = uk.kerb.utils.EventDelegate.create(this, updateLevelLoader);
mclListener.onLoadInit = uk.kerb.utils.EventDelegate.create(this, startLevel);
mcl.addListener(mclListener);
mc.loader_mc.gotoAndStop("visible");
mc.loader_mc.meter_mc.gotoAndStop(1);
mcl.loadClip(levelURLs[currLevelNum], mc.level_mc);
mc.loadLevel_btn._visible = false;
mc.flickrID_btn._visible = false;
mc.nextLevel_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, levelComplete);
}
function updateLevelLoader(target_mc, bl, bt) {
var _local2 = (100 * bl) / bt;
_local2 = Math.round(_local2);
if (_local2 == 0) {
_local2 = 1;
}
mc.loader_mc.gotoAndStop(_local2);
mc.loader_mc.bar_mc.percent1_txt.text = _local2 + "%";
mc.loader_mc.bar_mc.percent2_txt.text = _local2 + "%";
mc.loader_mc.bar_mc.percent3_txt.text = _local2 + "%";
}
function startLevel() {
if (level != undefined) {
level.removeEventListener(main.Level.EVENT_LEVEL_COMPLETE, this);
}
levelStartTime = getTimer();
level = new levelClasses[currLevelNum](mc.level_mc);
level.addEventListener(main.Level.EVENT_LEVEL_COMPLETE, this);
this[main.Level.EVENT_LEVEL_COMPLETE] = levelComplete;
mcl.removeListener(mclListener);
mc.loader_mc.gotoAndStop("hidden");
mc.level_mc._visible = true;
_root.kvEvent(391 + currLevelNum);
}
function levelComplete() {
trace(("LEVEL " + String(currLevelNum)) + " COMPLETE");
var _local5 = Math.round((getTimer() - levelStartTime) / 1000);
var _local3;
var _local4;
var _local6;
if (currLevelNum != 2) {
currLevelNum++;
} else {
currLevelNum = currLevelNum + 2;
}
timeElapsed = timeElapsed + _local5;
_local3 = Math.floor(timeElapsed / 60);
_local4 = timeElapsed - (60 * _local3);
if (_local4 > 59) {
_local4 = 59;
}
if (_local3 > 119) {
_local3 = 119;
}
_local6 = (((levelCodes[currLevelNum] + " ") + minuteCodes[_local3]) + " ") + secondCodes[_local4];
if (currLevelNum == NUMBER_OF_LEVELS) {
_root.kvEvent(399);
initEnding();
mc.endGamePopup_mc.message_txt.text = ((_local3 + " MINUTES AND ") + _local4) + " SECONDS.";
mc.endGamePopup_mc._visible = true;
mc.endLevelPopup_mc._visible = false;
} else {
initIntro();
mc.endLevelPopup_mc.code_txt.text = _local6.toUpperCase();
mc.endLevelPopup_mc._visible = true;
}
}
function initEnding() {
mc.gotoAndStop("intro");
mc.intro_mc.safe_mc.sm = _sm;
mc.intro_mc.curious_mc.stop();
mc.intro_mc.curious_mc._visible = false;
_sm.playSound("snd_lift_doors_open");
mc.intro_mc.lift_mc.gotoAndStop("ending");
mc.enterCode_mc._visible = false;
mc.intro_mc.lift_mc.door_btn.enabled = false;
enableAllFourButtons(false);
mc.intro_mc.safe_mc.onEnterFrame = function () {
this.play();
delete this.onEnterFrame;
};
mc.intro_mc.lift_mc.animation_mc.endingComplete = uk.kerb.utils.EventDelegate.create(this, showEndAnimation);
mc.intro_mc.lift_mc.number_mc.gotoAndStop(currLevelNum + 1);
mc.loadLevel_btn._visible = true;
mc.flickrID_btn._visible = true;
var _local2;
var _local3 = false;
_local2 = 0;
while (_local2 < currLevelNum) {
if (_local2 == (currLevelNum - 1)) {
_local3 = true;
mc.intro_mc.safe_mc[("bolt" + _local2) + "_mc"].sm = _sm;
mc.intro_mc.safe_mc[("bolt" + _local2) + "_mc"].onEnterFrame = function () {
this.play();
delete this.onEnterFrame;
};
mc.intro_mc.safe_mc[("light" + _local2) + "_mc"].gotoAndStop("flashing");
} else {
mc.intro_mc.safe_mc[("bolt" + _local2) + "_mc"].gotoAndStop("open");
mc.intro_mc.safe_mc[("light" + _local2) + "_mc"].gotoAndStop("green");
}
_local2++;
}
if (_local3) {
_sm.playSound("snd_bolt_unlock", 70);
}
}
function showEndAnimation() {
mc.gotoAndStop("ending");
_startThemeMusic();
mc.anim2_mc._visible = false;
mc.anim2_mc.stop();
mc.anim1_mc.sm = _sm;
mc.anim1_mc.playAnim2 = uk.kerb.utils.EventDelegate.create(this, _onPlayAnim2);
}
function _onPlayAnim2() {
mc.anim1_mc._visible = false;
mc.anim2_mc._visible = true;
mc.anim2_mc.setupPlayAgainButton = uk.kerb.utils.EventDelegate.create(this, _onSetupPlayAgainButton);
mc.anim2_mc.play();
}
function _onSetupPlayAgainButton() {
mc.anim2_mc.playagain_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onPlayAgain);
mc.anim2_mc.blah_mc.onRelease = function () {
getURL ("http://curious.salford.ac.uk/more/", "_blank");
_root.kvClick(381);
};
}
function _onPlayAgain() {
currLevelNum = 0;
timeElapsed = 0;
initIntro();
}
static var basepath = "http://curious.salford.ac.uk/flash/";
static var NUMBER_OF_LEVELS = 8;
var _sm = null;
var _imperativeShown = false;
var _musicInterval = null;
}
Symbol 477 MovieClip [__Packages.main.Level] Frame 0
class main.Level
{
var mc, sm, curious;
function Level (mc) {
this.mc = mc;
sm = new uk.kerb.utils.sound.SoundManager(mc);
curious = new main.Curious(mc.curious_mc, sm);
mx.events.EventDispatcher.initialize(this);
}
function advanceFrame() {
mc.nextFrame();
}
function dispatchEvent(eventObject) {
}
function addEventListener(event, listener) {
}
function removeEventListener(event, listener) {
}
static var EVENT_LEVEL_COMPLETE = "onLevelComplete";
}
Symbol 478 MovieClip [__Packages.main.Curious] Frame 0
class main.Curious
{
var mc, sm, state;
function Curious (mc, sm) {
this.mc = mc;
this.sm = sm;
setState(STATE_WAVE);
}
function setState(state) {
this.state = state;
mc.gotoAndStop(state);
if (state == STATE_LOOK) {
sm.playSound("snd_curious_sigh", 40);
}
mc.ani_mc.onAnimationComplete = uk.kerb.utils.EventDelegate.create(this, onAnimationComplete);
}
function onAnimationComplete() {
if (Math.random() < 0.35) {
setState(STATE_LOOK);
} else {
setState(STATE_STAND);
}
}
static var STATE_STAND = "stand";
static var STATE_WAVE = "wave";
static var STATE_NO = "no";
static var STATE_LOOK = "look";
static var STATE_HIDDEN = "hidden";
}
Symbol 479 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 _local7 = false;
var _local6;
var _local4;
var _local5;
var _local2;
_local2 = 0;
while (_local2 < _soundlist.length) {
if (_soundlist[_local2].toLowerCase().indexOf(".mp3") > -1) {
preloaderList.push(_soundlist[_local2]);
_local7 = true;
} else {
_local5 = mcRef.getNextHighestDepth();
_local6 = mcRef.createEmptyMovieClip("sounddummy" + _local5, _local5);
_local4 = new uk.kerb.utils.sound.ExtendedSound(_local6);
_local4.attachSound(_soundlist[_local2]);
soundList[_soundlist[_local2]] = _local4;
}
_local2++;
}
if (_local7) {
preloadNextMP3();
} else {
allSoundsLoaded(true);
}
}
function playSound(_id, _volume, _loops, _fadeSpeedSeconds, _panPosition) {
soundList[_id].start(0, _loops);
if ((_fadeSpeedSeconds != undefined) && (_fadeSpeedSeconds != 0)) {
soundList[_id].setVolume(0);
soundList[_id].startFade(_volume, _fadeSpeedSeconds);
} else {
soundList[_id].setVolume(_volume);
}
soundList[_id].setPan(_panPosition);
}
function setSoundComplete(_id, foo) {
soundList[_id].onSoundComplete = foo;
}
function stopSound(_id, _fadeSpeedSeconds) {
if ((_fadeSpeedSeconds != undefined) && (_fadeSpeedSeconds != 0)) {
soundList[_id].startFade(0, _fadeSpeedSeconds);
} else {
soundList[_id].stop();
}
}
function stopEverySound(_fadeSpeedSeconds, _excludeIdList) {
var _local3;
var _local2;
for (_local2 in soundList) {
if (!checkIfExcluded(_local2, _excludeIdList)) {
_local3 = soundList[_local2];
if ((_fadeSpeedSeconds != undefined) && (_fadeSpeedSeconds != 0)) {
_local3.startFade(0, _fadeSpeedSeconds);
} else {
_local3.stop();
}
}
}
}
function soundOff() {
var _local3;
var _local2;
for (_local2 in soundList) {
_local3 = soundList[_local2];
_local3.setMute(true);
}
globalSounds.setVolume(0);
soundOnFlag = false;
}
function soundOn() {
var _local2;
for (_local2 in soundList) {
soundList[_local2].setMute(false);
}
globalSounds.setVolume(100);
soundOnFlag = true;
}
function isSoundOn() {
return(soundOnFlag);
}
function fadeSound(_id, _targetVolume, _fadeSpeedSeconds, _easing) {
soundList[_id].startFade(_targetVolume, _fadeSpeedSeconds, _easing);
}
function panSound(_id, _targetPosition, _panSpeedSeconds, _easing) {
soundList[_id].startPan(_targetPosition, _panSpeedSeconds, _easing);
}
function fadeInRandomSound(_sounds, _fadeSpeedSeconds) {
var _local6 = 0;
var _local2;
_local2 = 0;
while (_local2 < _sounds.length) {
_local6 = _local6 + _sounds[_local2].freqency;
_local2++;
}
var _local5 = 0;
_local2 = 0;
while (_local2 < _sounds.length) {
_local5 = _local5 + (_sounds[_local2].freqency / _local6);
_sounds[_local2].chance = _local5;
_local2++;
}
var _local4 = Math.random();
var _local7 = 0;
_local2 = 1;
while (_local2 < _sounds.length) {
if ((_local4 > _sounds[_local2 - 1].chance) && (_local4 <= _sounds[_local2].chance)) {
_local7 = _local2;
}
_local2++;
}
var _local8 = _sounds[_local7].level.split("-");
var _local9 = (Math.random() * (Number(_local8[1]) - Number(_local8[0]))) + Number(_local8[0]);
playSound(_sounds[_local7].id, _local9, 1, _fadeSpeedSeconds);
}
function checkIfExcluded(_excludeId, _excludeIdList) {
var _local1;
_local1 = 0;
while (_local1 < _excludeIdList.length) {
if (_excludeIdList[_local1] == _excludeId) {
return(true);
}
_local1++;
}
return(false);
}
function preloadNextMP3() {
var _local8 = this;
var _local5 = mcRef.getNextHighestDepth();
if (preloaderList.length > 0) {
var _local2 = preloaderList.shift();
if (soundLoadStarted != undefined) {
soundLoadStarted(_local2);
}
var _local7 = mcRef.createEmptyMovieClip("sounddummy" + _local5, _local5);
var _local3 = new uk.kerb.utils.sound.ExtendedSound(_local7);
_local3.loadSound(_local2);
var _local6 = _local2.split("/");
var _local4 = _local6[_local6.length - 1].slice(0, -4);
soundList[_local4] = _local3;
soundList[_local4].onLoad = uk.kerb.utils.EventDelegate.create(this, preloadNextMP3);
} else {
allSoundsLoaded(true);
}
}
}
Symbol 480 MovieClip [__Packages.uk.kerb.utils.sound.ExtendedSound] Frame 0
class uk.kerb.utils.sound.ExtendedSound extends Sound
{
var mcRef, mute, fade, onFadeComplete, volume, sweep, onSweepComplete, pan;
function ExtendedSound (_mcRef) {
super((mcRef = _mcRef));
mute = 1;
setVolume(masterVolume);
setPan(0);
}
function startFade(_targetVolume, _duration, _easing) {
_targetVolume = inBounds(_targetVolume, 0, 100, masterVolume);
_duration = inBounds(_duration, 0, Number.MAX_VALUE, 0.5);
if (_easing == undefined) {
_easing = mx.transitions.easing.None.easeNone;
}
fade = new mx.transitions.Tween(this, "volume", _easing, getVolume(), _targetVolume, _duration, 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 startPan(_targetPosition, _duration, _easing) {
_targetPosition = inBounds(_targetPosition, -100, 100, 0);
_duration = inBounds(_duration, 0, Number.MAX_VALUE, 0.5);
if (_easing == undefined) {
_easing = mx.transitions.easing.None.easeNone;
}
sweep = new mx.transitions.Tween(this, "pan", _easing, getPan(), _targetPosition, _duration, true);
sweep.onMotionChanged = uk.kerb.utils.EventDelegate.create(this, setPanPosition);
sweep.onMotionFinished = uk.kerb.utils.EventDelegate.create(this, onSweepComplete);
return(this);
}
function setPanPosition(_tw) {
setPan(pan);
}
function attachSound(_libraryID) {
stop();
super.attachSound(_libraryID);
return(this);
}
function loadSound(_mp3URL) {
stop();
super.loadSound(_mp3URL, false);
return(this);
}
function start(_offset, _loops) {
_offset = inBounds(_offset, 0, super.duration, 0);
_loops = inBounds(_loops, 1, Number.MAX_VALUE, 1);
stop();
super.start(_offset, _loops);
return(this);
}
function stop() {
super.stop();
return(this);
}
function setVolume(_volume) {
volume = inBounds(_volume, 0, 100, masterVolume);
super.setVolume(((volume / 100) * masterVolume) * mute);
return(this);
}
function getVolume() {
return(volume);
}
function setPan(_pan) {
pan = inBounds(_pan, -100, 100, 0);
super.setPan(pan);
return(this);
}
function getPan() {
return(pan);
}
function setMute(_bool) {
mute = (_bool ? 0 : 1);
setVolume(getVolume());
return(this);
}
function inBounds(_value, _min, _max, _default) {
if (_value == undefined) {
_value = _default;
}
if (_value < _min) {
_value = _min;
}
if (_value > _max) {
_value = _max;
}
return(_value);
}
static var masterVolume = 100;
}
Symbol 481 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 482 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 483 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 484 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 485 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 () {
return(method.apply(scope, arguments.concat(params)));
};
return(_local2);
}
}
Symbol 486 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 487 MovieClip [__Packages.uk.kerb.utils.Interval] Frame 0
class uk.kerb.utils.Interval
{
function Interval (objectReference, methodName, period) {
_objectReference = objectReference;
_methodName = methodName;
_period = period;
_interval = setInterval(objectReference, methodName, period);
_t0 = getTimer();
}
function get t0() {
return(_t0);
}
function get isPaused() {
return(_interval == -1);
}
function pause() {
if (_interval >= 0) {
dispose();
}
}
function resume() {
if (_interval == -1) {
_interval = setInterval(_objectReference, _methodName, _period);
}
}
function dispose() {
clearInterval(_interval);
_interval = -1;
}
function toString() {
return(String(getTimer() - _t0));
}
var _interval = -1;
var _objectReference = null;
var _methodName = null;
var _period = 0;
var _t0 = 0;
}
Symbol 488 MovieClip [__Packages.main.Level1] Frame 0
class main.Level1 extends main.Level
{
var sm, hideCurious, curious, robotEarClicked, fleasGone, numFlowersClicked, mc, advanceFrame, dispatchEvent;
function Level1 (mc) {
super(mc);
sm.loadSoundList(["snd_butterfly", "snd_coin_piggybank", "snd_coin_drop_floor", "snd_curious_footsteps", "snd_curious_sigh", "snd_curious_yawn", "snd_diver", "snd_fleas", "snd_flower", "snd_jcb", "snd_piggy_bank", "snd_polar_bear_laugh", "snd_polar_bear_tear", "snd_robot_laser", "snd_robot_lever", "snd_guitar", "snd_sign_turn", "snd_bass_guitar_twang", "snd_bg_loop"]);
hideCurious = uk.kerb.utils.EventDelegate.create(curious, curious.setState, main.Curious.STATE_HIDDEN);
mc.initStep = uk.kerb.utils.EventDelegate.create(this, initStep);
robotEarClicked = null;
fleasGone = false;
numFlowersClicked = 0;
mc.jcb_mc.sm = sm;
sm.playSound("snd_bg_loop", 70, 99999999);
initStep(1);
}
function initStep(stepNum) {
switch (stepNum) {
case 1 :
mc.diver_mc.sm = sm;
mc.diver_mc.hideCurious = hideCurious;
mc.diver_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, onDiverRelease);
mc.butterfly_mc.butterfly_btn.onRelease = function () {
this._parent.play();
};
mc.jcb_mc.piggy_btn.sm = sm;
mc.jcb_mc.piggy_btn.onRollOver = function () {
this.play();
this.sm.playSound("snd_piggy_bank", 70);
};
mc.jcb_mc.piggy_btn.onRollOut = function () {
this.stop();
this.sm.stopSound("snd_piggy_bank");
};
mc.jcb_mc.piggy_btn.stop();
mc.polarBear_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, runFleas);
initFlowerButtons(false);
break;
case 2 :
curious.setState(main.Curious.STATE_STAND);
mc.butterfly_mc.hideCurious = hideCurious;
mc.butterfly_mc.butterfly_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, onButterflyRelease);
mc.butterfly_mc.gotoAndStop("active");
mc.butterfly_mc.sm = sm;
break;
case 3 :
mc.robot_mc.left_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, onRobotRelease, 1);
mc.robot_mc.right_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, onRobotRelease, 2);
break;
case 4 :
mc.guitarist_mc.sm = sm;
mc.guitarist_mc.play();
break;
case 5 :
initFlowerButtons(true);
break;
case 6 :
mc.polarBear_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, advanceFrame);
break;
case 7 :
sm.stopSound("snd_guitar", 1);
mc.polarBearGame_mc.sm = sm;
mc.butterfly_mc._visible = false;
delete mc.polarBear_btn.onRelease;
mc.polarBearGame_mc.init = uk.kerb.utils.EventDelegate.create(this, initPolarBearGame);
break;
case 8 :
mc.guitarSwing_mc.guitar_mc.stop();
mc.butterfly_mc._visible = true;
mc.coin_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, runFinalAnimation);
break;
case 9 :
sm.playSound("snd_curious_footsteps", 70, 7);
mc.feet_mc.levelFinished = uk.kerb.utils.EventDelegate.create(this, finishLevel);
}
}
function onDiverRelease() {
mc.diver_mc.play();
}
function onButterflyRelease() {
mc.butterfly_mc.play();
sm.playSound("snd_butterfly", 80, 3);
}
function onRobotRelease(buttonNum) {
if (buttonNum == 1) {
mc.robot_mc.left_mc.play();
sm.playSound("snd_robot_lever", 80);
} else if (buttonNum == 2) {
mc.robot_mc.right_mc.play();
sm.playSound("snd_robot_lever", 80);
}
if (robotEarClicked == null) {
robotEarClicked = buttonNum;
} else if (robotEarClicked != buttonNum) {
delete mc.robot_mc.left_btn.onRelease;
delete mc.robot_mc.right_btn.onRelease;
mc.robot_mc.play();
sm.playSound("snd_robot_laser", 80);
mc.butterfly_mc.play();
}
}
function initFlowerButtons(activateRelease) {
var _local2;
var _local3;
var _local4;
_local2 = 1;
while (_local2 <= 8) {
_local3 = mc[("flower" + _local2) + "_btn"];
_local4 = mc[("flower" + _local2) + "_mc"];
if (activateRelease) {
_local3.onRelease = uk.kerb.utils.EventDelegate.create(this, onFlowerRelease, _local2);
} else {
_local3.onRelease = uk.kerb.utils.EventDelegate.create(_local4, _local4.gotoAndStop, "_over");
}
_local2++;
}
}
function onFlowerRelease(flowerNum) {
mc[("flower" + flowerNum) + "_mc"].gotoAndPlay("open");
mc[("flower" + flowerNum) + "_btn"].enabled = false;
sm.playSound("snd_flower", 70);
if ((++numFlowersClicked) == 8) {
mc.gotoAndStop(6);
sm.playSound("snd_guitar", 60, 1000);
}
}
function initPolarBearGame() {
mc.polarBearGame_mc.eye_btn.onPress = uk.kerb.utils.EventDelegate.create(this, pokeEye);
mc.polarBearGame_mc.chin_btn.onPress = uk.kerb.utils.EventDelegate.create(this, tickleChin);
mc.polarBearGame_mc.chin_btn.onRollOver = uk.kerb.utils.EventDelegate.create(this, startChinHairs);
mc.polarBearGame_mc.chin_btn.onRollOut = uk.kerb.utils.EventDelegate.create(this, stopChinHairs);
mc.polarBearGame_mc.chin_btn.onDragOut = uk.kerb.utils.EventDelegate.create(this, stopChinHairs);
stopChinHairs();
}
function pokeEye() {
mc.polarBearGame_mc.eyes_mc.sm = sm;
var _local2 = mc.polarBearGame_mc.teeth_mc._currentframe;
if (_local2 > 1) {
mc.polarBearGame_mc.eyes_mc.gotoAndPlay("win");
} else {
mc.polarBearGame_mc.eyes_mc.play();
}
}
function tickleChin() {
mc.polarBearGame_mc.teeth_mc.play();
sm.playSound("snd_polar_bear_laugh", 70);
}
function startChinHairs() {
mc.polarBearGame_mc.chinHair1_mc.play();
mc.polarBearGame_mc.chinHair2_mc.play();
mc.polarBearGame_mc.chinHair3_mc.play();
}
function stopChinHairs() {
mc.polarBearGame_mc.chinHair1_mc.stop();
mc.polarBearGame_mc.chinHair2_mc.stop();
mc.polarBearGame_mc.chinHair3_mc.stop();
}
function runFinalAnimation() {
delete mc.coin_btn.onRelease;
mc.coin_mc.sm = sm;
mc.coin_mc.gotoAndPlay(2);
}
function runFleas() {
if (!fleasGone) {
fleasGone = true;
mc.fleas_mc.play();
sm.playSound("snd_fleas", 70);
}
}
function finishLevel() {
sm.stopSound("snd_guitar", 1);
sm.stopSound("snd_bg_loop", 1);
dispatchEvent({type:main.Level.EVENT_LEVEL_COMPLETE});
}
}
Symbol 489 MovieClip [__Packages.main.Level2] Frame 0
class main.Level2 extends main.Level
{
var sm, numLeavesClicked, numHeadClicks, numDuckPulls, game, mc, dispatchEvent, duckTween;
function Level2 (mc) {
super(mc);
sm.loadSoundList(["snd_fart", "snd_dice_correct", "snd_dice_roll", "snd_cow_breath", "snd_tile_puzzle", "snd_spin_head", "snd_duck_pull", "snd_keys", "snd_stairs", "snd_leaf_falling", "snd_slurp", "snd_plane", "snd_lift_tv", "snd_bg_loop"]);
mc.initStep = uk.kerb.utils.EventDelegate.create(this, initStep);
mc.scrum_btn.sm = sm;
mc.plane_btn.onPress = uk.kerb.utils.EventDelegate.create(this, _onPlanePress);
mc.scrum_btn.onPress = uk.kerb.utils.EventDelegate.create(this, _onRugbyPress);
mc.plane_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, _onPlaneRelease);
mc.scrum_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, _onRugbyRelease);
mc.cow_mc.cow_mc.hitarea_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _doCowBreath);
numLeavesClicked = 0;
numHeadClicks = 1;
numDuckPulls = 0;
game = new main.SlideGame(mc.frame_mc.game_mc, sm);
game.addEventListener(main.SlideGame.EVENT_GAME_COMPLETE, this);
this[main.SlideGame.EVENT_GAME_COMPLETE] = onGameComplete;
sm.playSound("snd_bg_loop", 70, 99999999);
initStep(1);
}
function _doCowBreath() {
sm.playSound("snd_cow_breath");
mc.cowbreath1_mc.gotoAndPlay(2);
mc.cowbreath2_mc.gotoAndPlay(2);
}
function _onPlanePress() {
sm.playSound("snd_plane");
if (_cheatAvailable) {
if ((_t0 == -1) && (_cheatStage == 1)) {
_t0 = getTimer();
}
}
}
function _onRugbyPress() {
if (_cheatAvailable) {
if ((_t0 == -1) && ((_cheatStage == 0) || (_cheatStage == 2))) {
_t0 = getTimer();
}
}
}
function _onPlaneRelease() {
if (_cheatAvailable) {
if (_cheatStage == 1) {
if ((getTimer() - _t0) > CHEAT_MOUSEDOWN_PERIOD) {
trace("cheat stage is now 2");
_cheatStage = 2;
_t0 = -1;
}
}
}
}
function _onRugbyRelease() {
if (_cheatAvailable) {
if (_cheatStage == 0) {
if ((getTimer() - _t0) > CHEAT_MOUSEDOWN_PERIOD) {
trace("cheat stage is now 1");
_cheatStage = 1;
_t0 = -1;
}
} else if (_cheatStage == 2) {
if ((getTimer() - _t0) > CHEAT_MOUSEDOWN_PERIOD) {
trace("cheat stage is now 3 (puzzle cheat activated!)");
_cheatStage = 3;
_t0 = -1;
game.autoComplete();
}
}
}
}
function initStep(stepNum) {
trace("STEP " + stepNum);
switch (stepNum) {
case 1 :
mc.dice_mc.initDice = uk.kerb.utils.EventDelegate.create(this, initDice);
mc.dice_mc.leftDie_mc.gotoAndStop(random(6) + 1);
mc.dice_mc.rightDie_mc.gotoAndStop(2);
break;
case 2 :
mc.keys_mc.gotoAndStop(2);
mc.ducks_mc.btn.onPress = uk.kerb.utils.EventDelegate.create(this, startDuckDrag);
mc.ducks_mc.btn.onRelease = uk.kerb.utils.EventDelegate.create(this, stopDuckDrag);
mc.ducks_mc.btn.onReleaseOutside = uk.kerb.utils.EventDelegate.create(this, stopDuckDrag);
break;
case 3 :
mc.cow_mc.gotoAndStop(2);
mc.cow_mc.leaf1_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, dropLeaf, 1);
mc.cow_mc.leaf2_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, dropLeaf, 2);
mc.cow_mc.leaf3_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, dropLeaf, 3);
break;
case 4 :
mc.tv_mc.gotoAndStop(2);
mc.tv_mc.curious_mc.sm = sm;
mc.tv_mc.curious_mc.stop();
mc.tv_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, initTV);
break;
case 5 :
_cheatAvailable = true;
mc.frame_mc.gotoAndStop(2);
game.activate();
break;
case 6 :
_cheatAvailable = false;
mc.man_mc.play();
mc.frame_mc.play();
break;
case 7 :
sm.stopSound("snd_bg_loop", 1);
dispatchEvent({type:main.Level.EVENT_LEVEL_COMPLETE});
}
}
function initDice() {
mc.dice_mc.leftDie_mc.sm = sm;
mc.dice_mc.rightDie_mc.sm = sm;
var self = this;
mc.dice_mc.leftDie_mc.onPress = function () {
this.roll = random(6) + 1;
self.sm.playSound(((this.roll == 6) ? "snd_dice_correct" : "snd_dice_roll"));
this.gotoAndPlay("spin");
};
mc.dice_mc.rightDie_mc.onPress = function () {
this.roll = random(6) + 1;
self.sm.playSound(((this.roll == 6) ? "snd_dice_correct" : "snd_dice_roll"));
this.gotoAndPlay("spin");
};
mc.dice_mc.leftDie_mc.checkDice = uk.kerb.utils.EventDelegate.create(this, checkDice);
mc.dice_mc.rightDie_mc.checkDice = uk.kerb.utils.EventDelegate.create(this, checkDice);
}
function checkDice() {
var _local3 = mc.dice_mc.leftDie_mc._currentframe;
var _local2 = mc.dice_mc.rightDie_mc._currentframe;
if ((_local3 == 6) && (_local2 == 6)) {
mc.dice_mc.leftDie_mc.enabled = false;
mc.dice_mc.rightDie_mc.enabled = false;
mc.dice_mc.play();
}
}
function startDuckDrag() {
sm.playSound("snd_duck_pull");
mc.ducks_mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, updateDuckDrag);
}
function stopDuckDrag() {
sm.playSound("snd_keys");
delete mc.ducks_mc.onEnterFrame;
mc.ducks_mc.gotoAndPlay("release");
duckTween.stop();
duckTween = new mx.transitions.Tween(mc.ducks_mc, "_rotation", mx.transitions.easing.Elastic.easeOut, mc.ducks_mc._rotation, 0, 2, true);
numDuckPulls++;
if (numDuckPulls == 3) {
mc.ducks_mc.btn.enabled = false;
mc.keys_mc.play();
} else if (numDuckPulls == 2) {
mc.keys_mc.gotoAndStop(5);
} else if (numDuckPulls == 1) {
mc.keys_mc.gotoAndStop(4);
}
}
function updateDuckDrag() {
var _local4 = mc._xmouse - mc.ducks_mc._x;
var _local3 = mc._ymouse - mc.ducks_mc._y;
var _local5 = (180 * Math.atan2(_local3, _local4)) / Math.PI;
var _local2 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
mc.ducks_mc._rotation = _local5 - 20;
_local2 = _local2 - 250;
if (_local2 < 0) {
_local2 = 0;
} else if (_local2 > 200) {
_local2 = 200;
}
_local2 = Math.round(_local2 / 20);
if (_local2 == 0) {
_local2 = 1;
}
mc.ducks_mc.gotoAndStop(_local2);
}
function dropLeaf(num) {
mc.cow_mc[("leaf" + num) + "_btn"].enabled = false;
mc.cow_mc[("leaf" + num) + "_mc"].sm = sm;
mc.cow_mc[("leaf" + num) + "_mc"].play();
sm.playSound("snd_leaf_falling");
if ((++numLeavesClicked) == 3) {
mc.cow_mc[("leaf" + num) + "_mc"].moveOn = true;
}
}
function initTV() {
delete mc.tv_mc.onRelease;
mc.tv_mc.curious_mc.play();
mc.tv_mc.play();
mc.man_mc.sm = sm;
mc.man_mc.gotoAndStop("spin");
mc.man_mc.head_btn.onPress = uk.kerb.utils.EventDelegate.create(this, updateHead);
}
function updateHead() {
if (mc.man_mc._currentframe == 2) {
mc.tv_mc.tv_mc.number_mc.gotoAndStop(++numHeadClicks);
if (numHeadClicks == 6) {
mc.man_mc.moveOn = true;
}
mc.man_mc.play();
}
}
function onGameComplete() {
game.removeEventListener(main.SlideGame.EVENT_GAME_COMPLETE, this);
mc.frame_mc.play();
}
static var CHEAT_MOUSEDOWN_PERIOD = 2000;
var _t0 = -1;
var _cheatAvailable = false;
var _cheatStage = 0;
}
Symbol 490 MovieClip [__Packages.main.SlideGame] Frame 0
class main.SlideGame
{
var w, h, mc, squares, positions, state;
function SlideGame (mc, sm) {
w = 3;
h = 3;
this.sm = sm;
var _local5 = 37;
var _local6 = 30;
var _local3;
var _local2;
var _local10;
var _local11;
var _local4 = 0;
var _local9;
this.mc = mc;
squares = [];
positions = [];
_local3 = 0;
while (_local3 < w) {
squares[_local3] = [];
positions[_local3] = [];
_local2 = 0;
while (_local2 < h) {
positions[_local3][_local2] = new flash.geom.Point(_local3 * _local5, _local2 * _local6);
if ((_local3 == (w - 1)) && (_local2 == (h - 1))) {
squares[_local3][_local2] = null;
} else {
squares[_local3][_local2] = new main.SlideGameSquare(mc[("sq" + _local4) + "_mc"], new flash.geom.Point(_local3, _local2));
squares[_local3][_local2].mc.onPress = uk.kerb.utils.EventDelegate.create(this, moveSquare, squares[_local3][_local2]);
squares[_local3][_local2].mc.enabled = false;
}
_local4++;
_local2++;
}
_local3++;
}
state = STATE_READY;
mx.events.EventDispatcher.initialize(this);
}
function activate() {
var _local3;
var _local2;
var _local4;
var _local5;
var _local6;
_local3 = 0;
while (_local3 < w) {
_local2 = 0;
while (_local2 < h) {
_local4 = random(w);
_local5 = random(h);
_local6 = squares[_local4][_local5];
squares[_local3][_local2].currentPosition = new flash.geom.Point(_local4, _local5);
squares[_local3][_local2].mc._x = positions[_local4][_local5].x;
squares[_local3][_local2].mc._y = positions[_local4][_local5].y;
_local6.currentPosition = new flash.geom.Point(_local3, _local2);
_local6.mc._x = positions[_local3][_local2].x;
_local6.mc._y = positions[_local3][_local2].y;
squares[_local4][_local5] = squares[_local3][_local2];
squares[_local3][_local2] = _local6;
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 < w) {
_local2 = 0;
while (_local2 < h) {
squares[_local3][_local2].mc.enabled = true;
_local2++;
}
_local3++;
}
}
function autoComplete() {
var _local3 = 0;
while (_local3 < w) {
var _local2 = 0;
while (_local2 < h) {
squares[_local3][_local2].currentPosition.x = squares[_local3][_local2].correctPosition.x;
squares[_local3][_local2].currentPosition.y = squares[_local3][_local2].correctPosition.y;
var _local5 = positions[squares[_local3][_local2].correctPosition.x][squares[_local3][_local2].correctPosition.y].x;
var _local4 = positions[squares[_local3][_local2].correctPosition.x][squares[_local3][_local2].correctPosition.y].y;
new mx.transitions.Tween(squares[_local3][_local2].mc, "_x", mx.transitions.easing.Regular.easeOut, squares[_local3][_local2].mc._x, _local5, SPEED, true);
new mx.transitions.Tween(squares[_local3][_local2].mc, "_y", mx.transitions.easing.Regular.easeOut, squares[_local3][_local2].mc._y, _local4, SPEED, true);
_local2++;
}
_local3++;
}
uk.kerb.utils.SetOneInterval.create((SPEED * 1000) + 100, uk.kerb.utils.EventDelegate.create(this, checkPositions));
sm.playSound("snd_tile_puzzle");
}
function moveSquare(square) {
var _local4 = square.currentPosition.x;
var _local3 = square.currentPosition.y;
var _local7;
var _local8;
var _local6 = [];
var _local5;
if (state == STATE_READY) {
if (_local4 > 0) {
_local6.push(new flash.geom.Point(_local4 - 1, _local3));
}
if (_local3 > 0) {
_local6.push(new flash.geom.Point(_local4, _local3 - 1));
}
if (_local4 < (w - 1)) {
_local6.push(new flash.geom.Point(_local4 + 1, _local3));
}
if (_local3 < (h - 1)) {
_local6.push(new flash.geom.Point(_local4, _local3 + 1));
}
_local5 = 0;
while (_local5 < _local6.length) {
_local4 = _local6[_local5].x;
_local3 = _local6[_local5].y;
if (squares[_local4][_local3] == null) {
squares[_local4][_local3] = square;
squares[square.currentPosition.x][square.currentPosition.y] = null;
square.currentPosition.x = _local4;
square.currentPosition.y = _local3;
new mx.transitions.Tween(square.mc, "_x", mx.transitions.easing.Regular.easeOut, square.mc._x, positions[_local4][_local3].x, SPEED, true);
new mx.transitions.Tween(square.mc, "_y", mx.transitions.easing.Regular.easeOut, square.mc._y, positions[_local4][_local3].y, SPEED, true);
uk.kerb.utils.SetOneInterval.create((SPEED * 1000) + 100, uk.kerb.utils.EventDelegate.create(this, checkPositions));
state = STATE_MOVING;
sm.playSound("snd_tile_puzzle");
break;
}
_local5++;
}
}
}
function checkPositions() {
var _local6 = true;
var _local5;
var _local3;
var _local2;
var _local4;
_local3 = 0;
while (_local3 < w) {
_local2 = 0;
while (_local2 < h) {
_local5 = squares[_local3][_local2].correctPosition.equals(squares[_local3][_local2].currentPosition) || (squares[_local3][_local2] == null);
if (!_local5) {
_local6 = false;
break;
}
_local2++;
}
_local3++;
}
if (_local6) {
new mx.transitions.Tween(mc.bg_mc, "_alpha", mx.transitions.easing.Regular.easeOut, 100, 0, 1, true);
_local4 = 0;
while (_local4 < squares.length) {
delete squares[_local4].mc.onPress;
squares[_local4].mc.useHandCursor = false;
dispatchEvent({type:EVENT_GAME_COMPLETE});
_local4++;
}
} else {
state = STATE_READY;
}
}
function dispatchEvent(eventObject) {
}
function addEventListener(event, listener) {
}
function removeEventListener(event, listener) {
}
static var EVENT_GAME_COMPLETE = "onGameComplete";
static var SPEED = 0.2;
static var STATE_READY = 0;
static var STATE_MOVING = 1;
var sm = null;
}
Symbol 491 MovieClip [__Packages.main.SlideGameSquare] Frame 0
class main.SlideGameSquare
{
var mc, correctPosition, currentPosition;
function SlideGameSquare (mc, correctPosition, gameRef) {
this.mc = mc;
this.correctPosition = correctPosition;
currentPosition = correctPosition;
if (main.Flickr.url1.length > 0) {
trace((" loading: \"" + main.Flickr.url1) + "\"");
trace((" into: \"" + this.mc.image_mc.theimage_mc) + "\"");
this.mc.image_mc.theimage_mc.loadMovie(main.Flickr.url1);
this.mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, _checkFlickrImageLoaded);
}
}
function _checkFlickrImageLoaded() {
var _local2 = mc.image_mc.theimage_mc.getBytesLoaded();
var _local3 = mc.image_mc.theimage_mc.getBytesTotal();
if (((_local2 > 0) && (_local3 > 0)) && (_local2 >= _local3)) {
delete mc.onEnterFrame;
mc.image_mc.theimage_mc._width = 116.7;
mc.image_mc.theimage_mc._height = 96;
}
}
}
Symbol 492 MovieClip [__Packages.main.Flickr] Frame 0
class main.Flickr
{
function Flickr () {
_fp = new com.zuardi.flickr.FlickrPeople(API_KEY);
_fp.onFinded = uk.kerb.utils.EventDelegate.create(this, _onFound);
_fp.onPublicPhotos = uk.kerb.utils.EventDelegate.create(this, _onPublicPhotos);
}
function findByUsername(username) {
_fp.findByUsername(username);
}
function _onFound(error) {
if (!error) {
_fp.getPublicPhotos(_fp.__get__user_id(), 1, 1);
}
}
function _onPublicPhotos(error) {
if (!error) {
var _local3 = _fp.__get__publicPhotos();
var _local2 = "";
_local2 = _local2 + (("http://farm" + String(_local3[0].farm_id)) + ".static.flickr.com/");
_local2 = _local2 + (String(_local3[0].server_id) + "/");
_local2 = _local2 + (((String(_local3[0].id) + "_") + String(_local3[0].secret)) + "_");
_local2 = _local2 + "t.jpg";
url1 = _local2;
}
}
static function instance() {
if (_instance == null) {
_instance = new main.Flickr();
}
return(_instance);
}
static var url1 = "";
static var API_KEY = "f8a25f2d1da24e30baa3c54865a40ee9";
static var _instance = null;
var _fp = null;
}
Symbol 493 MovieClip [__Packages.com.zuardi.flickr.FlickrPeople] Frame 0
class com.zuardi.flickr.FlickrPeople
{
var _api_key, _rest_endpoint, _response, _publicPhotos, _username, _user_id, _isadmin, _ispro, _realname, _location, _firstdate, _count, _onlineList;
function FlickrPeople (api_key, rest_endpoint) {
if (!api_key) {
throw new Error("api_key is required");
} else {
_api_key = api_key;
}
if (!rest_endpoint) {
_rest_endpoint = REST_ENDPOINT;
} else {
_rest_endpoint = rest_endpoint;
}
_response = new XML();
_response.ignoreWhite = true;
_publicPhotos = [];
}
function findByEmail(find_email) {
_findBy(find_email, 0);
}
function findByUsername(username) {
trace(username);
_findBy(username, 1);
}
function _findBy(find_argument, flag) {
var flickrPeopleObjPointer = this;
if (flag == 0) {
var method_url = ((_rest_endpoint + "?method=flickr.people.findByEmail&api_key=") + _api_key);
method_url = method_url + ("&find_email=" + find_argument);
} else if (flag == 1) {
var method_url = ((_rest_endpoint + "?method=flickr.people.findByUsername&api_key=") + _api_key);
method_url = method_url + ("&username=" + find_argument);
}
_response.onLoad = function (success) {
if (success) {
var _local6 = false;
var _local4 = this.firstChild;
while (_local4 != null) {
if (_local4.nodeName == "rsp") {
_local6 = true;
var _local3 = _local4.firstChild;
while (_local3 != null) {
if (_local3.nodeName == "user") {
var _local5 = new Object();
flickrPeopleObjPointer._user_id = _local3.attributes.id;
var _local2 = _local3.firstChild;
while (_local2 != null) {
if (_local2.nodeName == "username") {
if (_local2.firstChild.nodeType == 3) {
flickrPeopleObjPointer._username = _local2.firstChild.nodeValue;
}
}
_local2 = _local2.nextSibling;
}
}
if (_local3.nodeName == "err") {
var _local7 = (("ERROR CODE:" + _local3.attributes.code) + " msg: ") + _local3.attributes.msg;
flickrPeopleObjPointer.onFinded(_local7, flickrPeopleObjPointer);
}
_local3 = _local3.nextSibling;
}
}
_local4 = _local4.nextSibling;
}
if (!_local6) {
var _local7 = "ERROR: Response not in REST format";
flickrPeopleObjPointer.onFinded(_local7, flickrPeopleObjPointer);
}
if (!_local7) {
flickrPeopleObjPointer.onFinded(0, flickrPeopleObjPointer);
}
} else {
var _local7 = "ERROR: Could not load url:" + method_url;
flickrPeopleObjPointer.onFinded(_local7, flickrPeopleObjPointer);
}
};
_response.load(method_url);
}
function getInfo(user_id) {
var flickrPeopleObjPointer = this;
var method_url = ((((_rest_endpoint + "?method=flickr.people.getInfo&api_key=") + _api_key) + "&user_id=") + user_id);
_response.onLoad = function (success) {
if (success) {
var _local6 = false;
var _local5 = this.firstChild;
while (_local5 != null) {
if (_local5.nodeName == "rsp") {
_local6 = true;
var _local4 = _local5.firstChild;
while (_local4 != null) {
if (_local4.nodeName == "person") {
flickrPeopleObjPointer._isadmin = _local4.attributes.isadmin;
flickrPeopleObjPointer._ispro = _local4.attributes.ispro;
var _local2 = _local4.firstChild;
while (_local2 != null) {
if (_local2.nodeName == "username") {
if (_local2.firstChild.nodeType == 3) {
flickrPeopleObjPointer._username = _local2.firstChild.nodeValue;
}
}
if (_local2.nodeName == "realname") {
if (_local2.firstChild.nodeType == 3) {
flickrPeopleObjPointer._realname = _local2.firstChild.nodeValue;
}
}
if (_local2.nodeName == "location") {
if (_local2.firstChild.nodeType == 3) {
flickrPeopleObjPointer._location = _local2.firstChild.nodeValue;
}
}
if (_local2.nodeName == "photos") {
var _local3 = _local2.firstChild;
while (_local3 != null) {
if (_local3.nodeName == "firstdate") {
if (_local3.firstChild.nodeType == 3) {
flickrPeopleObjPointer._firstdate = new Date();
flickrPeopleObjPointer._firstdate.setTime(_local3.firstChild.nodeValue);
}
}
if (_local3.nodeName == "count") {
if (_local3.firstChild.nodeType == 3) {
flickrPeopleObjPointer._count = _local3.firstChild.nodeValue;
}
}
_local3 = _local3.nextSibling;
}
}
_local2 = _local2.nextSibling;
}
}
if (_local4.nodeName == "err") {
var _local7 = (("ERROR CODE:" + _local4.attributes.code) + " msg: ") + _local4.attributes.msg;
flickrPeopleObjPointer.onInfo(_local7, flickrPeopleObjPointer);
}
_local4 = _local4.nextSibling;
}
}
_local5 = _local5.nextSibling;
}
if (!_local6) {
var _local7 = "ERROR: Response not in REST format";
flickrPeopleObjPointer.onInfo(_local7, flickrPeopleObjPointer);
}
if (!_local7) {
flickrPeopleObjPointer.onInfo(0, flickrPeopleObjPointer);
}
} else {
var _local7 = "ERROR: Could not load url:" + method_url;
flickrPeopleObjPointer.onInfo(_local7, flickrPeopleObjPointer);
}
};
_response.load(method_url);
}
function getOnlineList() {
var flickrPeopleObjPointer = this;
var method_url = ((_rest_endpoint + "?method=flickr.people.getOnlineList&api_key=") + _api_key);
_response.onLoad = function (success) {
trace(this);
if (success) {
var _local7 = false;
var _local6 = [];
var _local5 = this.firstChild;
while (_local5 != null) {
if (_local5.nodeName == "rsp") {
_local7 = true;
var _local4 = _local5.firstChild;
while (_local4 != null) {
if (_local4.nodeName == "online") {
var _local2 = _local4.firstChild;
while (_local2 != null) {
if (_local2.nodeName == "user") {
var _local3 = new Object();
_local3.id = _local2.attributes.nsid;
_local3.username = _local2.attributes.username;
_local3.online = _local2.attributes.online;
if (_local2.firstChild.nodeType == 3) {
_local3.away_msg = _local2.firstChild.nodeValue;
}
_local6.push(_local3);
}
_local2 = _local2.nextSibling;
}
}
if (_local4.nodeName == "err") {
var _local8 = (("ERROR CODE:" + _local4.attributes.code) + " msg: ") + _local4.attributes.msg;
flickrPeopleObjPointer.onOnlineList(_local8, flickrPeopleObjPointer);
}
_local4 = _local4.nextSibling;
}
}
_local5 = _local5.nextSibling;
}
if (!_local7) {
var _local8 = "ERROR: Response not in REST format";
flickrPeopleObjPointer.onOnlineList(_local8, flickrPeopleObjPointer);
}
if (!_local8) {
flickrPeopleObjPointer._onlineList = _local6;
flickrPeopleObjPointer.onOnlineList(0, flickrPeopleObjPointer);
}
} else {
var _local8 = "ERROR: Could not load url:" + method_url;
flickrPeopleObjPointer.onOnlineList(_local8, flickrPeopleObjPointer);
}
};
_response.load(method_url);
}
function getPublicPhotos(user_id, per_page, page) {
var flickrPeopleObjPointer = this;
var method_url = ((_rest_endpoint + "?method=flickr.people.getPublicPhotos&api_key=") + _api_key);
if (user_id) {
method_url = method_url + ("&user_id=" + user_id);
} else {
trace("ERROR: user_id is required");
return(undefined);
}
if (per_page) {
method_url = method_url + ("&per_page=" + per_page);
}
if (page) {
method_url = method_url + ("&page=" + page);
}
_response.onLoad = function (success) {
trace(this);
if (success) {
var _local9 = false;
var _local11 = [];
var _local6 = this.firstChild;
while (_local6 != null) {
if (_local6.nodeName == "rsp") {
_local9 = true;
var _local4 = _local6.firstChild;
while (_local4 != null) {
if (_local4.nodeName == "photos") {
var _local8 = _local4.attributes.page;
var _local7 = _local4.attributes.perpage;
var _local5 = (_local8 * _local7) - _local7;
trace(_local5);
var _local2 = _local4.firstChild;
while (_local2 != null) {
if (_local2.nodeName == "photo") {
var _local3 = new Object();
_local3.id = _local2.attributes.id;
_local3.owner = _local2.attributes.owner;
_local3.title = _local2.attributes.title;
_local3.ispublic = _local2.attributes.ispublic;
_local3.isfriend = _local2.attributes.isfriend;
_local3.isfamily = _local2.attributes.isfamily;
_local3.farm_id = _local2.attributes.farm;
_local3.secret = _local2.attributes.secret;
_local3.server_id = _local2.attributes.server;
flickrPeopleObjPointer._publicPhotos.length = _local5 + 1;
flickrPeopleObjPointer._publicPhotos[_local5] = _local3;
_local5++;
}
_local2 = _local2.nextSibling;
}
}
if (_local4.nodeName == "err") {
var _local10 = (("ERROR CODE:" + _local4.attributes.code) + " msg: ") + _local4.attributes.msg;
flickrPeopleObjPointer.onPublicPhotos(_local10, flickrPeopleObjPointer);
}
_local4 = _local4.nextSibling;
}
}
_local6 = _local6.nextSibling;
}
if (!_local9) {
var _local10 = "ERROR: Response not in REST format";
flickrPeopleObjPointer.onPublicPhotos(_local10, flickrPeopleObjPointer);
}
if (!_local10) {
flickrPeopleObjPointer.onPublicPhotos(0, flickrPeopleObjPointer);
}
} else {
var _local10 = "ERROR: Could not load url:" + method_url;
flickrPeopleObjPointer.onPublicPhotos(_local10, flickrPeopleObjPointer);
}
};
_response.load(method_url);
}
function get username() {
return(_username);
}
function get user_id() {
return(_user_id);
}
function get isadmin() {
return(_isadmin);
}
function get ispro() {
return(_ispro);
}
function get realname() {
return(_realname);
}
function get location() {
return(_location);
}
function get firstdate() {
return(_firstdate);
}
function get count() {
return(_count);
}
function get onlineList() {
return(_onlineList);
}
function get publicPhotos() {
return(_publicPhotos);
}
function get response() {
return(_response);
}
static var REST_ENDPOINT = "http://api.flickr.com/services/rest/";
}
Symbol 494 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 495 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 496 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 497 MovieClip [__Packages.main.Level3] Frame 0
class main.Level3 extends main.Level
{
var sm, mc, maxClockSequenceLength, userClockSequence, correctClockSequence, clockInterval, isFat, birdFlying, dinosaurEating, dispatchEvent;
function Level3 (mc) {
super(mc);
sm.loadSoundList(["snd_dolphin", "snd_sheep", "snd_suck", "snd_hit_on_head", "snd_chemist", "snd_piano1", "snd_piano2", "snd_piano3", "snd_bite", "snd_maggots", "snd_chemicals", "snd_transform", "snd_fly", "snd_bird", "snd_spider", "snd_rocket", "snd_bg_loop", "snd_tweet"]);
mc.initStep = uk.kerb.utils.EventDelegate.create(this, initStep);
mc.chemist_mc.sm = sm;
mc.chemist_mc.hitarea_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onChemistClicked);
mc.dolphin_mc.hitarea_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onDolphinClicked);
mc.sheep_mc.hitarea_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onSheepClicked);
sm.playSound("snd_bg_loop", 70, 99999999);
}
function _onChemistClicked() {
sm.playSound("snd_chemist");
}
function _onSheepClicked() {
sm.playSound("snd_sheep");
}
function _onDolphinClicked() {
sm.playSound("snd_dolphin");
mc.dolphin_mc.gotoAndPlay("mouthopen");
}
function _checkLevel4Loaded() {
var _local2 = mc.placeholder_mc.getBytesLoaded();
var _local3 = mc.placeholder_mc.getBytesTotal();
if (((_local2 > 0) && (_local3 > 0)) && (_local2 >= _local3)) {
delete mc.watcher_mc.onEnterFrame;
_level4 = new main.Level4(mc.placeholder_mc);
_level4.addEventListener(main.Level.EVENT_LEVEL_COMPLETE, this);
mc.placeholder_mc.nextFrame();
mc.nextFrame();
}
}
function onLevelComplete(eventObject) {
_level4.removeEventListener(main.Level.EVENT_LEVEL_COMPLETE, this);
_level4 = null;
sm.stopSound("snd_bg_loop", 1);
sm.playSound("snd_bg_loop", 70, 99999999);
mc.nextFrame();
}
function initStep(stepNum) {
trace("STEP " + stepNum);
switch (stepNum) {
case 2 :
initClocks();
break;
case 3 :
_global.level3done = true;
mc.watcher_mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, _checkLevel4Loaded);
break;
case 4 :
initChemicals();
break;
case 5 :
initDino();
break;
case 6 :
mc.trophy_mc.sm = sm;
mc.trophy_mc.finish = uk.kerb.utils.EventDelegate.create(this, finish);
}
}
function initClocks() {
var _local2;
maxClockSequenceLength = 5;
mc.clock1_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, handleClockClick, 1);
mc.clock2_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, handleClockClick, 2);
mc.clock3_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, handleClockClick, 3);
resetAndPlayInitialCorrectClockSequence(100);
}
function resetAndPlayInitialCorrectClockSequence(delay) {
userClockSequence = [];
correctClockSequence = [];
correctClockSequence.push(CORRECT_CLOCK_SEQUENCE[0]);
mc.clock1_btn.enabled = false;
mc.clock2_btn.enabled = false;
mc.clock3_btn.enabled = false;
clockPlayStep = 0;
clearInterval(clockInterval);
clockInterval = setInterval(this, "playClock", delay);
}
function handleClockClick(userNum) {
var _local3;
var _local4 = true;
sm.playSound("snd_piano" + String(userNum));
mc[("clock" + userNum) + "_mc"].gotoAndPlay("active");
userClockSequence.push(userNum);
_local3 = 0;
while (_local3 < userClockSequence.length) {
if (correctClockSequence[_local3] != userClockSequence[_local3]) {
_local4 = false;
break;
}
_local3++;
}
if (_local4) {
trace("ok");
if (userClockSequence.length == correctClockSequence.length) {
mc.clock1_btn.enabled = false;
mc.clock2_btn.enabled = false;
mc.clock3_btn.enabled = false;
if (correctClockSequence.length == maxClockSequenceLength) {
trace("well done! game complete!");
mc.chemist_mc.nextFrame();
mc.jet_mc.gotoAndPlay(2);
sm.playSound("snd_suck");
mc.placeholder_mc.loadMovie(main.Game.basepath + "level4.swf");
_root.kvEvent(394);
sm.stopSound("snd_bg_loop", 1);
} else {
correctClockSequence.push(CORRECT_CLOCK_SEQUENCE[userClockSequence.length]);
clockPlayStep = 0;
clearInterval(clockInterval);
clockInterval = setInterval(this, "playClock", 2000);
}
}
} else {
trace("wrong");
mc.clock1_mc.gotoAndPlay("active");
mc.clock2_mc.gotoAndPlay("active");
mc.clock3_mc.gotoAndPlay("active");
resetAndPlayInitialCorrectClockSequence(2500);
}
trace(("[ NOW COPY THIS SEQUENCE: " + correctClockSequence) + " ]");
}
function playClock() {
clearInterval(clockInterval);
clockInterval = setInterval(this, "playClock", 1000);
var _local2 = correctClockSequence[clockPlayStep];
sm.playSound("snd_piano" + String(_local2));
mc[("clock" + _local2) + "_mc"].gotoAndPlay("active");
if ((++clockPlayStep) == correctClockSequence.length) {
clearInterval(clockInterval);
mc.clock1_btn.enabled = true;
mc.clock2_btn.enabled = true;
mc.clock3_btn.enabled = true;
mc.clock1_btn.useHandCursor = true;
mc.clock2_btn.useHandCursor = true;
mc.clock3_btn.useHandCursor = true;
userClockSequence = [];
trace("your go");
}
}
function initChemicals() {
mc.chemist_mc.hitarea_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onChemistClicked);
mc.sheep_mc.hitarea_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onSheepClicked);
mc.dolphin_mc.hitarea_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onDolphinClicked);
mc.chemicals_mc.blue_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, doChemical, "blue");
mc.chemicals_mc.orange_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, doChemical, "orange");
mc.chemicals_mc.green_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, doChemical, "green");
isFat = false;
}
function doChemical(colour) {
sm.playSound("snd_chemicals");
switch (colour) {
case "blue" :
mc.chemicals_mc.blue_mc.play();
if (isFat) {
isFat = false;
mc.chemicals_mc.curious_mc.gotoAndStop("shrink");
sm.playSound("snd_transform");
}
break;
case "orange" :
mc.chemicals_mc.orange_mc.play();
if (!isFat) {
isFat = true;
mc.chemicals_mc.curious_mc.gotoAndStop("grow");
sm.playSound("snd_transform");
}
break;
case "green" :
mc.chemicals_mc.green_mc.play();
if (isFat) {
mc.chemicals_mc.curious_mc.gotoAndStop("fat_fly");
} else {
sm.playSound("snd_fly");
mc.spider_mc.sm = sm;
mc.chemicals_mc.curious_mc.gotoAndStop("fly");
delete mc.chemicals_mc.blue_btn.onRelease;
delete mc.chemicals_mc.orange_btn.onRelease;
delete mc.chemicals_mc.green_btn.onRelease;
}
}
}
function initDino() {
birdFlying = false;
dinosaurEating = false;
mc.spider_mc.activateDinoEatingCheck = uk.kerb.utils.EventDelegate.create(this, activateDinoEatingCheck);
mc.bird_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, activateBird);
mc.bird_mc.deactivate = uk.kerb.utils.EventDelegate.create(this, deactivateBird);
mc.bird_mc.sm = sm;
mc.dinosaur_mc.sm = sm;
mc.dinosaur_mc.meat_mc.sm = sm;
mc.dinosaur_mc.meat_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, activateDinosaur);
mc.dinosaur_mc.setDinosaurEating = uk.kerb.utils.EventDelegate.create(this, setDinosaurEating);
}
function activateBird() {
if (!birdFlying) {
birdFlying = true;
mc.bird_mc.play();
mc.spider_mc.sm = sm;
mc.spider_mc.gotoAndPlay("down");
sm.playSound("snd_bird");
}
}
function activateDinoEatingCheck() {
mc.spider_mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, _onCheckDinoEating);
}
function _onCheckDinoEating() {
if (dinosaurEating) {
trace("disable bird");
delete mc.spider_mc.onEnterFrame;
delete mc.bird_mc.onEnterFrame;
mc.bird_mc.enabled = false;
mc.spider_mc.play();
mc.dinosaur_mc.stop();
mc.nextFrame();
}
}
function deactivateBird() {
birdFlying = false;
if (mc.spider_mc.onEnterFrame) {
delete mc.spider_mc.onEnterFrame;
mc.spider_mc.gotoAndPlay("up");
}
}
function activateDinosaur() {
mc.dinosaur_mc.meat_mc.play();
}
function setDinosaurEating(eating) {
dinosaurEating = eating;
}
function finish() {
trace("finish!");
dispatchEvent({type:main.Level.EVENT_LEVEL_COMPLETE});
}
static var CORRECT_CLOCK_SEQUENCE = [2, 3, 1, 3, 1];
var clockPlayStep = 0;
var _level4 = null;
}
Symbol 498 MovieClip [__Packages.main.Level4] Frame 0
class main.Level4 extends main.Level
{
var sm, mc, dispatchEvent;
function Level4 (mc) {
super(mc);
sm.loadSoundList(["snd_bolt_unlock", "snd_megaphone", "snd_megaphone_squeal", "snd_voice_of_god", "snd_magnet", "snd_clunk", "snd_coin_land", "snd_blow_bubble", "snd_engine_blades", "snd_bubblegum_machine_rattle", "snd_toaster", "snd_bubblegum_drop", "snd_turbine_button", "snd_curious_falling_in", "snd_toaster_glow", "snd_bg_loop"]);
mc.initStep = uk.kerb.utils.EventDelegate.create(this, initStep);
sm.playSound("snd_bg_loop", 40, 9999999);
_oa = new uk.kerb.utils.Vector();
_ob = new uk.kerb.utils.Vector();
if (!_global.level3done) {
mc.nextFrame();
}
}
function onMouseMove() {
_invokeOnMouseMove();
}
function initStep(stepNum) {
switch (stepNum) {
case 1 :
_doStep1();
break;
case 2 :
_doStep2();
break;
case 3 :
_doStep3();
break;
case 4 :
_doStep4();
break;
case 5 :
_doStep5();
break;
}
}
function _onSetupTurbineBladesStuff() {
_invokeOnMouseMove = _onMouseMoveLowerCogs;
mc.blades_mc.onPress = uk.kerb.utils.EventDelegate.create(this, _onPressBlades);
mc.blades_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onReleaseBlades);
mc.blades_mc.onReleaseOutside = uk.kerb.utils.EventDelegate.create(this, _onReleaseBlades);
}
function _doStep1() {
sm.playSound("snd_curious_falling_in");
mc.falling_mc.setupTurbineBladesStuff = uk.kerb.utils.EventDelegate.create(this, _onSetupTurbineBladesStuff);
mc.toaster_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onToasterClicked);
mc.machine_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onMachineClicked);
mc.megaphone_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onMegaphoneClickedBeforeReady);
}
function _onToasterClicked() {
sm.playSound("snd_toaster");
}
function _onMachineClicked() {
sm.playSound("snd_bubblegum_machine_rattle");
mc.machine_mc.gotoAndPlay("turning");
}
function _onMegaphoneClickedBeforeReady() {
sm.playSound("snd_megaphone_squeal");
}
function _onPressBlades() {
_lastX = mc.blades_mc._xmouse;
_lastY = -mc.blades_mc._ymouse;
Mouse.addListener(this);
}
function _onReleaseBlades() {
Mouse.removeListener(this);
}
function _onMouseMoveLowerCogs() {
var _local3 = mc.blades_mc._xmouse;
var _local2 = -mc.blades_mc._ymouse;
_oa.x = _lastX;
_oa.y = _lastY;
_ob.x = _local3;
_ob.y = _local2;
var _local4 = uk.kerb.utils.Vector.crossProductMagnitude(_oa, _ob);
if (_local4 >= 0) {
mc.turbine_mc._rotation = mc.turbine_mc._rotation - 1.5;
mc.cogs_mc._y = mc.cogs_mc._y - COG_DROP_RATE;
if (mc.cogs_mc._y < -114) {
mc.cogs_mc._y = -114;
}
} else {
if (!_engineBladesSFXStarted) {
sm.playSound("snd_engine_blades");
_engineBladesSFXStarted = true;
}
mc.turbine_mc._rotation = mc.turbine_mc._rotation + 1.5;
mc.cogs_mc._y = mc.cogs_mc._y + COG_DROP_RATE;
if (mc.cogs_mc._y > 159) {
_engineBladesSFXStarted = false;
mc.cogs_mc._y = 159;
_cogsReady = true;
_invokeOnMouseMove = null;
Mouse.removeListener(this);
mc.nextFrame();
}
}
_lastX = _local3;
_lastY = _local2;
}
function _doStep2() {
mc.intoToaster_mc.sm = sm;
mc.intoToaster_mc._visible = false;
mc.intoToaster_mc.gotoAndStop(1);
mc.intoToaster_mc.resetMe = uk.kerb.utils.EventDelegate.create(this, _resetIntoToasterAnimation);
mc.blades_mc.enabled = false;
sm.playSound("snd_clunk");
mc.turbinebutton_mc.onRollOver = function () {
this.gotoAndPlay("over");
};
mc.turbinebutton_mc.onRollOut = function () {
this.gotoAndStop("up");
};
mc.turbinebutton_mc.onPress = function () {
this.gotoAndStop("down");
};
mc.turbinebutton_mc.onReleaseOutside = function () {
this.gotoAndStop("up");
};
mc.turbinebutton_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onTurbineButtonClicked);
mc.megaphone_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onMegaphoneClicked);
}
function _resetIntoToasterAnimation() {
mc.megaphone_mc.enabled = true;
mc.turbinebutton_mc.enabled = true;
mc.cogs_mc._visible = true;
mc.intoToaster_mc.gotoAndStop(1);
mc.intoToaster_mc._visible = false;
}
function _onTurbineButtonClicked() {
sm.playSound("snd_turbine_button");
mc.turbinebutton_mc.gotoAndStop("up");
mc.megaphone_mc.enabled = false;
mc.turbinebutton_mc.enabled = false;
if (_magnetReady) {
mc.nextFrame();
} else {
mc.cogs_mc._visible = false;
mc.intoToaster_mc.sm = sm;
mc.intoToaster_mc._visible = true;
mc.intoToaster_mc.gotoAndPlay(1);
}
}
function _onMegaphoneClicked() {
if (_cogsReady) {
mc.nextFrame();
}
}
function _doStep3() {
mc.turbinebutton_mc.enabled = false;
mc.climbgrater_mc.doMegaphoneSound = uk.kerb.utils.EventDelegate.create(this, _onDoMegaphoneSound);
mc.climbgrater_mc.doVoiceOfGodSound = uk.kerb.utils.EventDelegate.create(this, _onDoVoiceOfGodSound);
mc.climbgrater_mc.lowerMagnet = uk.kerb.utils.EventDelegate.create(this, _lowerMagnet);
mc.climbgrater_mc.done = uk.kerb.utils.EventDelegate.create(this, _onClimbGraterAnimationDone);
}
function _onDoMegaphoneSound() {
sm.playSound("snd_megaphone");
}
function _onDoVoiceOfGodSound() {
sm.playSound("snd_voice_of_god");
}
function _lowerMagnet() {
_interval = new uk.kerb.utils.Interval(this, "_lowerMagnet_t", 10);
}
function _lowerMagnet_t() {
var _local2 = getTimer() - _interval.__get__t0();
if (_local2 > 5000) {
_interval.dispose();
_interval = null;
mc.magnet_mc._y = -11;
} else {
mc.magnet_mc._y = com.robertpenner.easing.Quad.easeInOut(_local2, -235, 224, 5000);
}
updateAfterEvent();
}
function _raiseMagnet_t() {
var _local2 = getTimer() - _interval.__get__t0();
if (_local2 > 1000) {
_interval.dispose();
_interval = null;
mc.magnet_mc._y = -235;
mc.magnet_mc._visible = false;
} else {
mc.magnet_mc._y = com.robertpenner.easing.Quad.easeInOut(_local2, -11, -224, 1000);
}
updateAfterEvent();
}
function _onClimbGraterAnimationDone() {
_magnetReady = true;
mc.turbinebutton_mc.enabled = true;
}
function _doStep4() {
mc.magnetized_mc.sm = sm;
mc.magnetized_mc.gotoAndPlay(1);
mc.magnetized_mc.done = uk.kerb.utils.EventDelegate.create(this, _onMagnetizedAnimationDone);
mc.magnetized_mc.sm = sm;
mc.pickupcoin_mc.sm = sm;
mc.pickupcoin_mc.gotoAndStop(1);
mc.pickupcoin_mc.curious_mc.gotoAndStop(1);
}
function _onMagnetizedAnimationDone() {
mc.pickupcoin_mc.gotoAndStop(2);
mc.pickupcoin_mc.coin_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onCoinClicked);
}
function _onCoinClicked() {
delete mc.pickupcoin_mc.coin_mc.onRelease;
_interval = new uk.kerb.utils.Interval(this, "_raiseMagnet_t", 10);
mc.pickupcoin_mc.play();
mc.pickupcoin_mc.curious_mc.play();
mc.pickupcoin_mc.curious_mc.bubbleGumReadyToPickup = uk.kerb.utils.EventDelegate.create(this, _onBubbleGumReadyToPickup);
}
function _onBubbleGumReadyToPickup() {
mc.pickupcoin_mc.bubblegum_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onBubbleGumClicked);
}
function _onBubbleGumClicked() {
delete mc.pickupcoin_mc.bubblegum_mc.onRelease;
mc.pickupcoin_mc.play();
mc.pickupcoin_mc.curious_mc.play();
mc.pickupcoin_mc.curious_mc.curiousFloating = uk.kerb.utils.EventDelegate.create(this, _onCuriousFloating);
}
function _onCuriousFloating() {
mc.pickupcoin_mc.curious_mc._visible = false;
_curiousSwing = mc.pickupcoin_mc.attachMovie("curious_swing", "cs_mc", 101, {_xscale:70, _yscale:70, _x:65.5, _y:-56.2});
_csoy = _curiousSwing._y;
_bboy = mc.pickupcoin_mc.bubble_mc._y;
_interval = new uk.kerb.utils.Interval(this, "_onCuriousSwing", 10);
_invokeOnMouseMove = _onMouseMoveSuckCurious;
mc.blades_mc.enabled = true;
}
function _onCuriousSwing() {
var _local3 = getTimer() - _interval.__get__t0();
_curiousSwing._rotation = 20 * Math.sin(((Math.PI*2) * _local3) / 2500);
var _local2 = 10 * Math.sin(((Math.PI*2) * _local3) / 5000);
_curiousSwing._y = _csoy + _local2;
mc.pickupcoin_mc.bubble_mc._y = _bboy + _local2;
if ((_afterCuriousSwinging != null) && (Math.abs(_local2) < 0.5)) {
_interval.dispose();
_interval = null;
_afterCuriousSwinging();
}
}
function _onMouseMoveSuckCurious() {
var _local3 = mc.blades_mc._xmouse;
var _local2 = -mc.blades_mc._ymouse;
_oa.x = _lastX;
_oa.y = _lastY;
_ob.x = _local3;
_ob.y = _local2;
var _local4 = uk.kerb.utils.Vector.crossProductMagnitude(_oa, _ob);
if (_local4 >= 0) {
if (!_engineBladesSFXStarted) {
sm.playSound("snd_engine_blades");
_engineBladesSFXStarted = true;
}
mc.turbine_mc._rotation = mc.turbine_mc._rotation - 1.5;
if ((++_windUpFans) >= 50) {
_invokeOnMouseMove = null;
Mouse.removeListener(this);
mc.blades_mc.enabled = false;
_t_rotateTurbineBlades = getTimer();
_interval_fans = new uk.kerb.utils.Interval(this, "_onRotateTurbineBlades", 10);
mc.nextFrame();
}
}
_lastX = _local3;
_lastY = _local2;
}
function _doStep5() {
_afterCuriousSwinging = _finalizeAnimation;
}
function _finalizeAnimation() {
_curiousSwing.removeMovieClip();
_curiousSwing = null;
mc.pickupcoin_mc.curious_mc._visible = true;
mc.pickupcoin_mc.play();
mc.pickupcoin_mc.curious_mc.play();
mc.thought_mc.sm = sm;
mc.thought_mc.play();
mc.pickupcoin_mc.done = uk.kerb.utils.EventDelegate.create(this, _onBroadcastComplete);
}
function _onRotateTurbineBlades() {
var _local2 = getTimer();
var _local3 = (_local2 - _t_rotateTurbineBlades) / 1000;
mc.turbine_mc._rotation = mc.turbine_mc._rotation - (90 * _local3);
_t_rotateTurbineBlades = _local2;
}
function _onBroadcastComplete() {
sm.stopSound("snd_bg_loop", 1);
dispatchEvent({target:this, type:main.Level.EVENT_LEVEL_COMPLETE});
}
static var COG_DROP_RATE = 3;
var _lastX = 0;
var _lastY = 0;
var _oa = null;
var _ob = null;
var _cogsReady = false;
var _magnetReady = false;
var _interval = null;
var _curiousSwing = null;
var _csoy = 0;
var _bboy = 0;
var _invokeOnMouseMove = null;
var _windUpFans = 0;
var _afterCuriousSwinging = null;
var _t_rotateTurbineBlades = 0;
var _interval_fans = null;
var _engineBladesSFXStarted = false;
}
Symbol 499 MovieClip [__Packages.uk.kerb.utils.Vector] Frame 0
class uk.kerb.utils.Vector
{
function Vector (x, y) {
this.x = ((x == undefined) ? 0 : (x));
this.y = ((y == undefined) ? 0 : (y));
}
function clone() {
return(new uk.kerb.utils.Vector(x, y));
}
static function dot(v1, v2) {
return((v1.x * v2.x) + (v1.y * v2.y));
}
static function multiplyScalar(v, s) {
var _local1 = v.clone();
_local1.x = _local1.x * s;
_local1.y = _local1.y * s;
return(_local1);
}
static function add(v1, v2) {
var _local1 = new uk.kerb.utils.Vector();
_local1.x = v1.x + v2.x;
_local1.y = v1.y + v2.y;
return(_local1);
}
static function subtract(v1, v2) {
var _local1 = new uk.kerb.utils.Vector();
_local1.x = v1.x - v2.x;
_local1.y = v1.y - v2.y;
return(_local1);
}
static function normalize(v) {
var _local1 = v.clone();
var _local2 = _local1.__get__length();
if (_local2 != 0) {
_local1.x = _local1.x / _local2;
_local1.y = _local1.y / _local2;
return(_local1);
}
return(null);
}
static function crossProductMagnitude(v1, v2) {
return((v1.x * v2.y) - (v1.y * v2.x));
}
function get length() {
return(Math.sqrt((x * x) + (y * y)));
}
function toString() {
return(((("(" + x) + ",") + y) + ")");
}
var x = 0;
var y = 0;
}
Symbol 500 MovieClip [__Packages.com.robertpenner.easing.Quad] Frame 0
class com.robertpenner.easing.Quad
{
function Quad () {
}
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);
}
}
Symbol 501 MovieClip [__Packages.main.Level5] Frame 0
class main.Level5 extends main.Level
{
var fruitComplete, curiousInBottle, radioOn, sunflowerHidden, fruitToDrop, fruitQueue, fruitOnCrayons, fruitInHat, sm, mc, dispatchEvent;
function Level5 (mc) {
super(mc);
mc.initStep = uk.kerb.utils.EventDelegate.create(this, initStep);
fruitComplete = false;
curiousInBottle = false;
radioOn = false;
sunflowerHidden = false;
fruitToDrop = null;
fruitQueue = new Array();
fruitOnCrayons = [null, null, null, null, null];
fruitInHat = 0;
mc.miniLime_mc._alpha = 0;
mc.miniLemon_mc._alpha = 0;
mc.miniKiwi_mc._alpha = 0;
mc.miniOrange_mc._alpha = 0;
sm.loadSoundList(["snd_crayon", "snd_rocket_crash", "snd_knock", "snd_rocket_launch", "snd_fruit_drop", "snd_fruit_sun", "snd_ladybirds", "snd_radio", "snd_static", "snd_red_button", "snd_bg_loop"]);
sm.playSound("snd_bg_loop", 40, 99999999);
sm.playSound("snd_rocket_crash", 70);
}
function initStep(stepNum) {
trace("STEP " + stepNum);
switch (stepNum) {
case 2 :
mc.bottle_mc.gotoAndStop("withCurious");
mc.bottle_mc.animation_mc.sm = sm;
break;
case 3 :
initDragAndDrop();
mc.ladybirds_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, moveLadybirds);
mc.redButton_mc.onPress = uk.kerb.utils.EventDelegate.create(this, onRedButtonPress);
mc.radio_mc.onPress = uk.kerb.utils.EventDelegate.create(this, onRadioPress);
mc.sunflower_mc.onPress = uk.kerb.utils.EventDelegate.create(this, dropSunflower);
mc.sunflower_mc.setSunflowerHidden = uk.kerb.utils.EventDelegate.create(this, setSunflowerHidden);
mc.sunflower_mc.dropFruit = uk.kerb.utils.EventDelegate.create(this, dropFruit);
mc.man_mc.onPress = uk.kerb.utils.EventDelegate.create(this, manFingerPop);
}
}
function manFingerPop() {
mc.man_mc.gotoAndStop("fingerpop");
}
function moveLadybirds() {
sm.playSound("snd_ladybirds", 70);
mc.ladybirds_mc.gotoAndStop("stackUp");
mc.ladybirds_mc.animation_mc.stackUpComplete = uk.kerb.utils.EventDelegate.create(this, putCuriousInBottle);
mc.ladybirds_mc.enabled = false;
}
function onRedButtonPress(allSystemsGo) {
sm.playSound("snd_red_button", 70);
if ((fruitComplete && (curiousInBottle)) && (allSystemsGo)) {
mc.bottle_mc.gotoAndStop("takeOff");
sm.playSound("snd_rocket_launch", 70);
mc.bottle_mc.animation_mc.finished = uk.kerb.utils.EventDelegate.create(this, finishLevel);
mc.redButton_mc.gotoAndStop("launch");
mc.redButton_mc.enabled = false;
} else {
mc.redButton_mc.gotoAndStop("smoke");
}
}
function onRadioPress() {
if (fruitComplete && (curiousInBottle)) {
mc.radio_mc.gotoAndStop("active");
mc.man_mc.gotoAndStop("pressButton");
mc.man_mc.animation_mc.pressButton = uk.kerb.utils.EventDelegate.create(this, onRedButtonPress, true);
mc.radio_mc.enabled = false;
sm.playSound("snd_radio", 70);
} else {
sm.playSound("snd_static", 70);
mc.radio_mc.gotoAndStop("crackle");
}
}
function putCuriousInBottle() {
mc.bottle_mc.gotoAndStop("curiousInBottle");
mc.bottle_mc.animation_mc.curious_mc.complete = uk.kerb.utils.EventDelegate.create(this, setCuriousInBottle);
mc.ladybirds_mc._visible = false;
}
function setCuriousInBottle() {
curiousInBottle = true;
}
function dropSunflower() {
mc.sunflower_mc.play();
uk.kerb.utils.SetOneInterval.create(2200, uk.kerb.utils.EventDelegate.create(this, playSunflower));
}
function playSunflower() {
mc.sunflower_mc.play();
}
function setSunflowerHidden(hidden) {
sunflowerHidden = hidden;
}
function initDragAndDrop() {
mc.fruit_mc.lime_mc.onPress = uk.kerb.utils.EventDelegate.create(this, startDrag, mc.fruit_mc.lime_mc);
mc.fruit_mc.lime_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, stopDrag, mc.fruit_mc.lime_mc);
mc.fruit_mc.lime_mc.onReleaseOutside = uk.kerb.utils.EventDelegate.create(this, stopDrag, mc.fruit_mc.lime_mc);
mc.fruit_mc.lemon_mc.onPress = uk.kerb.utils.EventDelegate.create(this, startDrag, mc.fruit_mc.lemon_mc);
mc.fruit_mc.lemon_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, stopDrag, mc.fruit_mc.lemon_mc);
mc.fruit_mc.lemon_mc.onReleaseOutside = uk.kerb.utils.EventDelegate.create(this, stopDrag, mc.fruit_mc.lemon_mc);
mc.fruit_mc.kiwi_mc.onPress = uk.kerb.utils.EventDelegate.create(this, startDrag, mc.fruit_mc.kiwi_mc);
mc.fruit_mc.kiwi_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, stopDrag, mc.fruit_mc.kiwi_mc);
mc.fruit_mc.kiwi_mc.onReleaseOutside = uk.kerb.utils.EventDelegate.create(this, stopDrag, mc.fruit_mc.kiwi_mc);
mc.fruit_mc.orange_mc.onPress = uk.kerb.utils.EventDelegate.create(this, startDrag, mc.fruit_mc.orange_mc);
mc.fruit_mc.orange_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, stopDrag, mc.fruit_mc.orange_mc);
mc.fruit_mc.orange_mc.onReleaseOutside = uk.kerb.utils.EventDelegate.create(this, stopDrag, mc.fruit_mc.orange_mc);
mc.fruit_mc.lime_mc.xInit = mc.fruit_mc.lime_mc._x;
mc.fruit_mc.lime_mc.yInit = mc.fruit_mc.lime_mc._y;
mc.fruit_mc.lime_mc.target = mc.fruit_mc.limeTarget_mc;
mc.fruit_mc.lime_mc.mini = mc.miniLime_mc;
mc.fruit_mc.limeTarget_mc._alpha = 0;
mc.fruit_mc.lemon_mc.xInit = mc.fruit_mc.lemon_mc._x;
mc.fruit_mc.lemon_mc.yInit = mc.fruit_mc.lemon_mc._y;
mc.fruit_mc.lemon_mc.target = mc.fruit_mc.lemonTarget_mc;
mc.fruit_mc.lemon_mc.mini = mc.miniLemon_mc;
mc.fruit_mc.lemonTarget_mc._alpha = 0;
mc.fruit_mc.kiwi_mc.xInit = mc.fruit_mc.kiwi_mc._x;
mc.fruit_mc.kiwi_mc.yInit = mc.fruit_mc.kiwi_mc._y;
mc.fruit_mc.kiwi_mc.target = mc.fruit_mc.kiwiTarget_mc;
mc.fruit_mc.kiwi_mc.mini = mc.miniKiwi_mc;
mc.fruit_mc.kiwiTarget_mc._alpha = 0;
mc.fruit_mc.orange_mc.xInit = mc.fruit_mc.orange_mc._x;
mc.fruit_mc.orange_mc.yInit = mc.fruit_mc.orange_mc._y;
mc.fruit_mc.orange_mc.target = mc.fruit_mc.orangeTarget_mc;
mc.fruit_mc.orange_mc.mini = mc.miniOrange_mc;
mc.fruit_mc.orangeTarget_mc._alpha = 0;
var _local2 = 0;
while (_local2 < 9) {
var _local3 = mc[("crayon" + _local2) + "_mc"];
_local3.onRelease = uk.kerb.utils.EventDelegate.create(this, dropCrayon, _local2, _local3);
_local3.checkFruit = uk.kerb.utils.EventDelegate.create(this, checkFruitOnCrayons, _local2, _local3);
_local2++;
}
}
function startDrag(drag_mc) {
drag_mc.swapDepths(1000);
drag_mc.startDrag(false);
}
function stopDrag(drag_mc) {
drag_mc.stopDrag();
if ((drag_mc.hitTest(drag_mc.target) && (sunflowerHidden)) && (fruitToDrop == null)) {
deactivateDragItem(drag_mc);
sm.playSound("snd_fruit_drop", 70);
} else {
new mx.transitions.Tween(drag_mc, "_x", mx.transitions.easing.Elastic.easeOut, drag_mc._x, drag_mc.xInit, 1, true);
new mx.transitions.Tween(drag_mc, "_y", mx.transitions.easing.Elastic.easeOut, drag_mc._y, drag_mc.yInit, 1, true);
}
}
function deactivateDragItem(drag_mc) {
var _local4;
drag_mc.enabled = false;
_local4 = new mx.transitions.Tween(drag_mc, "_x", mx.transitions.easing.Elastic.easeOut, drag_mc._x, drag_mc.target._x, 1, true);
new mx.transitions.Tween(drag_mc, "_y", mx.transitions.easing.Elastic.easeOut, drag_mc._y, drag_mc.target._y, 1, true);
_local4.onMotionFinished = uk.kerb.utils.EventDelegate.create(this, hideFruit, drag_mc);
fruitToDrop = drag_mc.mini;
var _local2 = true;
_local2 = _local2 && (!mc.fruit_mc.lime_mc.enabled);
_local2 = _local2 && (!mc.fruit_mc.lemon_mc.enabled);
_local2 = _local2 && (!mc.fruit_mc.kiwi_mc.enabled);
_local2 = _local2 && (!mc.fruit_mc.orange_mc.enabled);
if (_local2) {
mc.sunflower_mc.enabled = false;
}
}
function hideFruit(tween, drag_mc) {
new mx.transitions.Tween(drag_mc, "_alpha", mx.transitions.easing.None.easeNone, 100, 0, 1, true);
new mx.transitions.Tween(drag_mc.target, "_alpha", mx.transitions.easing.None.easeNone, 0, 100, 1, true);
}
function dropFruit() {
var _local2;
if (fruitToDrop != null) {
fruitToDrop.checkFruitLine = uk.kerb.utils.EventDelegate.create(this, checkFruitQueue, fruitToDrop);
_local2 = new mx.transitions.Tween(fruitToDrop, "_alpha", mx.transitions.easing.None.easeNone, 0, 100, 1, true);
_local2.onMotionFinished = uk.kerb.utils.EventDelegate.create(this, playFruit, fruitToDrop);
sm.playSound("snd_fruit_sun", 70);
fruitToDrop = null;
}
}
function playFruit(tween, fruit_mc) {
fruit_mc.play();
}
function checkFruitQueue(position, fruit_mc) {
if (position == fruitQueue.length) {
fruit_mc.stop();
fruitQueue.push(fruit_mc);
} else if (position < fruitQueue.length) {
fruit_mc.stop();
}
}
function dropCrayon(num, crayon_mc) {
crayon_mc.play();
sm.playSound("snd_crayon", 70);
}
function checkFruitOnCrayons(num, crayon_mc) {
var _local2;
var _local4;
if (num > 4) {
return(undefined);
}
if (fruitOnCrayons[num] != null) {
return(undefined);
}
while (num >= 0) {
if (num == 4) {
if (fruitOnCrayons[3] != null) {
fruitOnCrayons[3].play();
fruitOnCrayons[3] = null;
fruitInHat++;
if ((fruitInHat == 4) && (!fruitComplete)) {
animateMan();
}
}
} else if (num == 0) {
if (fruitQueue.length > 0) {
fruitOnCrayons[0] = fruitQueue.shift();
fruitOnCrayons[0].play();
_local4.stop();
_local2 = 0;
while (_local2 < fruitQueue.length) {
fruitQueue[_local2].play();
_local2++;
}
}
} else if (fruitOnCrayons[num - 1] != null) {
fruitOnCrayons[num - 1].play();
fruitOnCrayons[num] = fruitOnCrayons[num - 1];
fruitOnCrayons[num - 1] = null;
} else {
break;
}
num--;
}
_local2 = 0;
while (_local2 < fruitOnCrayons.length) {
_local4 = mc[("crayon" + _local2) + "_mc"];
if ((fruitOnCrayons[_local2] == null) && (_local4._currentframe != 1)) {
_local4.play();
} else {
_local4.stop();
}
_local2++;
}
}
function animateMan() {
fruitComplete = true;
mc.man_mc.gotoAndStop("turn");
mc.man_mc.enabled = false;
}
function finishLevel() {
uk.kerb.utils.SetOneInterval.create(2000, uk.kerb.utils.EventDelegate.create(this, dispatchEvent, {type:main.Level.EVENT_LEVEL_COMPLETE}));
sm.stopSound("snd_bg_loop", 2);
}
}
Symbol 502 MovieClip [__Packages.main.Level6] Frame 0
class main.Level6 extends main.Level
{
var sm, mc, advanceFrame, si, cursorOn, handGrabbedCurious, handXMin, handXMax, dispatchEvent;
function Level6 (mc) {
super(mc);
sm.loadSoundList(["snd_bg_loop", "snd_baby", "snd_deflate", "snd_claw_across", "snd_claw_down", "snd_gramophone", "snd_mothership", "snd_invaders_fire", "snd_invaders_bomb", "snd_stairs", "snd_hand", "snd_rocket", "snd_pebbles"]);
sm.playSound("snd_bg_loop", 70, 99999999);
sm.playSound("snd_rocket", 70);
mc.baby_mc.sm = sm;
mc.girl_mc.sm = sm;
mc.initStep = uk.kerb.utils.EventDelegate.create(this, initStep);
}
function initStep(stepNum) {
trace("STEP " + stepNum);
switch (stepNum) {
case 2 :
mc.baby_mc.play();
break;
case 3 :
mc.flower1_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, advanceFrame);
break;
case 4 :
mc.flower1_btn.play();
mc.flower1_btn.enabled = false;
si = new main.SpaceInvaders(mc.spaceInvaders_mc, sm);
si.addEventListener(main.SpaceInvaders.EVENT_GAME_OVER, this);
this[main.SpaceInvaders.EVENT_GAME_OVER] = uk.kerb.utils.EventDelegate.create(this, advanceFrame);
break;
case 5 :
mc.mothership_mc.sm = sm;
si.removeEventListener(main.SpaceInvaders.EVENT_GAME_OVER, this);
break;
case 6 :
mc.baby_mc.sm = sm;
sm.playSound("snd_deflate", 70);
break;
case 7 :
mc.flower2_btn.onRelease = uk.kerb.utils.EventDelegate.create(this, advanceFrame);
mc.scientist_mc.nextFrame();
break;
case 8 :
mc.scientist_mc.nextFrame();
mc.flower2_btn.play();
mc.flower2_btn.enabled = false;
cursorOn = false;
handGrabbedCurious = false;
mc.scientist_mc.cursor_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, handleCursorClick);
mc.scientist_mc.cursor_mc.startHandMove = uk.kerb.utils.EventDelegate.create(this, startHandMove);
mc.scientist_mc.cursor_mc.stopHandMove = uk.kerb.utils.EventDelegate.create(this, stopHandMove);
mc.scientist_mc.hand_mc.checkPosition = uk.kerb.utils.EventDelegate.create(this, checkHandPosition);
mc.scientist_mc.hand_mc.retractHand = uk.kerb.utils.EventDelegate.create(this, retractHand);
handXMin = 32;
handXMax = 372;
}
}
function handleCursorClick() {
sm.playSound("snd_hand", 60);
cursorOn = !cursorOn;
mc.scientist_mc.cursor_mc.cursorOn = cursorOn;
if (cursorOn) {
mc.scientist_mc.cursor_mc.play();
}
}
function startHandMove() {
mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, updateHand, 5);
sm.playSound("snd_claw_across", 70);
}
function updateHand(step) {
var _local2 = mc.scientist_mc.hand_mc._x + step;
if (_local2 <= handXMin) {
_local2 = handXMin;
delete mc.onEnterFrame;
mc.scientist_mc.cursor_mc.enabled = true;
} else if (_local2 >= handXMax) {
_local2 = handXMax;
delete mc.onEnterFrame;
}
mc.scientist_mc.hand_mc._x = _local2;
mc.scientist_mc.spring_mc._width = (_local2 - handXMin) + 1;
}
function stopHandMove() {
delete mc.onEnterFrame;
mc.scientist_mc.hand_mc.play();
sm.playSound("snd_claw_down", 70);
}
function retractHand() {
if (handGrabbedCurious) {
mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, exitHand);
} else {
mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, updateHand, -5);
}
mc.scientist_mc.cursor_mc.enabled = false;
}
function checkHandPosition() {
if (mc.scientist_mc.hand_mc.hitTest(mc.scientist_mc.curious_mc)) {
handGrabbedCurious = true;
mc.scientist_mc.play();
}
}
function exitHand() {
var _local2 = mc.scientist_mc.hand_mc._x + 5;
mc.scientist_mc.curious_mc._x = mc.scientist_mc.curious_mc._x + 5;
mc.scientist_mc.hand_mc._x = _local2;
mc.scientist_mc.spring_mc._width = (_local2 - handXMin) + 1;
if (_local2 >= handXMax) {
delete mc.onEnterFrame;
sm.stopSound("snd_bg_loop", 1);
uk.kerb.utils.SetOneInterval.create(2000, uk.kerb.utils.EventDelegate.create(this, dispatchEvent, {type:main.Level.EVENT_LEVEL_COMPLETE}));
}
}
}
Symbol 503 MovieClip [__Packages.main.SpaceInvaders] Frame 0
class main.SpaceInvaders
{
var mc, sm, xMaxInvader, xMaxGun, xStep, bulletSpeed, gunDamping, stepCounter, pauseCounter, firing, invaders;
function SpaceInvaders (mc, sm) {
this.mc = mc;
this.sm = sm;
xMaxInvader = 160;
xMaxGun = 190;
xStep = 3;
bulletSpeed = -4;
gunDamping = 0.05;
stepCounter = 0;
pauseCounter = 0;
firing = false;
invaders = new Array();
var _local2;
_local2 = 0;
while (_local2 < 9) {
invaders.push(mc[("invader" + _local2) + "_mc"]);
_local2++;
}
mc.bullet_mc._visible = false;
Mouse.addListener(this);
mx.events.EventDispatcher.initialize(this);
mc.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, update);
}
function update() {
var _local2 = invaders.length;
var _local4 = xMaxInvader;
var _local3 = 0;
var _local6 = mc._xmouse;
var _local5;
_local5 = mc.gun_mc._x + (gunDamping * (_local6 - mc.gun_mc._x));
if (_local5 < 0) {
_local5 = 0;
} else if (_local5 > xMaxGun) {
_local5 = xMaxGun;
}
mc.gun_mc._x = _local5;
if ((pauseCounter++) == 2) {
pauseCounter = 0;
while (_local2-- , _local2 > -1) {
invaders[_local2]._x = invaders[_local2]._x + xStep;
if ((stepCounter % 2) == 0) {
invaders[_local2].gotoAndStop("up");
} else {
invaders[_local2].gotoAndStop("down");
}
if (invaders[_local2]._x < _local4) {
_local4 = invaders[_local2]._x;
} else if (invaders[_local2]._x > _local3) {
_local3 = invaders[_local2]._x;
}
}
if ((xStep > 0) && (_local3 >= xMaxInvader)) {
xStep = -xStep;
} else if ((xStep < 0) && (_local4 <= 0)) {
xStep = -xStep;
}
stepCounter++;
}
if (firing) {
mc.bullet_mc._y = mc.bullet_mc._y + bulletSpeed;
if (mc.bullet_mc._y <= 0) {
firing = false;
mc.bullet_mc._visible = false;
} else {
_local2 = invaders.length;
while (_local2-- , _local2 > -1) {
if (mc.bullet_mc.hitTest(invaders[_local2])) {
invaders[_local2].gotoAndStop("hit");
invaders.splice(_local2, 1);
firing = false;
mc.bullet_mc._visible = false;
if (invaders.length == 0) {
uk.kerb.utils.SetOneInterval.create(1000, uk.kerb.utils.EventDelegate.create(this, gameOver));
}
break;
}
}
}
}
}
function onMouseDown() {
if (!firing) {
firing = true;
mc.bullet_mc._x = mc.gun_mc._x;
mc.bullet_mc._y = mc.gun_mc._y;
mc.bullet_mc._visible = true;
sm.playSound("snd_invaders_fire", 60);
}
}
function gameOver() {
delete mc.onEnterFrame;
mc.bullet_mc._visible = false;
dispatchEvent({type:EVENT_GAME_OVER});
}
function dispatchEvent(eventObject) {
}
function addEventListener(event, listener) {
}
function removeEventListener(event, listener) {
}
static var EVENT_GAME_OVER = "onGameOver";
}
Symbol 504 MovieClip [__Packages.main.Level7] Frame 0
class main.Level7 extends main.Level
{
var sm, mc, dispatchEvent;
function Level7 (mc) {
super(mc);
sm.loadSoundList(["snd_claw_across", "snd_claw_down", "snd_bg_loop", "snd_giraffe_nibble", "snd_laser", "snd_mic", "snd_monorail", "snd_squirrel", "snd_scorpion_attack", "snd_banana", "snd_step", "snd_pump", "snd_giraffe_announce", "snd_giraffe_whisper", "snd_scorpion_run"]);
mc.initStep = uk.kerb.utils.EventDelegate.create(this, initStep);
sm.playSound("snd_bg_loop", 65, 99999999);
mc.microscoperay_mc._visible = false;
mc.piechart_mc.curious_mc._visible = false;
mc.giraffes_mc.sm = sm;
_setupPieChart();
initStep(1);
}
function _setupPieChart() {
_stepStatus = [false, false, false, false];
_stepColours = ["yellow", "green", "red", "blue"];
_pumpClip = [];
var _local2 = 0;
while (_local2 < _stepStatus.length) {
var _local3 = null;
var _local4 = mc[("pump" + String(_local2)) + "_mc"];
_local3 = uk.kerb.utils.EventDelegate.create(this, _onPumpPressed, _local2);
_local4.onPress = _local3;
_local3 = uk.kerb.utils.EventDelegate.create(this, _onPumpReleased, _local2);
_local4.onRelease = _local3;
_local4.onReleaseOutside = _local3;
_pumpClip.push(_local4);
_pumpClip[_local2].enabled = false;
_local2++;
}
_pumpClip[0].enabled = true;
}
function _onPumpPressed(i) {
_originalY = _ymouse;
_pumpBeingPulled = i;
Mouse.addListener(this);
}
function onMouseMove() {
if (_pumpBeingPulled >= 0) {
if (!_pumpSoundPlaying) {
sm.playSound("snd_pump", 70);
_pumpSoundPlaying = true;
}
var _local3 = _pumpBeingPulled;
var _local6 = _ymouse;
var _local7 = _pumpClip[_local3]._currentframe;
var _local2 = _local6 - _originalY;
if (_local2 > 0) {
var _local4 = 35;
if (_local2 > _local4) {
_local2 = _local4;
}
var _local5 = 1 + Math.floor((13 * _local2) / _local4);
_pumpClip[_local3].gotoAndStop(_local5);
} else {
_pumpClip[_local3].gotoAndStop(1);
}
}
}
function _onPumpReleased(i) {
_pumpSoundPlaying = false;
sm.stopSound("snd_pump", 0.3);
Mouse.removeListener(this);
_pumpBeingPulled = -1;
_stepStatus[i] = _pumpClip[i]._currentframe >= 13;
if (_stepStatus[i]) {
_pumpClip[i].enabled = false;
if (i >= (_stepStatus.length - 1)) {
_allStepsReady = true;
mc.piechart_mc.foo = uk.kerb.utils.EventDelegate.create(this, _checkCuriousCanClimbPieChart);
} else {
mc.piechart_mc.foo = uk.kerb.utils.EventDelegate.create(this, _enableNextPump, i + 1);
}
mc.piechart_mc.gotoAndPlay(_stepColours[i]);
} else {
_pumpClip[i].gotoAndStop(1);
}
}
function _enableNextPump(i) {
if (i < _stepStatus.length) {
_pumpClip[i].enabled = true;
}
}
function initStep(stepNum) {
switch (stepNum) {
case 1 :
sm.playSound("snd_claw_across", 70);
mc.curiousOnStick_mc.curiousHangingAround = uk.kerb.utils.EventDelegate.create(this, _setupGiraffes);
break;
case 2 :
_doStep2();
break;
case 3 :
_doStep3();
break;
case 4 :
_doStep4();
break;
case 5 :
_doStep5();
break;
case 6 :
_doStep6();
break;
}
}
function _setupGiraffes() {
mc.giraffes_mc.giraffe1_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onClickFirstGiraffe);
mc.giraffes_mc.giraffesFinished = uk.kerb.utils.EventDelegate.create(this, _onGiraffesFinished);
mc.microphone_mc.redbutton_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onMicrophoneClicked);
}
function _onMicrophoneClicked() {
sm.playSound("snd_mic", 70);
mc.giraffes_mc.micOn = true;
mc.microphone_mc.gotoAndPlay("buttonpressed");
_microphoneOnAir = !_microphoneOnAir;
mc.microphone_mc.offon_mc.gotoAndStop((_microphoneOnAir ? "onair" : "offair"));
}
function _onClickFirstGiraffe() {
if (_microphoneOnAir) {
_announcementHeard = true;
}
mc.microphone_mc.redbutton_mc.enabled = false;
mc.giraffes_mc.giraffe1_mc.enabled = false;
mc.giraffes_mc.play();
}
function _onGiraffesFinished() {
mc.giraffes_mc.gotoAndStop("ready");
if (_announcementHeard) {
mc.nextFrame();
} else {
mc.giraffes_mc.giraffe1_mc.enabled = true;
mc.microphone_mc.redbutton_mc.enabled = true;
}
}
function _doStep2() {
sm.playSound("snd_monorail", 70, 99999999);
mc.tramarrive_mc.arrived = uk.kerb.utils.EventDelegate.create(this, _onTramArrived);
}
function _onTramArrived() {
mc.curiousOnStick_mc.tramReadyToLeave = uk.kerb.utils.EventDelegate.create(this, _onTramReadyToLeave);
mc.curiousOnStick_mc.play();
}
function _onTramReadyToLeave() {
mc.curiousOnStick_mc._visible = false;
mc.nextFrame();
}
function _doStep3() {
mc.squirrel_mc.squirrel_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onSquirrelClicked);
}
function _onSquirrelClicked() {
sm.playSound("snd_squirrel", 70);
delete mc.squirrel_mc.squirrel_mc.onRelease;
mc.squirrel_mc.play();
mc.squirrel_mc.stopTram = uk.kerb.utils.EventDelegate.create(this, _onStopTram);
mc.squirrel_mc.showSunshine = uk.kerb.utils.EventDelegate.create(this, _onShowSunshine);
}
function _onShowSunshine() {
mc.sunbeam_mc.lightUpMicroscope = uk.kerb.utils.EventDelegate.create(this, _onLightUpMicroscope);
mc.sunbeam_mc.play();
}
function _onStopTram() {
sm.stopSound("snd_monorail", 1);
mc.tramaround_mc.wrapAround = uk.kerb.utils.EventDelegate.create(this, _onWrapAround);
}
function _onLightUpMicroscope() {
sm.playSound("snd_laser", 60);
mc.microscope_mc._visible = true;
mc.microscoperay_mc._visible = true;
}
function _onWrapAround() {
mc.tramaround_mc.stop();
mc.nextFrame();
}
function _doStep4() {
mc.steps_mc.sm = sm;
mc.tramhalt_mc.tramHalted = uk.kerb.utils.EventDelegate.create(this, _onTramHalted);
}
function _onTramHalted() {
mc.steps_mc.setupStep2Button = uk.kerb.utils.EventDelegate.create(this, _onSetupStep2Button);
var self = this;
mc.steps_mc.hideCurious = function () {
self.mc.tramhalt_mc.curious_mc._visible = false;
};
mc.steps_mc.step1_mc.onRelease = function () {
delete self.mc.steps_mc.step1_mc.onRelease;
self.mc.steps_mc.play();
};
}
function _onSetupStep2Button() {
mc.steps_mc.setupStep3Button = uk.kerb.utils.EventDelegate.create(this, _onSetupStep3Button);
var self = this;
mc.steps_mc.step2_mc.onRelease = function () {
delete self.mc.steps_mc.step2_mc.onRelease;
self.mc.steps_mc.play();
};
}
function _onSetupStep3Button() {
mc.steps_mc.setupStep4Button = uk.kerb.utils.EventDelegate.create(this, _onSetupStep4Button);
var self = this;
mc.steps_mc.step3_mc.onRelease = function () {
delete self.mc.steps_mc.step3_mc.onRelease;
self.mc.steps_mc.play();
};
}
function _onSetupStep4Button() {
mc.steps_mc.done = uk.kerb.utils.EventDelegate.create(this, _onStepsPuzzleComplete);
var self = this;
mc.steps_mc.step4_mc.onRelease = function () {
delete self.mc.steps_mc.step4_mc.onRelease;
self.mc.steps_mc.play();
};
}
function _onStepsPuzzleComplete() {
mc.nextFrame();
}
function _doStep5() {
mc.scorpion_mc.sm = sm;
mc.laser_mc.sm = sm;
mc.piechart_mc.sm = sm;
mc.scorpion_mc.setupMicroscopeAsWeapon = uk.kerb.utils.EventDelegate.create(this, _onSetupMicroscopeAsWeapon);
}
function _onSetupMicroscopeAsWeapon() {
mc.laser_mc.setupWhenCuriousFinishedFiringLaser = uk.kerb.utils.EventDelegate.create(this, _onSetupWhenCuriousFinishedFiringLaser);
var self = this;
mc.laser_mc.mirror_mc.onRelease = function () {
delete self.mc.laser_mc.mirror_mc.onRelease;
self.mc.scorpion_mc.curious_mc._visible = false;
self.mc.laser_mc.play();
};
}
function _onSetupWhenCuriousFinishedFiringLaser() {
mc.laser_mc.curious_mc.laserWeaponComplete = uk.kerb.utils.EventDelegate.create(this, _onLaserFired);
}
function _onLaserFired() {
mc.nextFrame();
}
function _doStep6() {
mc.laser_mc.curious_mc._visible = false;
mc.piechart_mc.curious_mc._visible = true;
_curiousWaitingToClimbPieChart = true;
_checkCuriousCanClimbPieChart();
}
function _checkCuriousCanClimbPieChart() {
if (_allStepsReady && (_curiousWaitingToClimbPieChart)) {
mc.piechart_mc.setupCuriousFinalAnimationComplete = uk.kerb.utils.EventDelegate.create(this, onSetupCuriousFinalAnimationComplete);
mc.piechart_mc.gotoAndPlay("climbing");
}
}
function onSetupCuriousFinalAnimationComplete() {
mc.piechart_mc.curious_mc.done = uk.kerb.utils.EventDelegate.create(this, _onFinalAnimationComplete);
}
function _onFinalAnimationComplete() {
sm.stopSound("snd_bg_loop", 1);
dispatchEvent({target:this, type:main.Level.EVENT_LEVEL_COMPLETE});
}
var _microphoneOnAir = false;
var _announcementHeard = false;
var _stepStatus = null;
var _stepColours = null;
var _pumpClip = null;
var _originalY = 0;
var _pumpBeingPulled = -1;
var _allStepsReady = false;
var _curiousWaitingToClimbPieChart = false;
var _pumpSoundPlaying = false;
}
Symbol 505 MovieClip [__Packages.main.Level8] Frame 0
class main.Level8 extends main.Level
{
var sm, dispatchEvent, mc;
function Level8 (mc) {
super(mc);
trace("Level8::Level8");
sm.loadSoundList(["snd_lever", "snd_roof_close", "snd_waves", "snd_clap", "snd_bg_loop", "snd_roof_open", "snd_window", "snd_duck", "snd_phone_button", "snd_phone_ring", "snd_balls", "snd_suck", "snd_swing", "snd_men", "snd_tone_1", "snd_tone_2", "snd_tone_3", "snd_whizz"]);
sm.playSound("snd_bg_loop", 50, 99999999);
_userTelephoneNumber = [];
_revealedTelephoneNumber = [];
mc.atom_mc.stop();
mc.atom_mc._visible = false;
mc.handclap_mc._visible = false;
mc.duck_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onDuckRedHerringClicked);
mc.choc_mc.bg_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onChocRedHerringClicked);
sm.playSound("snd_swing", 70);
_nextStep();
}
function _nextStep() {
trace("Level8::_nextStep");
if ((++_currentStep) > NUMBER_OF_STEPS) {
trace(" all done, broadcasting event now ...");
sm.stopSound("snd_bg_loop", 1);
dispatchEvent({target:this, type:main.Level.EVENT_LEVEL_COMPLETE});
} else {
mc.gotoAndStop(_currentStep);
this["_doStep" + String(_currentStep)]();
}
}
function _doStep1() {
trace("Level8::_doStep1");
var _local2 = 0;
while (_local2 < 10) {
mc.telephone_mc["button" + String(_local2)].onRelease = uk.kerb.utils.EventDelegate.create(this, _onClickTelephoneButton, _local2);
_local2++;
}
_local2 = 0;
while (_local2 < 2) {
var _local3 = null;
_local3 = uk.kerb.utils.EventDelegate.create(this, _onLollipopPress, _local2);
mc[("lollipop" + String(_local2 + 1)) + "_mc"].onPress = _local3;
_local3 = uk.kerb.utils.EventDelegate.create(this, _onLollipopRelease, _local2);
mc[("lollipop" + String(_local2 + 1)) + "_mc"].onRelease = _local3;
mc[("lollipop" + String(_local2 + 1)) + "_mc"].onReleaseOutside = _local3;
mc[("lollipop" + String(_local2 + 1)) + "_mc"].done = uk.kerb.utils.EventDelegate.create(this, _onLollipopDone, _local2);
_local2++;
}
}
function _doStep2() {
trace("Level8::_doStep2");
mc.telephone_mc.sm = sm;
mc.curious_mc.curious_mc.droppedFromHair = uk.kerb.utils.EventDelegate.create(this, _onDroppedFromHair);
}
function _doStep3() {
trace("Level8::_doStep3");
sm.playSound("snd_men", 70);
mc.stuff_mc.sm = sm;
mc.stuff_mc.setupStrawButton = uk.kerb.utils.EventDelegate.create(this, _onSetupStrawButton);
}
function _doStep4() {
trace("Level8::_doStep4");
mc.buildingCurious_mc.sm = sm;
mc.buildingCurious_mc.setupDuckButton = uk.kerb.utils.EventDelegate.create(this, _onSetupDuckButton);
}
function _doStep5() {
trace("Level8::_doStep5");
}
function _doStep6() {
trace("Level8::_doStep6");
}
function _onClickTelephoneButton(i) {
var _local4 = random(3) + 1;
sm.playSound("snd_tone_" + _local4, 70);
if (_userTelephoneNumber.length == TELEPHONE_NUMBER.length) {
_userTelephoneNumber.length = 0;
}
_userTelephoneNumber.push(i);
if (_userTelephoneNumberIsCorrect()) {
_enableTelephoneButtons(false);
_correctTelephoneNumberEntered();
} else {
var _local3 = true;
i = 0;
while (i < _userTelephoneNumber.length) {
if (_userTelephoneNumber[i] != TELEPHONE_NUMBER[i]) {
_local3 = false;
break;
}
i++;
}
if (!_local3) {
_userTelephoneNumber.length = 0;
}
trace((" [ " + _userTelephoneNumber) + " ]");
}
}
function _userTelephoneNumberIsCorrect() {
if (_userTelephoneNumber.length != TELEPHONE_NUMBER.length) {
return(false);
}
var _local3 = true;
var _local2 = 0;
while (_local2 < TELEPHONE_NUMBER.length) {
if (_userTelephoneNumber[_local2] != TELEPHONE_NUMBER[_local2]) {
_local3 = false;
break;
}
_local2++;
}
return(_local3);
}
function _enableTelephoneButtons(state) {
var _local2 = 0;
while (_local2 < 10) {
mc.telephone_mc["button" + String(_local2)].enabled = state;
_local2++;
}
}
function _onLollipopPress(i) {
_movingLollipop = i;
_initialY = _ymouse;
Mouse.addListener(this);
}
function _onLollipopRelease(i) {
_movingLollipop = -1;
if (mc[("lollipop" + String(i + 1)) + "_mc"]._currentframe >= 36) {
mc[("lollipop" + String(i + 1)) + "_mc"].enabled = false;
mc[("lollipop" + String(i + 1)) + "_mc"].gotoAndPlay("returning");
sm.playSound("snd_lever", 70);
} else {
mc[("lollipop" + String(i + 1)) + "_mc"].gotoAndStop("normal");
}
Mouse.removeListener(this);
}
function onMouseMove() {
if (_movingLollipop == -1) {
return(undefined);
}
var _local2 = _ymouse - _initialY;
var _local3 = 35;
if (_local2 < 0) {
_local2 = 0;
} else if (_local2 > _local3) {
_local2 = _local3;
}
var _local4 = 11 + Math.floor((25 * _local2) / _local3);
mc[("lollipop" + String(_movingLollipop + 1)) + "_mc"].gotoAndStop(_local4);
}
function _onLollipopDone(i) {
mc[("lollipop" + String(i + 1)) + "_mc"].enabled = true;
if (i == 0) {
_leftLollipopReady = true;
} else if (i == 1) {
if (_leftLollipopReady) {
_revealTelephoneNumberDigit();
}
_leftLollipopReady = false;
}
}
function _revealTelephoneNumberDigit() {
mc.lollipop1_mc.enabled = false;
mc.lollipop2_mc.enabled = false;
if (_revealedTelephoneNumber.length == TELEPHONE_NUMBER.length) {
_revealedTelephoneNumber.length = 0;
}
_revealedTelephoneNumber.push(TELEPHONE_NUMBER[_revealedTelephoneNumber.length]);
trace((" [ " + _revealedTelephoneNumber) + " ]");
mc.handclap_mc.handclap = uk.kerb.utils.EventDelegate.create(this, _onHandClap);
mc.handclap_mc.done = uk.kerb.utils.EventDelegate.create(this, _onHandClapAnimationFinished);
mc.woman_mc._visible = false;
mc.handclap_mc._visible = true;
mc.handclap_mc.play();
mc.atom_mc.digit_mc._visible = false;
mc.atom_mc.done = uk.kerb.utils.EventDelegate.create(this, _onAtomAnimationFinished);
mc.atom_mc.play();
mc.atom_mc._visible = true;
mc.atomstill_mc._visible = false;
sm.playSound("snd_balls", 60);
}
function _onAtomAnimationFinished() {
mc.lollipop1_mc.enabled = true;
mc.lollipop2_mc.enabled = true;
mc.atom_mc.gotoAndStop(1);
mc.atom_mc._visible = false;
mc.atomstill_mc._visible = true;
}
function _onHandClap() {
sm.playSound("snd_clap", 60);
mc.atom_mc.digit_mc.gotoAndStop(_revealedTelephoneNumber[_revealedTelephoneNumber.length - 1] + 1);
mc.atom_mc.digit_mc._visible = true;
var _local2 = "f" + String(_revealedTelephoneNumber.length);
mc.meninblack_mc.gotoAndStop(_local2);
mc.meninblack_mc["man" + String(_revealedTelephoneNumber.length)].gotoAndPlay(1);
}
function _onHandClapAnimationFinished() {
mc.handclap_mc.gotoAndStop(1);
mc.handclap_mc._visible = false;
mc.woman_mc._visible = true;
}
function _correctTelephoneNumberEntered() {
trace("Level8::_correctTelephoneNumberEntered");
mc.lollipop1_mc.enabled = false;
mc.lollipop2_mc.enabled = false;
mc.meninblack_mc.gotoAndPlay("f8");
_nextStep();
}
function _onDroppedFromHair() {
trace("Level8::_onDroppedFromHair");
mc.telephone_mc.button_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onPhoneRedButtonClicked);
}
function _onPhoneRedButtonClicked() {
trace("Level8::_onPhoneRedButtonClicked");
sm.playSound("snd_phone_button", 60);
delete mc.telephone_mc.button_mc.onRelease;
mc.curious_mc.curious_mc.done = uk.kerb.utils.EventDelegate.create(this, _onCuriousMovedToTelephone);
mc.curious_mc.curious_mc.play();
}
function _onCuriousMovedToTelephone() {
trace("Level8::_onCuriousMovedToTelephone");
mc.telephone_mc.setupCuriousPressing = uk.kerb.utils.EventDelegate.create(this, _onSetupCuriousPressing);
mc.telephone_mc.sm = sm;
mc.telephone_mc.play();
}
function _onSetupCuriousPressing() {
trace("Level8::_onSetupCuriousPressing");
mc.telephone_mc.pressing_mc.done = uk.kerb.utils.EventDelegate.create(this, _onCuriousPressedRedButton);
}
function _onCuriousPressedRedButton() {
trace("Level8::_onCuriousPressedRedButton");
_nextStep();
}
function _onSetupStrawButton() {
trace("Level8::_onSetupStrawButton");
mc.choc_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onStrawClicked);
}
function _onStrawClicked() {
trace("Level8::_onStrawClicked");
delete mc.choc_mc.straw_mc.onRelease;
mc.stuff_mc.curious_mc.gotoAndPlay(85);
mc.stuff_mc.hideFixedStraw = uk.kerb.utils.EventDelegate.create(this, _onHideFixedStraw);
mc.stuff_mc.curiousThrownInAir = uk.kerb.utils.EventDelegate.create(this, _onCuriousThrownInAir);
mc.stuff_mc.play();
}
function _onHideFixedStraw() {
trace("Level8::_onHideFixedStraw");
mc.choc_mc.straw_mc._visible = false;
mc.choc_mc.otherstraw_mc._visible = false;
}
function _onCuriousThrownInAir() {
trace("Level8::_onCuriousThrownInAir");
_nextStep();
}
function _setupCuriousReadyToTouchDuck() {
trace("Level8::_setupCuriousReadyToTouchDuck");
mc.buildingCurious_mc.setupDuckButton = uk.kerb.utils.EventDelegate.create(this, _onSetupDuckButton);
}
function _onSetupDuckButton() {
trace("Level8::_onSetupDuckButton");
mc.buildingCurious_mc.duck_mc.onRelease = uk.kerb.utils.EventDelegate.create(this, _onDuckClicked);
}
function _onDuckClicked() {
trace("Level8::_onDuckClicked");
delete mc.buildingCurious_mc.duck_mc.onRelease;
mc.buildingCurious_mc.curious_mc.curiousTouchDuckBill = uk.kerb.utils.EventDelegate.create(this, _onDuckBillTouched);
mc.buildingCurious_mc.curious_mc.gotoAndPlay(93);
}
function _onDuckBillTouched() {
trace("Level8::_onDuckBillTouched");
mc.buildingCurious_mc.play();
var _local3 = 0;
var _local2 = mc.windows_mc["window" + String(_local3)];
while (_local2) {
_local2.onRelease = uk.kerb.utils.EventDelegate.create(this, _onWindowClicked, _local3);
_local2.gotoAndPlay("open");
_local3++;
_local2 = mc.windows_mc["window" + String(_local3)];
}
_numberOfWindows = _local3;
trace(" number of windows is " + _numberOfWindows);
}
function _onWindowClicked(i) {
trace("Level8::_onWindowClicked: " + String(i));
sm.playSound("snd_window", 60);
var _local2 = mc.windows_mc["window" + String(i)];
delete _local2.onRelease;
_local2.gotoAndPlay("close");
if ((++_windowsClosed) >= _numberOfWindows) {
trace(" all windows closed!");
mc.buildingCurious_mc.done = uk.kerb.utils.EventDelegate.create(this, _onFinalAnimationComplete);
mc.buildingCurious_mc.gotoAndPlay(254);
}
}
function _onFinalAnimationComplete() {
trace("Level8::_onFinalAnimationComplete");
mc.buildingCurious_mc.curiousawayend_mc.stop();
mc.buildingCurious_mc.curiousawayend_mc._visible = false;
_nextStep();
}
function _onDuckRedHerringClicked() {
trace("Level8::_onDuckRedHerringClicked");
}
function _onChocRedHerringClicked() {
trace("Level8::_onChocRedHerringClicked");
}
static var NUMBER_OF_STEPS = 4;
static var TELEPHONE_NUMBER = [7, 2, 5, 3, 6, 7, 3];
var _currentStep = 0;
var _userTelephoneNumber = null;
var _revealedTelephoneNumber = null;
var _leftLollipopReady = false;
var _movingLollipop = -1;
var _initialY = 0;
var _numberOfWindows = 0;
var _windowsClosed = 0;
}
Symbol 506 MovieClip [__Packages.main.Constants] Frame 0
class main.Constants
{
function Constants () {
}
static var MUSIC_VOLUME = 50;
}
Symbol 53 MovieClip Frame 60
this._parent.gotoAndStop("green");
Symbol 54 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 20
sm.playSound("snd_bolt_unlock");
Symbol 65 MovieClip Frame 36
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 41
sm.playSound("snd_harp", 70);
Symbol 74 MovieClip Frame 81
stop();
Symbol 91 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 1
stop();
Symbol 114 MovieClip Frame 1
stop();
curious_mc.stop();
Symbol 114 MovieClip Frame 71
loadLevel();
this._parent.gotoAndStop("empty");
Symbol 121 MovieClip Frame 60
stop();
introComplete();
Symbol 126 MovieClip Frame 90
stop();
Symbol 130 MovieClip Frame 180
endingComplete();
Symbol 130 MovieClip Frame 530
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 162 MovieClip Frame 35
sm.playSound("snd_curious_blink");
Symbol 162 MovieClip Frame 61
sm.playSound("snd_curious_blink");
Symbol 162 MovieClip Frame 125
sm.playSound("snd_curious_blink");
Symbol 162 MovieClip Frame 137
sm.playSound("snd_curious_blink");
Symbol 162 MovieClip Frame 282
introComplete();
Symbol 162 MovieClip Frame 283
stop();
Symbol 189 MovieClip Frame 1
stop();
Symbol 215 MovieClip Frame 1
stop();
Symbol 221 MovieClip Frame 1
stop();
Symbol 248 MovieClip Frame 1
stop();
Symbol 270 Button
on (release) {
getURL ("http://curious.salford.ac.uk/hints/", "_blank");
_root.kvClick(382);
}
Symbol 279 MovieClip Frame 1
blocking_btn.useHandCursor = false;
Symbol 279 MovieClip Frame 56
stop();
Symbol 335 MovieClip Frame 424
sm.playSound("snd_balloon", 50);
Symbol 335 MovieClip Frame 600
playAnim2();
stop();
Symbol 473 MovieClip Frame 200
setupPlayAgainButton();
Symbol 473 MovieClip Frame 247
stop();