Frame 1
function Preloader(baseClip, loadedFrame) {
this.loadedFrame = loadedFrame;
this.baseClip = baseClip;
this.clip = this.baseClip.createEmptyMovieClip("preloaderClip", this.baseClip.getNextHighestDepth());
this.clip.preloader = this;
this.frame = 0;
this.fractionLoaded = 0;
this.loadedBytes = 0;
this.totalBytes = 0;
this.percentLoaded = 0;
this.clip.onEnterFrame = this.evtEnterFrame;
}
function setupRightClickMenu(showDeeperbeigeLink) {
var _local2 = new ContextMenu();
_local2.hideBuiltInItems();
if (showDeeperbeigeLink || (showDeeperbeigeLink == undefined)) {
var _local4 = new ContextMenuItem("MoFunZone.com - Play More Games", function () {
getURL ("http://www.MoFunZone.com/", "_blank");
});
var _local3 = new ContextMenuItem("Performance options", function () {
_root.game.objLevel.clip.ui.btnOptions.onRelease();
});
_local2.customItems.push(_local4, _local3);
}
_root.menu = _local2;
}
function siteLockTest(contentID, lockedFrame, successCallback, staticData) {
if (_root._url.substr(0, 5) == "file:") {
return(successCallback());
}
trace(("SiteLock: Testing '" + contentID) + "'");
var _local6 = new LoadVars();
var _local5 = new LoadVars();
_local5.successCallback = successCallback;
_local5.lockedFrame = lockedFrame;
_local5.staticData = staticData;
_local5.onLoad = function (success) {
if (success) {
if (this.allowed == 1) {
trace("SiteLock: Allowed");
this.successCallback();
} else {
trace("SiteLock: Failed");
_root.legalURL = this.legalURL;
_root.gotoAndStop(this.lockedFrame);
}
} else {
trace("SiteLock: Using static data for test");
var _local5 = _root._url;
var _local6 = _local5.indexOf("://");
if (_local6 >= 0) {
_local5 = _local5.substr(_local6 + 3);
}
strDomain = _local5.toLowerCase();
_local6 = strDomain.indexOf("/");
if (_local6 >= 0) {
strDomain = strDomain.substr(0, _local6);
}
var _local3 = 0;
while (_local3 < this.staticData.allowedDomains.length) {
var _local4 = this.staticData.allowedDomains[_local3];
if (_local4 == strDomain) {
trace("SiteLock: Allowed");
return(this.successCallback());
}
_local3++;
}
trace("SiteLock: Failed");
_root.legalURL = this.staticData.legalURL;
_root.gotoAndStop(this.lockedFrame);
}
};
_local6.contentID = contentID;
_local6.hostURL = _root._url;
_local6.r = Math.floor(Math.random() * 10000);
_local6.sendAndLoad("http://deeperbeige.com/sitelock/check.php", _local5, "POST");
}
function isOnValidDomain(allowedDomains) {
if (_root._url.substr(0, 5) == "file:") {
return(true);
}
var _local5 = _root._url;
var _local6 = _local5.indexOf("://");
if (_local6 >= 0) {
_local5 = _local5.substr(_local6 + 3);
}
strDomain = _local5.toLowerCase();
_local6 = strDomain.indexOf("/");
if (_local6 >= 0) {
strDomain = strDomain.substr(0, _local6);
}
trace(("Sitelock: Domain = \"" + strDomain) + "\"");
var _local2 = 0;
while (_local2 < allowedDomains.length) {
var _local3 = allowedDomains[_local2].toLowerCase();
if (strDomain.indexOf(_local3) >= 0) {
trace("SiteLock: Allowed");
return(true);
}
_local2++;
}
return(false);
}
function ScreenTrans(contentRoot, screenClip, startFrame, fastTrans) {
this.content = contentRoot;
this.screen = screenClip;
this.curFrame = startFrame;
this.screenFrame = 0;
this.transitioning = false;
this.fastTrans = (fastTrans ? true : false);
this.debug = false;
if (!this.content) {
trace("ScreenTrans: Content root is undefined");
}
if (!this.screen) {
trace("ScreenTrans: Screen clip is undefined");
}
if (this.debug) {
trace("ScreenTrans: Initialised");
}
}
function ContentTrans(contentRoot, arrClips, startFrame, fastTrans) {
this.content = contentRoot;
this.curFrame = startFrame;
this.transitioning = false;
this.fastTrans = (fastTrans ? true : false);
this.debug = false;
this.contentClips = arrClips;
if (!this.content) {
trace("ContentTrans: Content root is undefined");
}
var _local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
if (!_local3) {
trace(("ContentTrans: Content clip " + _local2) + " is undefined");
}
_local2++;
}
if (this.debug) {
trace("ContentTrans: Initialised");
}
}
function Sounds(clip) {
if (clip == undefined) {
trace("Sounds: Clip not found in constructor");
}
this.clip = clip;
clip.objSounds = this;
this.sounds = [];
this.groups = [];
this.loops = [];
this.muted = false;
clip.onEnterFrame = function () {
this.objSounds.evtEnterFrame();
};
}
function Physics(baseClip, gravityX, gravityY, drag, collidableMasses, attractingMasses, framePaintCallback, defaultPaint) {
this.baseClip = baseClip;
this.gravityX = gravityX;
this.gravityY = gravityY;
this.drag = drag;
this.collidableMasses = (collidableMasses ? true : false);
this.attractingMasses = (attractingMasses ? true : false);
this.attractionScale = 100;
this.masses = [];
this.springs = [];
this.surfaces = [];
this.framePaintCallback = framePaintCallback;
this.defaultPaint = ((defaultPaint == undefined) ? true : (defaultPaint));
this.biggestMassRadius = 0;
this.paused = false;
this.surfacesChanged = true;
this.baseClip.physics = this;
this.baseClip.onEnterFrame = function () {
this.physics.step();
};
}
function massSort(a, b) {
return(a.x > b.x);
}
function collisionSort(a, b) {
if (a.massA.idx == b.massA.idx) {
return(a.massB.idx > b.massB.idx);
}
return(a.massA.idx > b.massA.idx);
}
function surfaceLeftSort(a, b) {
return(a.x1 > b.x1);
}
function surfaceRightSort(a, b) {
return(a.x2 < b.x2);
}
function Mass(x, y, radius, fixed, physics, collisionSet) {
this.x = x;
this.y = y;
this.prevX = x;
this.prevY = y;
this.radius = radius;
this.radiusSquared = radius * radius;
this.fixed = fixed;
this.depth = physics.baseClip.getNextHighestDepth();
this.physics = physics;
this.collisionSet = collisionSet;
this.mass = 1;
this.friction = 0;
this.attractionMass = 0;
this.attractionMaxForce = 10;
this.extForceX = 0;
this.extForceY = 0;
this.hasHitSurface = false;
this.idx = this.physics.masses.length;
if (radius > physics.biggestMassRadius) {
physics.biggestMassRadius = radius;
}
this.vx = 0;
this.vy = 0;
this.springs = [];
this.physics.masses.push(this);
if (this.physics.defaultPaint) {
this.clipRep = this.physics.baseClip.createEmptyMovieClip("mass" + this.depth, this.depth);
this.clipRep.lineStyle(this.radius * 2, 255, 50);
this.clipRep.moveTo(0, 0);
this.clipRep.lineTo(0, 1);
this.clipRep.owner = this;
}
}
function Spring(mass1, mass2, physics, k, damperK) {
this.mass1 = mass1;
this.mass2 = mass2;
this.k = 0.8;
if (k != undefined) {
this.k = k;
}
this.damperK = 0.2;
if (damperK != undefined) {
this.damperK = damperK;
}
this.depth = physics.baseClip.getNextHighestDepth();
this.physics = physics;
this.mass1.springs.push(this);
this.mass2.springs.push(this);
this.physics.springs.push(this);
this.naturalLength = this.currentLength();
if (this.physics.defaultPaint) {
this.clipRep = this.physics.baseClip.createEmptyMovieClip("spring" + this.depth, this.depth);
this.clipRep.owner = this;
}
}
function Surface(x1, y1, x2, y2, physics, restitution, friction) {
if (x1 > x2) {
var _local2;
_local2 = x2;
x2 = x1;
x1 = _local2;
_local2 = y2;
y2 = y1;
y1 = _local2;
}
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.friction = 0.9;
this.restitution = 0.96;
if (friction != undefined) {
this.friction = friction;
}
if (restitution != undefined) {
this.restitution = restitution;
}
this.depth = physics.baseClip.getNextHighestDepth();
this.physics = physics;
this.physics.surfaces.push(this);
this.physics.surfacesChanged = true;
if (this.physics.defaultPaint) {
this.clipRep = this.physics.baseClip.createEmptyMovieClip("surface" + this.depth, this.depth);
this.clipRep.owner = this;
this.paint();
}
this.update();
}
function SpringBox(x, y, w, h, vx, vy, cornerRadius, springConstant, mass, collisionSet, physics) {
this.physics = physics;
this.m_tl = new Mass(x - (w / 2), y - (h / 2), cornerRadius, false, physics, collisionSet);
this.m_tr = new Mass(x + (w / 2), y - (h / 2), cornerRadius, false, physics, collisionSet);
this.m_bl = new Mass(x - (w / 2), y + (h / 2), cornerRadius, false, physics, collisionSet);
this.m_br = new Mass(x + (w / 2), y + (h / 2), cornerRadius, false, physics, collisionSet);
this.m_tl.mass = mass;
this.m_tr.mass = mass;
this.m_bl.mass = mass;
this.m_br.mass = mass;
this.m_tl.vx = vx;
this.m_tr.vx = vx;
this.m_bl.vx = vx;
this.m_br.vx = vx;
this.m_tl.vy = vy;
this.m_tr.vy = vy;
this.m_bl.vy = vy;
this.m_br.vy = vy;
this.s1 = new Spring(this.m_tl, this.m_tr, physics, springConstant);
this.s2 = new Spring(this.m_tr, this.m_br, physics, springConstant);
this.s3 = new Spring(this.m_br, this.m_bl, physics, springConstant);
this.s4 = new Spring(this.m_bl, this.m_tl, physics, springConstant);
this.s5 = new Spring(this.m_tl, this.m_br, physics, springConstant);
this.s6 = new Spring(this.m_tr, this.m_bl, physics, springConstant);
this.frontLeft = this.m_tl;
this.frontRight = this.m_tr;
}
function SpringLine(x, y, dx, dy, vx, vy, cornerRadius, springConstant, mass, physics, collisionSet) {
this.physics = physics;
this.m_f = new Mass(x - (dx / 2), y - (dy / 2), cornerRadius, false, physics, collisionSet);
this.m_b = new Mass(x + (dx / 2), y + (dy / 2), cornerRadius, false, physics, collisionSet);
this.m_f.mass = mass;
this.m_b.mass = mass;
this.m_f.springItem = this;
this.m_b.springItem = this;
this.m_f.vx = vx;
this.m_f.vy = vy;
this.m_b.vx = vx;
this.m_b.vy = vy;
this.s1 = new Spring(this.m_f, this.m_b, physics, springConstant);
}
function makeSpringLine(mass_front, mass_back) {
var _local1 = {m_f:mass_front, m_b:mass_back};
_local1.s1 = new Spring(_local1.m_f, _local1.m_b, mass_front.physics, 0.7);
_local1.getPosition = SpringLine.prototype.getPosition;
return(_local1);
}
function addSurfaces(clip, instancePrefix, physics, restitution, friction) {
var _local7 = [];
var _local6 = 0;
var _local1 = clip[instancePrefix + _local6];
while (_local1 != undefined) {
var _local3 = _local1.p1.holderToLocal(physics.baseClip);
var _local2 = _local1.p2.holderToLocal(physics.baseClip);
var _local5 = new Surface(_local3.x, _local3.y, _local2.x, _local2.y, physics, restitution, friction);
_local1._visible = false;
_local7.push(_local5);
_local6++;
_local1 = clip[instancePrefix + _local6];
}
return(_local7);
}
function setupForNewGame() {
_root.hasHat = false;
_root.screenID = 1;
_root.maxWarps = 1;
_root.monkeyStartX = undefined;
_root.pickups = undefined;
_root.hiddenMsgs = undefined;
_root.cameras = undefined;
_root.triggers = undefined;
var _local2 = 0;
while (_local2 < 500) {
_root["bmpBlood" + _local2] = undefined;
_local2++;
}
}
function linkSponsor() {
getURL ("http://www.MoFunZone.com", "_blank");
_root.trackPoint("Link_Sponsor");
_root.achieved("sponsor_click");
}
function linkSponsorGame() {
if (_root.isViralVersion) {
getURL ("http://www.MoFunZone.com/online_games/infinite_monkeys_bending_reality.shtml", "_blank");
} else {
getURL ("http://www.MoFunZone.com", "_blank");
}
_root.trackPoint("Link_Sponsor");
_root.achieved("sponsor_click");
}
function linkWalkthru() {
_root.trackPoint("Link_Walkthru");
getURL ("http://www.mofunzone.com/game_cheats/pc_cheats/infinite_monkeys_bending_reality_walkthrough.shtml", "_blank");
_root.achieved("sponsor_click");
}
function linkMoreGames() {
_root.trackPoint("Link_MoreGames");
getURL ("http://www.MoFunZone.com/", "_blank");
_root.achieved("sponsor_click");
}
function linkAuthor() {
_root.trackPoint("Link_Author");
getURL ("http://deeperbeige.com/games", "_blank");
_root.achieved("sponsor_click");
}
function linkAnimator() {
_root.trackPoint("Link_Animator");
getURL ("http://nickhilditch.com", "_blank");
_root.achieved("sponsor_click");
}
function setupHome(clip) {
setupForNewGame();
if (_root.isViralVersion) {
clip.logo.gotoAndStop("viral");
}
clip.btnStartGame.onRelease = function () {
_root.game = new _root.Game();
clip.btnStartGame.onRelease = undefined;
};
clip.btnMoreGames.onRelease = linkMoreGames;
clip.btnAchievements.onRelease = function () {
_global.objTrans.goto("achievements");
};
clip.btnCredits.onRelease = function () {
_global.objTrans.goto("credits");
};
clip.btnWipeProgress.onRelease = function () {
_global.objTrans.goto("wipe");
};
clip.btnReplayIntro.onRelease = function () {
_global.objTrans.goto("intro");
};
}
function setupWipe(clip) {
clip.btnOK.onRelease = function () {
setupSO();
_global.objTrans.goto("home");
};
clip.btnCancel.onRelease = function () {
_global.objTrans.goto("home");
};
}
function setupAchievements(clip) {
if (_root.isViralVersion) {
clip.btnSponsor.onRelease = linkSponsorGame;
} else {
clip.btnSponsor._visible = false;
}
clip.btnBack.onRelease = function () {
_global.objTrans.goto("home");
};
var _local5 = 1;
while (_local5 < achievements.length) {
var _local4 = clip["a" + _local5];
var _local6 = clip["p" + _local5];
var _local7 = achievements[_local5];
_local4.gotoAndStop(_local7.id);
_local4._brightness = -100;
_local4.popup = _local6;
_local6._visible = false;
_local6.txtTitle.text = _local7.title;
_local6.txtDescription.text = _local7.description;
if (_local7.complete) {
_local4.brightnessTo(0, 0.3, "linear", Maths.randomNum(0.1, 0.8));
}
_local4.hit.onRollOver = function () {
this._parent.popup.fadeIn(0.2);
};
_local4.hit.onRollOut = function () {
this._parent.popup.fadeOut(0.2);
};
_local5++;
}
}
function setupCredits(clip) {
clip.btnSponsor.onRelease = linkSponsor;
clip.btnMoreGames.onRelease = linkMoreGames;
clip.btnBack.onRelease = function () {
_global.objTrans.goto("home");
};
}
function initAchievementsSO() {
var _local3 = SharedObject.getLocal("infinitemonkeys");
if (_local3.data.arrAchievements == undefined) {
setupSO();
}
_root.arrAchievements = _local3.data.arrAchievements;
var _local2 = 1;
while (_local2 < achievements.length) {
achievements[_local2].complete = _root.arrAchievements[_local2].complete;
_local2++;
}
_root.achievementQueue = [];
}
function setupSO() {
var _local3 = SharedObject.getLocal("infinitemonkeys");
_local3.data.arrAchievements = [{dummy:true}, {idx:1, complete:false}, {idx:2, complete:false}, {idx:3, complete:false}, {idx:4, complete:false}, {idx:5, complete:false}, {idx:6, complete:false}, {idx:7, complete:false}, {idx:8, complete:false}, {idx:9, complete:false}, {idx:10, complete:false}, {idx:11, complete:false}, {idx:12, complete:false}, {idx:13, complete:false}, {idx:14, complete:false}, {idx:15, complete:false}, {idx:16, complete:false}, {idx:17, complete:false}, {idx:18, complete:false}, {idx:19, complete:false}, {idx:20, complete:false}];
_local3.flush();
var _local2 = 1;
while (_local2 < achievements.length) {
achievements[_local2].complete = false;
_local2++;
}
_root.arrAchievements = _local3.data.arrAchievements;
}
function achieved(id) {
var _local4 = achievementIdx(id);
if (_root.arrAchievements[_local4].complete) {
return(undefined);
}
_root.arrAchievements[_local4].complete = true;
achievements[_local4].complete = true;
trace(((("Achievement '" + id) + "' gained (idx ") + _local4) + ")");
_root.trackPoint((("Achieved_" + _local4) + "_") + id);
var _local6 = SharedObject.getLocal("infinitemonkeys");
_local6.data.arrAchievements = _root.arrAchievements;
_local6.flush();
_root.achievementQueue.push(id);
processAchievementQueue();
var _local3 = 0;
var _local2 = 0;
while (_local2 < achievements.length) {
if (achievements[_local2].complete) {
_local3++;
}
_local2++;
}
if (_local3 == (achievements.length - 2)) {
achieved("overachiever");
}
}
function processAchievementQueue() {
if (_root.achievementAnim.showing) {
return(undefined);
}
if (_root.achievementQueue.length > 0) {
var _local3 = _root.achievementQueue.shift();
var _local2 = achievementIdx(_local3);
if (!_root.isViralVersion) {
MoFunZoneAPI.MFZEasyAPI.success(achievements[_local2].moID);
}
_root.achievementAnim.gotoAndPlay("anim");
_root.achievementAnim.icon.gotoAndStop(_local3);
_root.achievementAnim.txtTitle.text = achievements[_local2].title;
_root.achievementAnim.bg._width = 42 + _root.achievementAnim.txtTitle.textWidth;
if (_root.isViralVersion) {
_root.achievementAnim.btnSponsor.onRelease = _root.linkSponsorGame;
} else {
_root.achievementAnim.btnSponsor._visible = false;
}
} else {
_root.achievementAnim.gotoAndStop("idle");
}
}
function achievementIdx(id) {
var _local1 = 1;
while (_local1 < achievements.length) {
if (id == achievements[_local1].id) {
return(_local1);
}
_local1++;
}
return(0);
}
function setMusic(id, force) {
if (force == undefined) {
force = false;
}
var _local3 = curMusic;
curMusic = id;
if ((!_root.objSounds.isPlaying("music")) && (!force)) {
return(undefined);
}
if ((curMusic != _local3) || (force)) {
_root.objSounds.stop("music");
_root.objSounds.play(curMusic, undefined, true);
}
}
function stopAllLoops() {
_root.objSounds.removeAllSources();
_root.objSounds.stop("loops");
}
function initVersion() {
_root.isViralVersion = true;
var _local2 = _root._url.toLowerCase();
if (_local2.indexOf("mofunzone.com") >= 0) {
_root.isViralVersion = false;
}
trace("Viral version: " + _root.isViralVersion);
}
function Options() {
this.initialise();
}
function createBasicShot(objLevel, objShot, startX, startY, targetX, targetY) {
objShot.objLevel = objLevel;
objShot.shotType = "default";
objShot.state = "fired";
objShot.frame = 0;
objShot.growFrames = 0;
objShot.lifeFrames = 1800;
objShot.startFrame = objLevel.frame;
objShot.startX = startX;
objShot.startY = startY;
objShot.targetX = targetX;
objShot.targetY = targetY;
objShot.ending = false;
objShot.evtDraw = function (bmp) {
trace("Shot missing evtDraw() definition");
};
objShot.evtUpdate = function () {
trace("Shot missing evtUpdate() definition");
};
objShot.evtRemoveShot = function () {
if (!this.ending) {
this.ending = true;
this.fullScale = this.frac;
this.lifeFrames = this.frame + this.growFrames;
}
};
}
function ShotGrow(objLevel, startX, startY, targetX, targetY) {
createBasicShot(objLevel, this, startX, startY, targetX, targetY);
this.shotType = "grow";
this.filterSize = 200;
this.filterHalfSize = this.filterSize / 2;
this.fullScale = 1;
this.minScale = 0.5;
this.growFrames = 15;
this.lifeFrames = undefined;
this.bmpDisplacer = new flash.display.BitmapData(this.filterSize, this.filterSize, true, 2155905152);
this.bmpSource = new flash.display.BitmapData(this.filterSize, this.filterSize, true, 0);
this.filter = new flash.filters.DisplacementMapFilter(this.bmpDisplacer, new flash.geom.Point(0, 0), 1, 2, 95, 95, "clamp");
var _local3 = this.objLevel.shotMarkers.getNextHighestDepth();
this.objLevel.shotMarkers.attachMovie("shotMarker", "shotMarker" + _local3, _local3);
this.shotMarker = this.objLevel.shotMarkers["shotMarker" + _local3];
this.shotMarker._x = this.targetX;
this.shotMarker._y = this.targetY;
this.shotMarker._xscale = 1;
this.shotMarker._yscale = 1;
this.evtDraw = function (bmp) {
var _local2 = new flash.geom.Rectangle(this.targetX - this.filterHalfSize, this.targetY - this.filterHalfSize, this.filterSize, this.filterSize);
this.bmpSource.copyPixels(bmp, _local2, new flash.geom.Point(0, 0));
bmp.applyFilter(this.bmpSource, this.bmpSource.rectangle, new flash.geom.Point(this.targetX - this.filterHalfSize, this.targetY - this.filterHalfSize), this.filter);
};
this.evtUpdate = function () {
this.frame++;
if (this.frame <= this.growFrames) {
this.frac = com.mosesSupposes.fuse.PennerEasing.easeOutBounce(this.frame, this.minScale, this.fullScale - this.minScale, this.growFrames);
} else {
this.starting = false;
}
if (this.lifeFrames != undefined) {
var _local2 = this.lifeFrames - this.frame;
if (_local2 < this.growFrames) {
this.ending = true;
this.frac = com.mosesSupposes.fuse.PennerEasing.easeOutExpo(_local2, this.minScale, this.fullScale - this.minScale, this.growFrames);
}
if (_local2 <= 0) {
this.destroyShot();
return(false);
}
}
this.mx = new flash.geom.Matrix();
this.mx.scale(this.frac, this.frac);
this.mx.translate(100, 100);
this.bmpDisplacer.fillRect(this.bmpDisplacer.rectangle, 2155905152);
this.bmpDisplacer.draw(objLevel.clip.growDisplacer, this.mx);
this.shotMarker._xscale = 100 * this.frac;
this.shotMarker._yscale = 100 * this.frac;
return(true);
};
this.destroyShot = function () {
this.bmpSource.dispose();
this.bmpDisplacer.dispose();
this.shotMarker.removeMovieClip();
};
}
function MonkeyShotManager(clip) {
this.clip = clip;
this.shots = [];
this.id = 0;
}
function Game(levelClip) {
this.initialise();
}
function MonkeyLevel(levelClip) {
_root.game.objLevel = this;
this.clip = levelClip;
this.clip.objLevel = this;
this.monkey = this.clip.monkeyHolder.monkey;
this.bendableClip = this.clip.bendableClip;
this.unbendableClip = this.clip.unbendableClip;
this.shotClip = this.clip.shotHolder;
this.laserClip = this.clip.laserHolder;
this.shotMarkers = this.clip.shotMarkers;
this.bloodBmpClip = this.clip.bloodHolder;
this.bloodClip = this.clip.bloodClip;
}
function Speech(uiClip) {
this.clip = uiClip.speech;
this.clip.speech = this;
this.currentSeq = "";
this.currentIdx = 1;
this.running = false;
this.endFrame = 0;
this.frame = 0;
}
function Arm(levelClip, armMode) {
this.levelClip = levelClip;
this.clip = levelClip.deploy;
this.clip.objArm = this;
this.monkey = this.levelClip.monkeyHolder.monkey;
this.armMode = armMode;
this.droppedMonkey = false;
if (this.armMode == "cycle") {
this.levelClip.armCycle.stop();
}
this.initialise();
}
function initSounds() {
_root.objSounds = new Sounds(_root.soundHolder);
_root.objSounds.registerSound("music_lab", 30);
_root.objSounds.registerSound("music_caves", 30);
_root.objSounds.registerSound("music_sewer", 30);
_root.objSounds.registerSound("music_outside", 30);
_root.objSounds.registerGroup("music", ["music_lab", "music_caves", "music_sewer", "music_outside"]);
_root.objSounds.registerSound("intro1");
_root.objSounds.registerSound("intro2");
_root.objSounds.registerSound("intro3");
_root.objSounds.registerSound("intro4");
_root.objSounds.registerSound("intro5");
_root.objSounds.registerGroup("voice", ["intro1", "intro2", "intro3", "intro4", "intro5"]);
_root.objSounds.registerSound("achievement", 40);
_root.objSounds.registerSound("cameraexplode");
_root.objSounds.registerSound("crushotronbang");
_root.objSounds.registerSound("crushotronrumble");
_root.objSounds.registerSound("deathdrone");
_root.objSounds.registerSound("deathlaser");
_root.objSounds.registerSound("deathsaw");
_root.objSounds.registerSound("deathspikes");
_root.objSounds.registerSound("deathcrush1");
_root.objSounds.registerSound("deathcrush2");
_root.objSounds.registerGroup("deathcrush", ["deathcrush1", "deathcrush2"]);
_root.objSounds.registerSound("eric");
_root.objSounds.registerSound("footstep1");
_root.objSounds.registerSound("footstep2");
_root.objSounds.registerSound("jump");
_root.objSounds.registerSound("labexplode");
_root.objSounds.registerSound("pickup");
_root.objSounds.registerSound("scrape");
_root.objSounds.registerSound("steam");
_root.objSounds.registerSound("thunder");
_root.objSounds.registerSound("arm", 50);
_root.objSounds.registerSound("bonus");
_root.objSounds.registerSound("clang");
_root.objSounds.registerSound("hiddenmsg", 50);
_root.objSounds.registerSound("talk");
_root.objSounds.registerSound("warpclose", 70);
_root.objSounds.registerSound("warp1", 70);
_root.objSounds.registerSound("warp2", 70);
_root.objSounds.registerSound("warp3", 70);
_root.objSounds.registerSound("warp4", 70);
_root.objSounds.registerGroup("warp", ["warp1", "warp2", "warp3", "warp4"]);
_root.objSounds.registerSound("focusloop");
_root.objSounds.registerSound("stoneloop");
_root.objSounds.registerSound("laserhumloop");
_root.objSounds.registerSound("sirenloop");
_root.objSounds.registerSound("droneloop");
_root.objSounds.registerSound("sawloop");
_root.objSounds.registerGroup("loops", ["focusloop", "stoneloop", "laserhumloop", "sirenloop", "droneloop", "sawloop"]);
_root.objSounds.registerSound("monkey1");
_root.objSounds.registerSound("monkey2");
_root.objSounds.registerSound("monkey3");
_root.objSounds.registerSound("monkey4");
_root.objSounds.registerSound("monkey5");
_root.objSounds.registerSound("monkey6");
_root.objSounds.registerGroup("monkey", ["monkey1", "monkey2", "monkey3", "monkey4", "monkey5", "monkey6"]);
}
Preloader.prototype.evtEnterFrame = function () {
var _local4 = _root.getBytesLoaded();
var _local3 = _root.getBytesTotal();
this.preloader.frame++;
this.preloader.onUpdate();
if ((_local4 > 10) && (_local3 > 10)) {
this.preloader.totalBytes = _local3;
this.preloader.loadedBytes = _local4;
this.preloader.fractionLoaded = _local4 / _local3;
this.preloader.percentLoaded = Math.floor((_local4 * 100) / _local3);
if (_local4 == _local3) {
this.preloader.onLoaded();
this.onEnterFrame = undefined;
this.removeMovieClip();
}
} else {
this.preloader.percentLoaded = 0;
}
this.preloader.loadingString = ("Loading: " + this.preloader.percentLoaded) + "%";
};
Preloader.prototype.onLoaded = function () {
_root.gotoAndStop(this.loadedFrame);
};
Preloader.prototype.onUpdate = function () {
trace(this.fractionLoaded);
};
ScreenTrans.prototype.goto = function (frame, onTransComplete) {
if (this.curFrame == frame) {
if (this.debug) {
trace(("ScreenTrans: Transition to '" + frame) + "' disallowed: Already on this section");
}
return(undefined);
}
if (this.transitioning) {
if (this.debug) {
trace(("ScreenTrans: Transition to '" + frame) + "' disallowed: Already transitioning");
}
return(undefined);
}
if (this.debug) {
trace(("ScreenTrans: Transitioning to '" + frame) + "'");
}
this.goingTo = frame;
this.transitioning = true;
this.onTransComplete = onTransComplete;
this.content.objTrans = this;
this.screen.objTrans = this;
this.screen.prevFrameNo = this.screen._currentframe;
this.screen.onEnterFrame = function () {
if (this.debug) {
trace(("ScreenTrans: Hiding content (frame " + this._currentframe) + ")");
}
if ((this.prevFrameNo == this._currentframe) || (this.objTrans.fastTrans)) {
this.objTrans.next();
}
this.prevFrameNo = this._currentframe;
};
this.screen.gotoAndPlay("hide");
};
ScreenTrans.prototype.next = function () {
if (this.debug) {
trace(("ScreenTrans: Content hidden. Switching to '" + this.goingTo) + "'");
}
this.curFrame = this.goingTo;
this.goingTo = undefined;
this.screen.prevFrameNo = this.screen._currentframe;
this.screen.onEnterFrame = function () {
if (this.debug) {
trace(("ScreenTrans: Revealing content (frame " + this._currentframe) + ")");
}
if ((this.prevFrameNo == this._currentframe) || (this.objTrans.fastTrans)) {
this.objTrans.transComplete();
}
this.prevFrameNo = this._currentframe;
};
this.content.gotoAndStop(this.curFrame);
this.screen.gotoAndPlay("reveal");
};
ScreenTrans.prototype.transComplete = function () {
this.screen.onEnterFrame = undefined;
this.transitioning = false;
if (this.fastTrans) {
this.screen.gotoAndStop("idle");
}
if (this.onTransComplete != undefined) {
if (this.debug) {
trace("ScreenTrans: Executing callback");
}
this.onTransComplete();
}
if (this.debug) {
trace("ScreenTrans: Transition complete");
}
};
ContentTrans.prototype.goto = function (frame, onTransComplete) {
if (this.curFrame == frame) {
if (this.debug) {
trace(("ContentTrans: Transition to '" + frame) + "' disallowed: Already on this section");
}
return(undefined);
}
if (this.transitioning) {
if (this.debug) {
trace(("ContentTrans: Transition to '" + frame) + "' disallowed: Already transitioning");
}
return(undefined);
}
if (this.debug) {
trace(("ContentTrans: Transitioning to '" + frame) + "'");
}
this.goingTo = frame;
this.transitioning = true;
this.onTransComplete = onTransComplete;
this.content.objTrans = this;
var _local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
_local3.prevFrameNo = -1;
_local2++;
}
this.content.onEnterFrame = function () {
var _local4 = true;
var _local3 = 0;
while (_local3 < this.objTrans.contentClips.length) {
var _local2 = this.objTrans.contentClips[_local3];
if (this.objTrans.fastTrans) {
} else {
if (_local2.prevFrameNo != _local2._currentframe) {
_local4 = false;
}
_local2.prevFrameNo = _local2._currentframe;
}
_local3++;
}
if (_local4) {
this.objTrans.next();
}
};
_local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
_local3.gotoAndPlay("out");
_local2++;
}
};
ContentTrans.prototype.next = function () {
if (this.debug) {
trace(("ContentTrans: Content is now out. Switching to '" + this.goingTo) + "'");
}
this.curFrame = this.goingTo;
this.goingTo = undefined;
this.content.objTrans = this;
var _local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
_local3.prevFrameNo = -1;
_local2++;
}
this.content.onEnterFrame = function () {
var _local4 = true;
var _local3 = 0;
while (_local3 < this.objTrans.contentClips.length) {
var _local2 = this.objTrans.contentClips[_local3];
if (this.objTrans.fastTrans) {
} else {
if (_local2.prevFrameNo != _local2._currentframe) {
_local4 = false;
}
_local2.prevFrameNo = _local2._currentframe;
}
_local3++;
}
if (_local4) {
this.objTrans.transComplete();
}
};
this.content.gotoAndStop(this.curFrame);
_local2 = 0;
while (_local2 < this.contentClips.length) {
var _local3 = this.contentClips[_local2];
_local3.gotoAndPlay("in");
_local2++;
}
};
ContentTrans.prototype.transComplete = function () {
this.content.onEnterFrame = undefined;
this.transitioning = false;
if (this.onTransComplete != undefined) {
if (this.debug) {
trace("ContentTrans: Executing callback");
}
this.onTransComplete();
}
if (this.debug) {
trace("ContentTrans: Transition complete");
}
};
stop();
setupRightClickMenu();
var objTrans = new ScreenTrans(this, screen, "preloader", false);
_global.objTrans = objTrans;
_level0.cmuSWF_ID = "InfiniteMonkeys";
if (_global.System) {
System.security.allowDomain("tracking.deeperbeige.com");
}
loadMovieNum ("http://tracking.deeperbeige.com/tracking/tracker.swf?r=" + (Math.floor(Math.random() * 10000) + 10000), 19467);
com.mosesSupposes.fuse.ZigoEngine.simpleSetup(com.mosesSupposes.fuse.Shortcuts, com.mosesSupposes.fuse.PennerEasing);
var Maths = new Object();
Maths.randomNum = function (minNum, maxNum) {
return((Math.random() * (maxNum - minNum)) + minNum);
};
Maths.randomInt = function (minNum, maxNum) {
return(Math.round((Math.random() * (maxNum - minNum)) + minNum));
};
Maths.vectorLength = function (dx, dy) {
return(Math.sqrt((dx * dx) + (dy * dy)));
};
Maths.distance = function (x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
return(Maths.vectorLength(_local2, _local1));
};
Maths.vectorLengthSquared = function (dx, dy) {
return((dx * dx) + (dy * dy));
};
Maths.distanceSquared = function (x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
return(Maths.vectorLengthSquared(_local2, _local1));
};
Maths.angleBetween = function (x1, y1, x2, y2) {
var _local2 = (x1 * x2) + (y1 * y2);
var _local1 = Maths.vectorLength(x1, y1) * Maths.vectorLength(x2, y2);
return(Math.acos(_local2 / _local1));
};
Maths.dotProduct = function (ax, ay, bx, by) {
return((ax * bx) + (ay * by));
};
Maths.vectorIntersect = function (v1, v2) {
var _local3 = {dx:v2.x - v1.x, dy:v2.y - v1.y};
v1.len = Maths.vectorLength(v1.dx, v1.dy);
v2.len = Maths.vectorLength(v2.dx, v2.dy);
v1.nx = v1.dx / v1.len;
v1.ny = v1.dy / v1.len;
v2.nx = v2.dx / v2.len;
v2.ny = v2.dy / v2.len;
var _local4 = Maths.vectorPerp(_local3, v2) / Maths.vectorPerp(v1, v2);
if (((v1.nx == v2.nx) && (v1.ny == v2.ny)) || ((v1.nx == (-v2.nx)) && (v1.ny == (-v2.ny)))) {
_local4 = 1000000 /* 0x0F4240 */;
}
return({x:v1.x + (v1.dx * _local4), y:v1.y + (v1.dy * _local4), t:_local4});
};
Maths.vectorPerp = function (v1, v2) {
return(((-v1.dy) * v2.dx) + (v1.dx * v2.dy));
};
Maths.unitNormal = function (x, y) {
var _local2 = -y;
var _local1 = x;
var _local3 = Maths.vectorLength(_local2, _local1);
_local2 = _local2 / _local3;
_local1 = _local1 / _local3;
return({x:_local2, y:_local1});
};
Maths.scalarProjection = function (x1, y1, x2, y2) {
return(Maths.dotProduct(x1, y1, x2, y2) / Maths.vectorLength(x2, y2));
};
Maths.vectorProjection = function (x1, y1, x2, y2) {
var _local2 = Maths.dotProduct(x1, y1, x2, y2);
var _local1 = Maths.vectorLength(x2, y2);
var _local6 = (_local2 * x2) / (_local1 * _local1);
var _local5 = (_local2 * y2) / (_local1 * _local1);
return({x:_local6, y:_local5});
};
Maths.formatNum = function (num, leadingDigits, decimalDigits) {
var _local2 = "" + Math.floor(num);
while (_local2.length < leadingDigits) {
_local2 = "0" + _local2;
}
if (decimalDigits != undefined) {
var _local1 = Math.abs(num) - Math.floor(Math.abs(num));
_local1 = _local1 * (10 ^ decimalDigits);
_local1 = Math.floor(_local1);
_local1 = "" + _local1;
while (_local1.length < decimalDigits) {
_local1 = _local1 + "0";
}
_local2 = (_local2 + ".") + _local1;
}
return(_local2);
};
Maths.degToRad = function (degs) {
return(degs * (Math.PI/180));
};
Maths.radToDeg = function (rads) {
return(rads * 57.2957795130823);
};
MovieClip.prototype.drawCross = function (x, y, colour) {
if (colour != undefined) {
this.lineStyle(1, colour, 100);
} else {
this.lineStyle(1, 16711935, 100);
}
var _local2 = 7;
this.moveTo(x - _local2, y);
this.lineTo(x + _local2, y);
this.moveTo(x, y - _local2);
this.lineTo(x, y + _local2);
};
MovieClip.prototype.drawVector = function (v, scale, colour) {
if (colour != undefined) {
this.lineStyle(1, colour, 100);
} else {
this.lineStyle(1, 65280, 100);
}
if (scale == undefined) {
scale = 1;
}
this.moveTo(v.x, v.y);
this.lineTo(v.x + (v.dx * scale), v.y + (v.dy * scale));
};
MovieClip.prototype.curvedRectangle = function (p_nX1, p_nY1, p_nX2, p_nY2, p_nR) {
var _local2 = ((p_nR == undefined) ? 0 : (p_nR));
var _local7 = _local2 * 2;
var _local10 = Math.abs(p_nX2 - p_nX1) - _local7;
var _local8 = Math.abs(p_nY2 - p_nY1) - _local7;
this.moveTo(p_nX1 + _local2, p_nY1);
this.lineTo(p_nX2 - _local2, p_nY1);
this.curveTo(p_nX2, p_nY1, p_nX2, p_nY1 + _local2);
this.lineTo(p_nX2, p_nY2 - _local2);
this.curveTo(p_nX2, p_nY2, p_nX2 - _local2, p_nY2);
this.lineTo(p_nX1 + _local2, p_nY2);
this.curveTo(p_nX1, p_nY2, p_nX1, p_nY2 - _local2);
this.lineTo(p_nX1, p_nY1 + _local2);
this.curveTo(p_nX1, p_nY1, p_nX1 + _local2, p_nY1);
};
MovieClip.prototype.drawSquare = function (x, y, w, h) {
this.moveTo(x, y);
this.lineTo(x + w, y);
this.lineTo(x + w, y + h);
this.lineTo(x, y + h);
this.lineTo(x, y);
};
MovieClip.prototype.drawFilledSquare = function (x, y, w, h, colour, alpha) {
this.beginFill(colour, alpha);
this.drawSquare(x, y, w, h);
this.endFill();
};
MovieClip.prototype.drawCircle = function (x, y, r) {
var _local6 = r * 0.414213562373095;
var _local5 = (r * Math.SQRT2) / 2;
this.moveTo(x + r, y);
this.curveTo(x + r, y + _local6, x + _local5, y + _local5);
this.curveTo(x + _local6, y + r, x, y + r);
this.curveTo(x - _local6, y + r, x - _local5, y + _local5);
this.curveTo(x - r, y + _local6, x - r, y);
this.curveTo(x - r, y - _local6, x - _local5, y - _local5);
this.curveTo(x - _local6, y - r, x, y - r);
this.curveTo(x + _local6, y - r, x + _local5, y - _local5);
this.curveTo(x + r, y - _local6, x + r, y);
};
MovieClip.prototype.drawFilledCircle = function (x, y, r, colour, alpha) {
this.beginFill(colour, alpha);
this.drawCircle(x, y, r);
this.endFill();
};
MovieClip.prototype.drawCircleSegment = function (x, y, r, startAngle, endAngle, stepAngle) {
degToRad = (Math.PI/180);
while (endAngle < startAngle) {
endAngle = endAngle + 360;
}
this.moveTo(x, y);
this.lineTo(x + (r * Math.cos(startAngle * degToRad)), x + (r * Math.sin(startAngle * degToRad)));
var _local2 = startAngle + stepAngle;
while (_local2 < (endAngle - stepAngle)) {
var _local3 = _local2 * degToRad;
this.lineTo(x + (r * Math.cos(_local3)), x + (r * Math.sin(_local3)));
_local2 = _local2 + stepAngle;
}
this.lineTo(x + (r * Math.cos(endAngle * degToRad)), x + (r * Math.sin(endAngle * degToRad)));
this.lineTo(x, y);
};
MovieClip.prototype.drawFilledCircleSegment = function (x, y, r, startAngle, endAngle, stepAngle, colour, alpha) {
this.beginFill(colour, alpha);
this.drawCircleSegment(x, y, r, startAngle, endAngle, stepAngle);
this.endFill();
};
MovieClip.prototype.drawSmoothCurveThroughPoints = function (wibbleFactor, startAngle, points) {
this.moveTo(points[0].x, points[0].y);
var _local13 = points[0].x - Math.cos((Math.PI * startAngle) / 180);
var _local12 = points[0].y - Math.sin((Math.PI * startAngle) / 180);
var _local2 = 1;
while (_local2 < points.length) {
var _local5 = points[_local2 - 1].x - _local13;
var _local4 = points[_local2 - 1].y - _local12;
var _local8 = Maths.vectorLength(_local5, _local4);
var _local10 = points[_local2 - 1].x - points[_local2].x;
var _local9 = points[_local2 - 1].y - points[_local2].y;
var _local11 = Maths.vectorLength(_local10, _local9);
cScale = 0;
if (_local8 != 0) {
cScale = ((0.5 + wibbleFactor) * _local11) / _local8;
}
var _local7 = points[_local2 - 1].x + (_local5 * cScale);
var _local6 = points[_local2 - 1].y + (_local4 * cScale);
this.curveTo(_local7, _local6, points[_local2].x, points[_local2].y);
_local13 = _local7;
_local12 = _local6;
_local2++;
}
};
MovieClip.prototype.drawSmoothCurveNearPoints = function (points) {
this.moveTo(points[0].x, points[0].y);
var _local2 = 1;
while (_local2 < (points.length - 1)) {
var _local6 = points[_local2].x - points[_local2 + 1].x;
var _local5 = points[_local2].y - points[_local2 + 1].y;
var _local4 = points[_local2].x + (_local6 / 2);
var _local7 = points[_local2].y + (_local5 / 2);
this.curveTo(_local4, _local7, points[_local2].x, points[_local2].y);
_local2++;
}
this.lineTo(points[points.length - 1].x, points[points.length - 1].y);
};
MovieClip.prototype.hitTestShape = function (clip, alphaTolerance) {
if (alphaTolerance == undefined) {
alphaTolerance = 255;
}
var _local5 = this.getBounds(_root);
var _local4 = clip.getBounds(_root);
if (((_local5.xMax < _local4.xMin) || (_local4.xMax < _local5.xMin)) || ((_local5.yMax < _local4.yMin) || (_local4.yMax < _local5.yMin))) {
return(undefined);
}
var _local3 = {};
_local3.xMin = Math.max(_local5.xMin, _local4.xMin);
_local3.xMax = Math.min(_local5.xMax, _local4.xMax);
_local3.yMin = Math.max(_local5.yMin, _local4.yMin);
_local3.yMax = Math.min(_local5.yMax, _local4.yMax);
var _local8 = new flash.display.BitmapData(_local3.xMax - _local3.xMin, _local3.yMax - _local3.yMin, false);
var _local6 = this.transform.concatenatedMatrix;
_local6.tx = _local6.tx - _local3.xMin;
_local6.ty = _local6.ty - _local3.yMin;
_local8.draw(this, _local6, new flash.geom.ColorTransform(1, 1, 1, 1, 255, -255, -255, alphaTolerance));
_local6 = clip.transform.concatenatedMatrix;
_local6.tx = _local6.tx - _local3.xMin;
_local6.ty = _local6.ty - _local3.yMin;
_local8.draw(clip, _local6, new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, alphaTolerance), "difference");
var _local7 = _local8.getColorBoundsRect(4294967295, 4278255615);
if (_local7.width == 0) {
return(undefined);
}
_local7.x = _local7.x + _local3.xMin;
_local7.y = _local7.y + _local3.yMin;
return(_local7);
};
MovieClip.prototype.localToLocal = function (clip, x, y) {
var _local2 = {x:x, y:y};
clip.localToGlobal(_local2);
this.globalToLocal(_local2);
return(_local2);
};
MovieClip.prototype.holderToLocal = function (clip) {
var _local2 = {x:0, y:0};
this.localToGlobal(_local2);
clip.globalToLocal(_local2);
return(_local2);
};
MovieClip.prototype.holderToGlobal = function () {
var _local2 = {x:0, y:0};
this.localToGlobal(_local2);
return(_local2);
};
MovieClip.prototype.makeSound = function (soundLinkage, depth) {
var _local2 = this.createEmptyMovieClip((((("soundClip_" + soundLinkage) + "_") + depth) + "_") + Math.floor(Maths.randomNum(1000000, 9000000)), depth);
_local2.sound = new Sound(_local2);
_local2.sound.attachSound(soundLinkage);
_local2.sound.sourceClip = _local2;
return(_local2.sound);
};
MovieClip.prototype.addHolder = function (x, y) {
var _local3 = this.getNextHighestDepth();
var _local2 = this.createEmptyMovieClip("holder_" + _local3, _local3);
_local2._x = x;
_local2._y = y;
return(_local2);
};
MovieClip.prototype.attachMovieClip = function (linkage, x, y) {
if (x == undefined) {
x = 0;
}
if (y == undefined) {
y = 0;
}
var _local3 = this.getNextHighestDepth();
this.attachMovie(linkage, (linkage + "_") + _local3, _local3);
var _local2 = this[(linkage + "_") + _local3];
_local2._x = x;
_local2._y = y;
return(_local2);
};
MovieClip.prototype.drawLighteningBolt = function (sx, sy, fx, fy, segLength, endSeparation) {
var _local15 = fx - sx;
var _local14 = fy - sy;
var _local13 = Maths.vectorLength(_local15, _local14);
var _local12 = _local15 / _local13;
var _local11 = _local14 / _local13;
var _local6 = -_local11;
var _local5 = _local12;
var _local8 = Math.ceil(_local13 / segLength);
if (_local8 < 3) {
_local8 = 3;
}
segLength = _local13 / _local8;
var _local3 = [];
_local3[0] = {x:sx, y:sy, dist:0, sep:endSeparation};
var _local4 = 1;
while (_local4 < (_local8 - 1)) {
_local3.push({x:sx + ((_local4 * segLength) * _local12), y:sy + ((_local4 * segLength) * _local11), dist:Maths.randomNum(-17, 17), sep:Maths.randomNum(2, 10)});
_local4++;
}
_local3[_local3.length] = {x:fx, y:fy, dist:0, sep:endSeparation};
this.moveTo(sx, sy);
_local4 = 0;
while (_local4 < _local3.length) {
var _local2 = _local3[_local4];
this.lineTo((_local2.x + (_local6 * _local2.dist)) + (_local6 * _local2.sep), (_local2.y + (_local5 * _local2.dist)) + (_local5 * _local2.sep));
_local4++;
}
_local4 = _local3.length - 1;
while (_local4 >= 0) {
var _local2 = _local3[_local4];
this.lineTo((_local2.x + (_local6 * _local2.dist)) - (_local6 * _local2.sep), (_local2.y + (_local5 * _local2.dist)) - (_local5 * _local2.sep));
_local4--;
}
this.lineTo(sx, sy);
};
var Keys = new Object();
Keys.LeftMouse = 1;
Keys._mouseDown = false;
Keys.onMouseDown = function () {
this._mouseDown = true;
};
Keys.onMouseUp = function () {
this._mouseDown = false;
};
Mouse.addListener(Keys);
Keys.mouseDown = function () {
return(this._mouseDown);
};
Keys.CursorLeft = 37;
Keys.CursorRight = 39;
Keys.CursorUp = 38;
Keys.CursorDown = 40;
Keys.Escape = 27;
Keys.Backspace = 8;
Keys.Tab = 9;
Keys.Enter = 13;
Keys.Shift = 16;
Keys.Control = 17;
Keys.Alt = 18;
Keys.CapsLock = 20;
Keys.Spacebar = 32;
Keys.PageUp = 33;
Keys.PageDown = 34;
Keys.End = 35;
Keys.Home = 36;
Keys.PrintScr = 44;
Keys.ScrollLock = 145;
Keys.Pause = 19;
Keys.Insert = 45;
Keys.Delete = 46;
Keys.NumLock = 144;
Keys.Semicolon = 186;
Keys.Equals = 187;
Keys.Minus = 189;
Keys.Slash = 191;
Keys.Apostrophe = 192;
Keys.BackTick = 223;
Keys.BackSlash = 220;
Keys.Hash = 222;
Keys.Comma = 188;
Keys.Period = 190;
Keys.SquareOpen = 219;
Keys.SquareClose = 221;
Keys.F1 = 112;
Keys.F2 = 113;
Keys.F3 = 114;
Keys.F4 = 115;
Keys.F5 = 116;
Keys.F6 = 117;
Keys.F7 = 118;
Keys.F8 = 119;
Keys.F9 = 120;
Keys.F10 = undefined;
Keys.F11 = 122;
Keys.F12 = 123;
Keys.Num0 = 96;
Keys.Num1 = 97;
Keys.Num2 = 98;
Keys.Num3 = 99;
Keys.Num4 = 100;
Keys.Num5 = 101;
Keys.Num6 = 102;
Keys.Num7 = 103;
Keys.Num8 = 104;
Keys.Num9 = 105;
Keys.NumMultiply = 106;
Keys.NumAdd = 107;
Keys.NumEnter = 13;
Keys.NumMinus = 109;
Keys.NumPeriod = 110;
Keys.NumDivide = 111;
Keys.A = 65;
Keys.B = 66;
Keys.C = 67;
Keys.D = 68;
Keys.E = 69;
Keys.F = 70;
Keys.G = 71;
Keys.H = 72;
Keys.I = 73;
Keys.J = 74;
Keys.K = 75;
Keys.L = 76;
Keys.M = 77;
Keys.N = 78;
Keys.O = 79;
Keys.P = 80;
Keys.Q = 81;
Keys.R = 82;
Keys.S = 83;
Keys.T = 84;
Keys.U = 85;
Keys.V = 86;
Keys.W = 87;
Keys.X = 88;
Keys.Y = 89;
Keys.Z = 90;
Keys.Key0 = 48;
Keys.Key1 = 49;
Keys.Key2 = 50;
Keys.Key3 = 51;
Keys.Key4 = 52;
Keys.Key5 = 53;
Keys.Key6 = 54;
Keys.Key7 = 55;
Keys.Key8 = 56;
Keys.Key9 = 57;
Sounds.prototype.registerSound = function (linkage, defaultVolume) {
if (defaultVolume == undefined) {
defaultVolume = 100;
}
var _local4 = this.clip.getNextHighestDepth();
var _local2 = this.clip.createEmptyMovieClip((linkage + "_") + _local4, _local4);
_local2.sound = new Sound(_local2);
_local2.sound.defaultVolume = defaultVolume;
_local2.sound.clip = _local2;
_local2.sound.attachSound(linkage);
_local2.sound.setVolume(defaultVolume);
this.sounds[linkage] = _local2.sound;
this.sounds[linkage].looping = false;
this.sounds[linkage].playing = false;
this.sounds[linkage].onSoundComplete = function () {
if (this.looping) {
this.start();
} else {
this.playing = false;
}
};
if (this.sounds[linkage].duration == undefined) {
trace(("Sounds: Registered sound '" + linkage) + "' not found in library");
}
return(_local2.sound);
};
Sounds.prototype.registerGroup = function (groupID, arrGroupIDs) {
var _local2 = 0;
while (_local2 < arrGroupIDs.length) {
if (this.sounds[arrGroupIDs[_local2]] == undefined) {
trace(((("Sounds: Group '" + groupID) + "' contains non-registered sound ID '") + arrGroupIDs[_local2]) + "'");
}
_local2++;
}
this.groups[groupID] = arrGroupIDs;
};
Sounds.prototype.play = function (id, volume, loop, soundPosition) {
if (this.muted) {
return(undefined);
}
if (loop != undefined) {
this.sounds[id].looping = loop;
}
if (soundPosition == undefined) {
soundPosition = 0;
}
if (this.groups[id] != undefined) {
id = this.groups[id][Maths.randomInt(0, this.groups[id].length - 1)];
}
if (this.sounds[id] == undefined) {
trace(("Sounds: Trying to play unregistered sound '" + id) + "'");
}
if (volume < 0) {
volume = 0;
}
if (volume > 100) {
volume = 100;
}
if (volume != undefined) {
this.sounds[id].setVolume(volume);
}
this.sounds[id].start(soundPosition);
this.sounds[id].playing = true;
};
Sounds.prototype.stop = function (id) {
if (this.groups[id] != undefined) {
var _local2 = 0;
while (_local2 < this.groups[id].length) {
this.stop(this.groups[id][_local2]);
_local2++;
}
return(undefined);
}
if (this.sounds[id] == undefined) {
trace(("Sounds: Trying to stop unregistered sound '" + id) + "'");
}
this.sounds[id].looping = false;
this.sounds[id].stop();
this.sounds[id].playing = false;
};
Sounds.prototype.volume = function (id, volume) {
if (this.sounds[id] == undefined) {
trace(("Sounds: Trying to set volume of unregistered sound '" + id) + "'");
}
this.sounds[id].setVolume(volume);
};
Sounds.prototype.fadeTo = function (id, volume, dVol) {
if (this.sounds[id] == undefined) {
trace(("Sounds: Trying to fade volume of unregistered sound '" + id) + "'");
}
if (dVol == undefined) {
dVol = 1;
}
this.sounds[id].dVol = Math.ceil(Math.abs(dVol));
this.sounds[id].targetVol = volume;
};
Sounds.prototype.stopAllSounds = function () {
for (id in this.sounds) {
this.stop(id);
}
};
Sounds.prototype.isPlaying = function (id) {
if (this.groups[id] != undefined) {
var _local2 = 0;
while (_local2 < this.groups[id].length) {
if (this.sounds[this.groups[id][_local2]].playing) {
return(true);
}
_local2++;
}
return(false);
}
if (this.sounds[id] == undefined) {
trace(("Sounds: Testing isPlaying(" + id) + "'): Unregistered");
}
return(this.sounds[id].playing);
};
Sounds.prototype.fadeOutAllSounds = function (dVol) {
for (id in this.sounds) {
this.fadeTo(id, 0, dVol);
}
};
Sounds.prototype.toggleMute = function () {
this.muted = !this.muted;
if (this.muted) {
this.stopAllSounds();
}
};
Sounds.prototype.setMute = function (muted) {
this.muted = muted;
if (this.muted) {
this.stopAllSounds();
}
};
Sounds.prototype.registerSources = function (listenerClip, arrSourceClips, id, maxAudibleRange) {
var _local2 = {};
_local2.listener = listenerClip;
_local2.sources = arrSourceClips;
_local2.sound = this.sounds[id];
_local2.maxRange = maxAudibleRange;
this.play(id, 0, true);
this.loops.push(_local2);
return(_local2.sources);
};
Sounds.prototype.removeAllSources = function () {
var _local2 = 0;
while (_local2 < this.loops.length) {
var _local3 = this.loops[_local2];
_local3.sound.stop();
_local2++;
}
this.loops = [];
};
Sounds.prototype.evtEnterFrame = function () {
var _local10 = 0;
while (_local10 < this.loops.length) {
var _local3 = this.loops[_local10];
var _local7 = _local3.maxRange;
var _local8 = _local3.listener.holderToGlobal();
var _local2 = 0;
while (_local2 < _local3.sources.length) {
var _local4 = _local3.sources[_local2];
if ((_local4 == undefined) || (_local4.notSoundSource == true)) {
_local3.sources.splice(_local2, 1);
_local2--;
} else {
var _local5 = _local4.holderToGlobal();
var _local6 = Maths.distance(_local8.x, _local8.y, _local5.x, _local5.y);
if (_local6 < _local7) {
_local7 = _local6;
}
}
_local2++;
}
_local3.sound.setVolume(Math.floor((100 * (_local3.maxRange - _local7)) / _local3.maxRange));
_local10++;
}
for (id in this.sounds) {
if (this.sounds[id].targetVol != undefined) {
var _local9 = this.sounds[id].getVolume();
var _local11 = _local9 - this.sounds[id].targetVol;
if (Math.abs(_local11) < this.sounds[id].dVol) {
this.sounds[id].setVolume(this.sounds[id].targetVol);
this.sounds[id].targetVol = undefined;
} else {
this.sounds[id].setVolume(((_local11 > 0) ? (_local9 - this.sounds[id].dVol) : (_local9 + this.sounds[id].dVol)));
}
}
}
};
Physics.prototype.step = function () {
if (this.paused == true) {
return(undefined);
}
Profiler.label("Phx: Start");
var _local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
_local15.hasHitSurface = false;
if (!_local15.fixed) {
_local15.prevX = _local15.x;
_local15.prevY = _local15.y;
var _local8 = _local15.sumSpringForces();
_local8.x = _local8.x + (this.gravityX * _local15.mass);
_local8.y = _local8.y + (this.gravityY * _local15.mass);
_local8.x = _local8.x + _local15.extForceX;
_local8.y = _local8.y + _local15.extForceY;
_local15.extForceX = 0;
_local15.extForceY = 0;
_local15.vx = _local15.vx + (_local8.x / _local15.mass);
_local15.vy = _local15.vy + (_local8.y / _local15.mass);
}
_local16++;
}
if (this.attractingMasses) {
_local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
if (_local15.attractionMass != 0) {
_local15.applyAttractionForces();
}
_local16++;
}
}
_local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
if (!_local15.fixed) {
if (_local15.vx > _local15.friction) {
_local15.vx = _local15.vx - _local15.friction;
} else if (_local15.vx < (-_local15.friction)) {
_local15.vx = _local15.vx + _local15.friction;
} else {
_local15.vx = 0;
}
if (_local15.vy > _local15.friction) {
_local15.vy = _local15.vy - _local15.friction;
} else if (_local15.vy < (-_local15.friction)) {
_local15.vy = _local15.vy + _local15.friction;
} else {
_local15.vy = 0;
}
_local15.vx = _local15.vx * this.drag;
_local15.vy = _local15.vy * this.drag;
}
_local16++;
}
_local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
_local15.x = _local15.x + _local15.vx;
_local15.y = _local15.y + _local15.vy;
_local16++;
}
this.masses.sort(massSort, Array.NUMERIC);
_local16 = 0;
while (_local16 < this.masses.length) {
this.masses[_local16].testedSet = [];
_local16++;
}
var _local10 = [];
if (this.collidableMasses) {
_local16 = 0;
while (_local16 < this.masses.length) {
var _local12 = this.masses[_local16];
var _local20 = (this.biggestMassRadius + _local12.radius) + 1;
var _local17 = _local12.x + _local20;
_local12.hasHitMass = false;
var _local2 = _local16 + 1;
while (_local2 < this.masses.length) {
var _local11 = this.masses[_local2];
if (_local11.x > _local17) {
_local2 = this.masses.length;
} else if ((((((_local12 != undefined) && (_local11 != undefined)) && (_local12.testedSet[_local2] == undefined)) && (_local12.collisionSet != undefined)) && (_local11.collisionSet != undefined)) && (_local12.collisionSet != _local11.collisionSet)) {
var _local7 = _local12.x - _local11.x;
var _local6 = _local12.y - _local11.y;
var _local14 = (_local7 * _local7) + (_local6 * _local6);
var _local13 = (_local12.radius + _local11.radius) * (_local12.radius + _local11.radius);
if (_local14 < _local13) {
_local10.push({massA:_local12, massB:_local11});
}
_local12.testedSet[_local2] = true;
_local11.testedSet[_local16] = true;
}
_local2++;
}
_local17 = _local12.x - _local20;
_local2 = _local16 - 1;
while (_local2 >= 0) {
var _local11 = this.masses[_local2];
if (_local11.x < _local17) {
_local2 = -1;
} else if ((((((_local12 != undefined) && (_local11 != undefined)) && (_local12.testedSet[_local2] == undefined)) && (_local12.collisionSet != undefined)) && (_local11.collisionSet != undefined)) && (_local12.collisionSet != _local11.collisionSet)) {
var _local7 = _local12.x - _local11.x;
var _local6 = _local12.y - _local11.y;
var _local14 = (_local7 * _local7) + (_local6 * _local6);
var _local13 = _local12.radiusSquared + _local11.radiusSquared;
if (_local14 < _local13) {
_local10.push({massA:_local12, massB:_local11});
}
_local12.testedSet[_local2] = true;
_local11.testedSet[_local16] = true;
}
_local2--;
}
_local16++;
}
}
_local10.sort(collisionSort);
_local16 = 0;
while (_local16 < _local10.length) {
var _local15 = _local10[_local16].massA;
_local15.hasHitMass = true;
_local15.resolveCollision(_local10[_local16].massB);
_local16++;
}
Profiler.label("Phx: Collide surfaces");
this.sortSurfaces();
_local16 = 0;
while (_local16 < this.masses.length) {
var _local5 = this.masses[_local16];
var _local3 = [];
var _local19 = _local5.x - _local5.radius;
var _local18 = _local5.x + _local5.radius;
if (_local5.fixed) {
} else {
var _local2 = 0;
while (_local2 < this.surfacesOrdered.length) {
var _local9 = this.surfacesOrdered[_local2];
if (_local9.x1 <= _local18) {
_local3.push(_local9);
} else {
_local2 = this.surfacesOrdered.length;
}
_local2++;
}
_local3.sort(surfaceRightSort, Array.NUMERIC);
_local2 = 0;
while (_local2 < _local3.length) {
var _local9 = _local3[_local2];
if (_local9.x2 >= _local19) {
_local9.handleCollision(_local5);
} else {
_local2 = _local3.length;
}
_local2++;
}
}
_local16++;
}
Profiler.label("Phx: Surfaces finished");
if (this.framePaintCallback) {
this.framePaintCallback();
}
if (this.defaultPaint) {
_local16 = 0;
while (_local16 < this.masses.length) {
var _local15 = this.masses[_local16];
_local15.clipRep._x = _local15.x;
_local15.clipRep._y = _local15.y;
_local16++;
}
_local16 = 0;
while (_local16 < this.springs.length) {
var _local4 = this.springs[_local16];
_local4.clipRep.clear();
_local4.clipRep.lineStyle(1, 16711680, 100);
_local4.clipRep.moveTo(_local4.mass1.x, _local4.mass1.y);
_local4.clipRep.lineTo(_local4.mass2.x, _local4.mass2.y);
_local16++;
}
}
Profiler.label("Phx: Finished");
};
Physics.prototype.sortSurfaces = function () {
if (!this.surfacesChanged) {
return(undefined);
}
this.surfacesChanged = false;
this.surfacesOrdered = [];
var _local2 = 0;
while (_local2 < this.surfaces.length) {
this.surfacesOrdered.push(this.surfaces[_local2]);
_local2++;
}
this.surfacesOrdered.sort(surfaceLeftSort, Array.NUMERIC);
};
Mass.prototype.setRadius = function (r) {
this.radius = r;
this.radiusSquared = this.radius * this.radius;
this.clipRep.clear();
this.clipRep.lineStyle(this.radius * 2, 255, 50);
this.clipRep.moveTo(0, 0);
this.clipRep.lineTo(0, 1);
};
Mass.prototype.removeMass = function () {
var _local2 = 0;
while (_local2 < this.springs.length) {
this.springs[_local2].removeSpring();
_local2--;
_local2++;
}
_local2 = 0;
while (_local2 < this.physics.masses.length) {
if (this == this.physics.masses[_local2]) {
this.physics.masses.splice(_local2, 1);
_local2 = this.physics.masses.length;
}
_local2++;
}
if (this.physics.defaultPaint) {
this.clipRep.removeMovieClip();
}
this.removed = true;
};
Mass.prototype.sumSpringForces = function () {
if (this.fixed) {
return({x:0, y:0});
}
var _local5 = {x:0, y:0};
var _local3 = 0;
while (_local3 < this.springs.length) {
var _local2;
var _local4 = this.springs[_local3];
if (this == _local4.mass1) {
_local2 = _local4.forceOnMass1();
} else {
_local2 = _local4.forceOnMass2();
}
_local5.x = _local5.x + _local2.x;
_local5.y = _local5.y + _local2.y;
_local3++;
}
return(_local5);
};
Mass.prototype.applyAttractionForces = function () {
var _local3 = 0;
while (_local3 < this.physics.masses.length) {
var _local2 = this.physics.masses[_local3];
if ((_local2.attractionMass && (this != _local2)) && (!_local2.fixed)) {
var _local4 = this.attractionForce(_local2);
_local2.vx = _local2.vx + (_local4.x / _local2.mass);
_local2.vy = _local2.vy + (_local4.y / _local2.mass);
}
_local3++;
}
};
Mass.prototype.attractionForce = function (otherMass) {
var _local5 = this.x - otherMass.x;
var _local4 = this.y - otherMass.y;
var _local3 = Maths.vectorLength(_local5, _local4);
_local5 = _local5 / _local3;
_local4 = _local4 / _local3;
var _local2 = (this.attractionMass * this.physics.attractionScale) / (_local3 * _local3);
if (Math.abs(_local2) > this.attractionMaxForce) {
_local2 = ((_local2 > 0) ? (this.attractionMaxForce) : (-this.attractionMaxForce));
}
return({x:_local5 * _local2, y:_local4 * _local2});
};
Mass.prototype.resolveCollision = function (otherMass) {
if ((this.collisionSet == undefined) || (this.collisionSet == otherMass.collisionSet)) {
return(undefined);
}
if (otherMass == undefined) {
return(undefined);
}
var _local9 = Maths.distance(this.x, this.y, otherMass.x, otherMass.y);
var _local3 = this.radius + otherMass.radius;
if (_local9 < _local3) {
var _local5 = (this.x + otherMass.x) / 2;
var _local4 = (this.y + otherMass.y) / 2;
var _local7 = this.x - _local5;
var _local6 = this.y - _local4;
var _local8 = Maths.vectorLength(_local7, _local6);
_local7 = _local7 / _local8;
_local6 = _local6 / _local8;
if ((!this.fixed) && (!otherMass.fixed)) {
this.x = _local5 + ((_local7 * _local3) / 2);
this.y = _local4 + ((_local6 * _local3) / 2);
otherMass.x = _local5 + ((_local7 * (-_local3)) / 2);
otherMass.y = _local4 + ((_local6 * (-_local3)) / 2);
} else {
if (this.fixed && (otherMass.fixed)) {
return(undefined);
}
if (!this.fixed) {
this.x = _local5 + ((_local7 * _local3) / 2);
this.y = _local4 + ((_local6 * _local3) / 2);
}
if (!otherMass.fixed) {
otherMass.x = _local5 + ((_local7 * (-_local3)) / 2);
otherMass.y = _local4 + ((_local6 * (-_local3)) / 2);
}
}
this.collisionX = _local5;
this.collisionY = _local4;
otherMass.collisionX = _local5;
otherMass.collisionY = _local4;
this.respondToCollision(otherMass);
this.collisionCallback(otherMass);
otherMass.collisionCallback(this);
}
};
Mass.prototype.respondToCollision = function (otherMass) {
var _local7 = Math.atan2(this.y - otherMass.y, this.x - otherMass.x);
var _local4 = Math.cos(_local7);
var _local3 = Math.sin(_local7);
var _local6 = (this.vx * _local4) + (this.vy * _local3);
var _local9 = (this.vy * _local4) - (this.vx * _local3);
var _local5 = (otherMass.vx * _local4) + (otherMass.vy * _local3);
var _local8 = (otherMass.vy * _local4) - (otherMass.vx * _local3);
var _local12 = (this.mass * _local6) + (otherMass.mass * _local5);
var _local13 = _local6 - _local5;
var _local10 = (_local12 + (this.mass * _local13)) / (this.mass + otherMass.mass);
var _local11 = (_local10 - _local6) + _local5;
_local6 = _local11;
_local5 = _local10;
if (!this.fixed) {
this.vx = (_local6 * _local4) - (_local9 * _local3);
this.vy = (_local9 * _local4) + (_local6 * _local3);
}
if (!otherMass.fixed) {
otherMass.vx = (_local5 * _local4) - (_local8 * _local3);
otherMass.vy = (_local8 * _local4) + (_local5 * _local3);
}
};
Spring.prototype.removeSpring = function () {
this.clipRep.removeMovieClip();
var _local2 = 0;
while (_local2 < this.mass1.springs.length) {
if (this == this.mass1.springs[_local2]) {
this.mass1.springs.splice(_local2, 1);
break;
}
_local2++;
}
_local2 = 0;
while (_local2 < this.mass2.springs.length) {
if (this == this.mass2.springs[_local2]) {
this.mass2.springs.splice(_local2, 1);
break;
}
_local2++;
}
_local2 = 0;
while (_local2 < this.physics.springs.length) {
if (this == this.physics.springs[_local2]) {
this.physics.springs.splice(_local2, 1);
return(undefined);
}
_local2++;
}
};
Spring.prototype.currentLength = function () {
var _local5 = this.mass1.x;
var _local3 = this.mass1.y;
var _local4 = this.mass2.x;
var _local2 = this.mass2.y;
return(Maths.distance(_local5, _local3, _local4, _local2));
};
Spring.prototype.currentExtension = function () {
return(this.currentLength() - this.naturalLength);
};
Spring.prototype.forceOnMass1 = function () {
var _local9 = this.mass1.x;
var _local7 = this.mass1.y;
var _local8 = this.mass2.x;
var _local6 = this.mass2.y;
var _local4 = _local8 - _local9;
var _local3 = _local6 - _local7;
var _local2 = Maths.vectorLength(_local4, _local3);
var _local11 = _local4 / _local2;
var _local10 = _local3 / _local2;
var _local12 = this.currentExtension() * this.k;
var _local14 = this.mass2.vx - this.mass1.vx;
var _local13 = this.mass2.vy - this.mass1.vy;
var _local15 = (this.damperK * Maths.dotProduct(_local14, _local13, _local4, _local3)) / _local2;
var _local5 = _local15 + _local12;
return({x:_local11 * _local5, y:_local10 * _local5});
};
Spring.prototype.forceOnMass2 = function () {
var _local2 = this.forceOnMass1();
return({x:-_local2.x, y:-_local2.y});
};
Surface.prototype.update = function () {
this.len = this.currentLength();
this.x = this.x1;
this.y = this.y1;
this.dx = this.x2 - this.x1;
this.dy = this.y2 - this.y1;
this.nx = this.dx / this.len;
this.ny = this.dy / this.len;
this.normX = -this.ny;
this.normY = this.nx;
this.paint();
this.physics.surfacesChanged = true;
};
Surface.prototype.paint = function () {
this.clipRep.clear();
this.clipRep.lineStyle(1, 65535, 100);
this.clipRep.moveTo(this.x1, this.y1);
this.clipRep.lineTo(this.x2, this.y2);
};
Surface.prototype.currentLength = function () {
return(Maths.vectorLength(this.x1, this.y1, this.x2, this.y2));
};
Surface.prototype.removeSurface = function () {
this.clipRep.removeMovieClip();
var _local2 = 0;
while (_local2 < this.physics.surfaces.length) {
if (this == this.physics.surfaces[_local2]) {
this.physics.surfaces.splice(_local2, 1);
this.physics.surfacesChanged = true;
return(undefined);
}
_local2++;
}
};
Surface.prototype.handleCollision = function (objMass) {
var _local4 = {};
_local4.dx = objMass.x - this.x1;
_local4.dy = objMass.y - this.y1;
var _local13 = Maths.dotProduct(_local4.dx, _local4.dy, this.dx, this.dy);
var _local2 = {x:this.x1, y:this.y1, dx:_local4.dx, dy:_local4.dy};
if (_local13 >= 0) {
var _local5 = {};
_local5.dx = objMass.x - this.x2;
_local5.dy = objMass.y - this.y2;
_local13 = Maths.dotProduct(_local5.dx, _local5.dy, this.dx, this.dy);
_local2 = {x:this.x2, y:this.y2, dx:_local5.dx, dy:_local5.dy};
if (_local13 <= 0) {
var _local11 = {dx:this.normX, dy:this.normY};
_local2 = Maths.vectorProject(_local4, _local11);
_local2.x = objMass.x - _local2.dx;
_local2.y = objMass.y - _local2.dy;
}
}
var _local8 = Maths.vectorLength(_local2.dx, _local2.dy);
var _local7 = objMass.radius - _local8;
if (_local7 >= 0) {
objMass.hasHitSurface = true;
_local2.nx = _local2.dx / _local8;
_local2.ny = _local2.dy / _local8;
objMass.x = objMass.x + (_local7 * _local2.nx);
objMass.y = objMass.y + (_local7 * _local2.ny);
var _local12 = {dx:_local2.dy, dy:-_local2.dx};
var _local10 = {dx:objMass.vx, dy:objMass.vy};
var _local6 = Maths.vectorProject(_local10, _local2);
var _local9 = Maths.vectorProject(_local10, _local12);
objMass.collisionNormal = {x:_local6.dx, y:_local6.dy};
objMass.vx = ((-this.restitution) * _local6.dx) + (this.friction * _local9.dx);
objMass.vy = ((-this.restitution) * _local6.dy) + (this.friction * _local9.dy);
}
};
SpringBox.prototype.getPosition = function () {
pos = {x:0, y:0, rRad:0, rDeg:0};
pos.x = (((this.m_tl.x + this.m_tr.x) + this.m_bl.x) + this.m_br.x) / 4;
pos.y = (((this.m_tl.y + this.m_tr.y) + this.m_bl.y) + this.m_br.y) / 4;
var _local3 = (this.frontLeft.x + this.frontRight.x) / 2;
var _local2 = (this.frontLeft.y + this.frontRight.y) / 2;
var _local5 = _local3 - pos.x;
var _local4 = _local2 - pos.y;
pos.rRad = Math.atan2(_local4, _local5);
pos.rDeg = Maths.radToDeg(pos.rRad);
return(pos);
};
SpringLine.prototype.getPosition = function () {
pos = {x:0, y:0, rRad:0, rDeg:0};
pos.x = (this.m_b.x + this.m_f.x) / 2;
pos.y = (this.m_b.y + this.m_f.y) / 2;
var _local3 = this.m_f.x;
var _local2 = this.m_f.y;
var _local5 = _local3 - pos.x;
var _local4 = _local2 - pos.y;
pos.rRad = Math.atan2(_local4, _local5);
pos.rDeg = Maths.radToDeg(pos.rRad);
return(pos);
};
var achievements = [{dummy:true}, {idx:1, complete:false, id:"hat_get", moID:"hat_get", title:"Hat Get", description:"A shiny new science-hat! Suits you sir, suits you."}, {idx:2, complete:false, id:"first_bender", moID:"on_a_bender", title:"On A Bender", description:"Bend reality with the power of your mind, with a little help from your new hat"}, {idx:3, complete:false, id:"death_100", moID:"bring_more_monkeys", title:"Bring More Infinite Monkeys", description:"Guide 30 monkeys to their doom. It's not cruel, we have infinitely many of them."}, {idx:4, complete:false, id:"broke_camera", moID:"destructive_tendencies", title:"Destructive Tendencies", description:"Bring justice to one of the oppressive cameras. Bend it 'til it breaks!"}, {idx:5, complete:false, id:"secret_get", moID:"secret_get", title:"Secret Get", description:"Find your first hidden secret. How observant are you?"}, {idx:6, complete:false, id:"sponsor_click", moID:"i_m_not_playing_anymore", title:"I'm Not Playing Anymore", description:"Click the MORE GAMES link or look at the walkthrough."}, {idx:7, complete:false, id:"happysaw", moID:"happysaw_dodge", title:"Happysaw Dodge", description:"Evade the Spinsharp 9000 to get to test-cave 6."}, {idx:8, complete:false, id:"found_lab", moID:"lab_rat", title:"Lab Rat", description:"Make your way all the way to the scientist's lab."}, {idx:9, complete:false, id:"found_sewer", moID:"sewer_rat", title:"Sewer Rat", description:"Find the sewer system beneath the test-caves (hint: look for a drain)."}, {idx:10, complete:false, id:"gone_bananas", moID:"gone_bananas", title:"Gone Bananas", description:"Grab every bunch of bananas on one run through of the game."}, {idx:11, complete:false, id:"all_secrets", moID:"secret_sleuth", title:"Secret Sleuth", description:"Find every secret in one run through of the game (hint: take the revenge path)."}, {idx:12, complete:false, id:"all_cameras", moID:"destruction_ocd", title:"Destruction OCD", description:"Smash everything you can in one run through (hint: take the revenge path)."}, {idx:13, complete:false, id:"hasty_escape", moID:"in_a_rush", title:"I Don't Have Time For This", description:"Complete the game in under 5 minutes (any ending you want)."}, {idx:14, complete:false, id:"no_deaths", moID:"every_monkey_is_precious", title:"Every Monkey Is Precious", description:"Complete the game without any monkey deaths (any ending you want)."}, {idx:15, complete:false, id:"found_eric", moID:"discover_eric", title:"Discover Eric", description:"Find and click Eric the cat somewhere in the game."}, {idx:16, complete:false, id:"end_clonemaster", moID:"well_trained_monkey", title:"Well Trained Monkey", description:"Finish the game by doing exactly as the crazed scientist asks. There's a good monkey."}, {idx:17, complete:false, id:"end_revenge", moID:"vengeful_monkey", title:"Vengeful Monkey", description:"Finish the game by destroying the lab. Self sacrifice FTW."}, {idx:18, complete:false, id:"end_escape", moID:"prison_break_monkey", title:"Prison Break Monkey", description:"Find the quick and dirty way out of the sewer to finish the game a free monkey, but alone."}, {idx:19, complete:false, id:"end_emancipator", moID:"monkey_emancipator", title:"Monkey Emancipator", description:"Take the long hard path through the sewer to free all the infinite monkeys."}, {idx:20, complete:false, id:"overachiever", moID:"infinite_achievements", title:"Infinite Achievements", description:"Collect all other achievements. Go on, you know you want to."}];
var curMusic = "";
Options.prototype.initialise = function () {
this.fps = false;
this.quality = "high";
this.shadows = true;
this.lights = true;
this.decor = true;
this.water = true;
this.arm = true;
this.dialogue = true;
this.plasma = true;
this.lightening = true;
this.swirls = true;
this.hints = true;
this.blood = true;
};
Options.prototype.updateOptions = function () {
var _local3 = _root.game.objLevel.clip.ui.options.panel;
_local3.chkFPS.gotoAndStop((this.fps ? "on" : "off"));
_local3.chkQuality.gotoAndStop(this.quality);
_local3.chkShadows.gotoAndStop((this.shadows ? "on" : "off"));
_local3.chkLights.gotoAndStop((this.lights ? "on" : "off"));
_local3.chkWater.gotoAndStop((this.water ? "on" : "off"));
_local3.chkArm.gotoAndStop((this.arm ? "on" : "off"));
_local3.chkDialogue.gotoAndStop((this.dialogue ? "on" : "off"));
_local3.chkPlasma.gotoAndStop((this.plasma ? "on" : "off"));
_local3.chkLightening.gotoAndStop((this.lightening ? "on" : "off"));
_local3.chkSwirls.gotoAndStop((this.swirls ? "on" : "off"));
_local3.chkHints.gotoAndStop((this.hints ? "on" : "off"));
_local3.chkBlood.gotoAndStop((this.blood ? "on" : "off"));
};
Options.prototype.readOptions = function () {
var _local3 = _root.game.objLevel.clip.ui.options.panel;
this.fps = _local3.chkFPS.value;
this.quality = _local3.chkQuality.value;
this.shadows = _local3.chkShadows.value;
this.lights = _local3.chkLights.value;
this.water = _local3.chkWater.value;
this.arm = _local3.chkArm.value;
this.dialogue = _local3.chkDialogue.value;
this.plasma = _local3.chkPlasma.value;
this.lightening = _local3.chkLightening.value;
this.swirls = _local3.chkSwirls.value;
this.hints = _local3.chkHints.value;
this.blood = _local3.chkBlood.value;
_root._quality = this.quality;
this.setupLevel();
};
Options.prototype.setupLevel = function () {
var _local5 = _root.game.objLevel.clip;
_root._quality = this.quality;
_local5.shadows._visible = this.shadows;
_local5.lights._visible = this.lights;
_local5.decor._visible = this.decor;
_local5.warphints._visible = this.hints;
_local5.water._visible = this.water;
_local5.bloodHolder._visible = this.blood;
_local5.bloodClip._visible = this.blood;
_local5.deploy._visible = this.arm;
_local5.ui.speech._visible = this.dialogue;
_local5.ui.fps._visible = this.fps;
var _local3 = 0;
while (_local3 < _root.game.objLevel.arrShots.length) {
var _local4 = _root.game.objLevel.arrShots[_local3];
this.setupShot(_local4);
_local3++;
}
};
Options.prototype.setupShot = function (shot) {
shot.shotMarker.swirl1._visible = this.swirls;
shot.shotMarker.swirl2._visible = this.swirls;
shot.shotMarker.swirl3._visible = this.swirls;
if (this.swirls) {
shot.shotMarker.play();
shot.shotMarker.bubble.play();
} else {
shot.shotMarker.stop();
shot.shotMarker.bubble.stop();
}
};
MonkeyShotManager.prototype.evtEnterFrame = function () {
var _local3 = 0;
while (_local3 < this.shots.length) {
var _local2 = this.shots[_local3];
_local2.life--;
if (_local2.life <= 0) {
_local2.clip.removeMovieClip();
this.shots.splice(_local3, 1);
_local3--;
} else {
this.drawShot(_local2);
_local2.clip._alpha = (100 * _local2.life) / _local2.totalLife;
}
_local3++;
}
};
MonkeyShotManager.prototype.addShot = function (startX, startY, endX, endY) {
if (!_root.options.plasma) {
return(undefined);
}
var _local3 = {};
this.id++;
var _local10 = Maths.randomInt(10, 50);
var _local14 = Maths.randomInt(30, 90);
var _local8 = Maths.randomInt(200, 255);
_local3.colour = ((_local10 << 16) + (_local14 << 8)) + (_local8 << 0);
_local3.alpha = Maths.randomInt(60, 90);
_local3.startX = startX;
_local3.startY = startY;
_local3.endX = endX;
_local3.endY = endY;
_local3.totalLife = 20;
_local3.life = _local3.totalLife;
_local3.clip = this.clip.createEmptyMovieClip("shot" + this.id, this.id);
_local3.pointCount = Maths.randomInt(2, 5);
_local3.points = [];
_local3.velocities = [];
var _local7 = endX - startX;
var _local6 = endY - startY;
var _local15 = Maths.vectorLength(_local7, _local6);
_local3.points.push({x:startX, y:startY});
_local3.velocities.push({x:0, y:0});
var _local4 = 0;
while (_local4 < _local3.pointCount) {
var _local5 = (_local4 + 1) / (_local3.pointCount + 1);
var _local17 = (_local3.startX + (_local7 * _local5)) + Maths.randomNum(-7, 7);
var _local16 = (_local3.startY + (_local6 * _local5)) + Maths.randomNum(-7, 7);
_local3.points.push({x:_local17, y:_local16});
_local3.velocities.push({x:Maths.randomNum(-1, 1), y:Maths.randomNum(-1, 1)});
_local4++;
}
_local3.points.push({x:endX, y:endY});
_local3.velocities.push({x:0, y:0});
this.drawShot(_local3);
this.shots.push(_local3);
};
MonkeyShotManager.prototype.drawShot = function (shot) {
var _local1 = 0;
while (_local1 < shot.points.length) {
shot.points[_local1].x = shot.points[_local1].x + shot.velocities[_local1].x;
shot.points[_local1].y = shot.points[_local1].y + shot.velocities[_local1].y;
_local1++;
}
shot.clip.clear();
shot.clip.lineStyle(1, shot.colour, shot.alpha);
shot.clip.drawSmoothCurveNearPoints(shot.points);
};
Game.prototype.initialise = function () {
this.deliverMonkey = true;
this.hasHat = _root.hasHat;
this.screenID = _root.screenID;
this.armZone = true;
this.paused = false;
this.startTimeMs = getTimer();
this.predecessors = 0;
this.bananas = 0;
this.cameras = 0;
this.messages = 0;
this.newMonkeyID();
this.totalBananas = 83;
this.totalCameras = 24;
this.totalMessages = 12;
_global.objTrans.goto("level");
};
Game.prototype.newMonkeyID = function () {
this.monkeyID = Maths.randomInt(100000, 999999);
};
Game.prototype.setPause = function (val) {
this.paused = val;
};
Game.prototype.endGame = function (endingID) {
this.gameTimeMs = getTimer() - this.startTimeMs;
this.gameTimeSeconds = this.gameTimeMs / 1000;
trace("Game complete");
trace("Ending: " + endingID);
trace("Seconds: " + this.gameTimeSeconds);
_root.achieved("end_" + endingID);
if (this.predecessors == 0) {
_root.achieved("no_deaths");
}
if (this.gameTimeSeconds <= 300) {
_root.achieved("hasty_escape");
}
this.endingID = endingID;
_global.objTrans.goto("complete");
};
Game.prototype.setupEndScreen = function (clip) {
var _local5 = Math.floor(this.gameTimeSeconds / 60);
var _local6 = this.gameTimeSeconds - (_local5 * 60);
clip.gotoAndStop(this.endingID);
clip.btnHome.onRelease = function () {
_global.objTrans.goto("credits");
};
clip.txtTime.text = (("Game time: " + _local5) + ":") + Maths.formatNum(_local6, 2, 2);
clip.btnSponsor.onRelease = _root.linkSponsor;
clip.btnAchievements.onRelease = function () {
if (_root.isViralVersion) {
_root.linkSponsorGame();
} else {
_global.objTrans.goto("achievements");
}
};
};
MonkeyLevel.prototype.initialise = function (screenID) {
_root.game.screenID = screenID;
this.levelWidth = 570;
this.levelHeight = 390;
this.gravity = 0.6;
this.cameraHitDistanceSqr = 2025;
this.monkey.walkPPF = 1.5;
this.monkey.airPPF = 0.3;
this.monkey.jumpInitialPPF = 7;
this.monkey.jumpBoostPPF = 0.7;
this.monkey.jumpBoostMaxFrames = 10;
this.monkey.walkDrag = 0.8;
this.monkey.walkFriction = 0.4;
this.monkey.airDrag = 0.96;
this.monkey.maxGroundBoost = 20;
this.monkey.groundBoostFactor = 0.5;
this.monkey.lastDir = "right";
this.monkeyLeftX = 20;
this.monkeyRightX = 550;
this.monkeyTopY = 20;
this.monkey.crushLimit = 3;
this.monkey.fallJumpTollerance = 5;
this.longestRange = Maths.vectorLength(this.levelWidth, this.levelHeight);
this.fpsTime = getTimer();
this.clip.gotoAndStop(_root.game.screenID);
this.determineZones();
this.monkey.glow._visible = _root.game.lightZone;
if (screenID == 3) {
_root.maxWarps = 2;
}
if (screenID == 4) {
_root.maxWarps = 3;
}
this.frame = 0;
this.arrShots = [];
this.maxActiveShots = _root.maxWarps;
this.monkey.state = (_root.game.deliverMonkey ? "delivery" : "falling");
this.monkey.animState = this.monkey.state;
this.monkey.jumpFrames = 0;
this.monkey.fallJump = 0;
this.monkey.vx = 0;
this.monkey.vy = 0;
this.monkey.crushCount = 0;
this.speech = new Speech(this.clip.ui);
this.shotManager = new MonkeyShotManager(this.clip.shotEffects);
if (_root["bmpBlood" + _root.game.screenID] == undefined) {
_root["bmpBlood" + _root.game.screenID] = new flash.display.BitmapData(this.levelWidth, this.levelHeight, true, 0);
}
this.bmpBlood = _root["bmpBlood" + _root.game.screenID];
this.bloodBmpClip.attachBitmap(this.bmpBlood, 0, "never", false);
this.clip.bloodDrop.gotoAndStop(1);
var _local10 = new Array();
_local10 = _local10.concat([0.9, 0, 0, 0, 0]);
_local10 = _local10.concat([0, 0.8, 0, 0, 0]);
_local10 = _local10.concat([0, 0, 0.8, 0, 0]);
_local10 = _local10.concat([0, 0, 0, 1, 0]);
this.bloodFadeFilter = new flash.filters.ColorMatrixFilter(_local10);
if (_root.testStart && (this.clip.testStart)) {
this.monkey._x = this.clip.testStart._x;
this.monkey._y = this.clip.testStart._y;
}
if (_root.monkeyStartX != undefined) {
this.monkey._x = _root.monkeyStartX;
this.monkey._y = _root.monkeyStartY;
}
_root.monkeyStartX = this.monkey._x;
_root.monkeyStartY = this.monkey._y;
this.bendableClip._visible = false;
this.unbendableClip._visible = false;
this.clip.linkLeft._visible = false;
this.clip.linkRight._visible = false;
this.clip.linkDown._visible = false;
this.clip.hat.hit._visible = false;
this.clip.armTarget._visible = false;
this.clip.testStart._visible = false;
this.clip.ui.deathFX._visible = false;
this.bmpLevel = new flash.display.BitmapData(this.levelWidth, this.levelHeight, true, 0);
this.clip.bitmapHolder.attachBitmap(this.bmpLevel, 0);
if (_root.game.hasHat) {
this.clip.hat._visible = false;
}
if (_root.game.screenID == 139) {
this.clip.e0.stop();
}
this.updateUI();
_root.options.setupLevel();
this.clip.ui.btnOptions.onRelease = function () {
switch (_root.game.objLevel.monkey.state) {
case "standing" :
case "jumping" :
case "falling" :
_root.game.objLevel.clip.ui.options.gotoAndPlay("in");
_root.trackPoint("Options");
break;
}
};
this.clip.ui.btnMoreGames.onRelease = _root.linkMoreGames;
this.clip.ui.btnWalkthru.onRelease = _root.linkWalkthru;
if (_root.pickups == undefined) {
_root.pickups = {};
}
if (_root.pickups["r" + _root.game.screenID] == undefined) {
_root.pickups["r" + _root.game.screenID] = {};
}
var _local9 = 0;
var _local4 = this.clip["b" + _local9];
while (_local4 != undefined) {
_local4.hit._visible = false;
if (_root.pickups["r" + _root.game.screenID]["b" + _local9] == true) {
_local4._visible = false;
_local4.collected = true;
}
_local9++;
_local4 = this.clip["b" + _local9];
}
if (_root.hiddenMsgs == undefined) {
_root.hiddenMsgs = {};
}
if (this.clip.hidden) {
if (_root.hiddenMsgs["r" + _root.game.screenID]) {
this.clip.hidden.gotoAndStop("found");
}
}
if (_root.cameras == undefined) {
_root.cameras = {};
}
if (_root.cameras["r" + _root.game.screenID] == undefined) {
_root.cameras["r" + _root.game.screenID] = {};
}
_local9 = 0;
var _local5 = this.clip["c" + _local9];
while (_local5 != undefined) {
if (_root.cameras["r" + _root.game.screenID]["c" + _local9]) {
_local5.destroyed = true;
_local5.gotoAndStop("destroyed");
} else {
_root.cameras["r" + _root.game.screenID]["c" + _local9] = false;
_local5.destroyed = false;
}
_local9++;
_local5 = this.clip["c" + _local9];
}
if (_root.triggers == undefined) {
_root.triggers = {};
}
if (_root.triggers["r" + _root.game.screenID] == undefined) {
_root.triggers["r" + _root.game.screenID] = {};
}
_local9 = 0;
var _local3 = this.clip["h" + _local9];
while (_local3 != undefined) {
_local3.hit = false;
_local3._visible = false;
_local3.objGame = this;
if (_root.triggers["r" + _root.game.screenID]["h" + _local9] == true) {
_local3.hit = true;
}
_local9++;
_local3 = this.clip["h" + _local9];
}
_local9 = 0;
var _local6 = this.clip["e" + _local9];
while (_local6 != undefined) {
_local6.baddie.hit._visible = false;
_local6.objGame = this;
_local9++;
_local6 = this.clip["e" + _local9];
}
_local9 = 0;
var _local8 = [];
var _local7 = this.clip["l" + _local9];
while (_local7 != undefined) {
_local8.push(_local7.laser.lens);
_local8.push(_local7.laser.impact);
_local9++;
_local7 = this.clip["l" + _local9];
}
if (this.clip.l0) {
_root.objSounds.registerSources(this.monkey, _local8, "laserhumloop", 250);
}
if (this.clip.e0.baddie.isDrone) {
_root.objSounds.registerSources(this.monkey, [this.clip.e0.baddie], "droneloop", 350);
}
if (this.clip.e0.baddie.isSaw) {
_root.objSounds.registerSources(this.monkey, [this.clip.e0.baddie], "sawloop", 350);
}
if (_root.game.deliverMonkey) {
this.arm = new Arm(this.clip, "delivery");
}
if (this.clip.armCycle) {
this.arm = new Arm(this.clip, "cycle");
}
this.monkey.hitGround._visible = false;
this.monkey.hitBody._visible = false;
this.monkey.hitStep._visible = false;
this.monkey.hitLeft._visible = false;
this.monkey.hitRight._visible = false;
this.monkey.hitCentre._visible = false;
this.monkey.hitHead._visible = false;
this.monkey.hitNeck._visible = false;
this.clip.onEnterFrame = function () {
this.objLevel.evtEnterFrame();
};
this.clip.onMouseDown = function () {
this.objLevel.evtMouseDown();
};
this.clip.onMouseUp = function () {
this.objLevel.evtMouseUp();
};
};
MonkeyLevel.prototype.evtMouseDown = function () {
if (this.arm.skipAnimation()) {
return(undefined);
}
if (_root.game.paused) {
return(undefined);
}
if (!_root.game.hasHat) {
return(undefined);
}
if (this.monkey.state == "delivery") {
return(undefined);
}
if (this.monkey.state == "squished") {
return(undefined);
}
if (this.clip.ui.bg.hitTest(_root._xmouse, _root._ymouse, false)) {
return(undefined);
}
this.mouseDownOnFrame = this.frame;
_root.objSounds.play("focusloop", undefined, true);
if ((_root.game.screenID == 1) && (!_root.shownReleaseHint)) {
this.clip.hints.gotoAndStop("hintShootHere");
_root.shownReleaseHint = true;
}
};
MonkeyLevel.prototype.evtMouseUp = function () {
if (!_root.game.hasHat) {
return(undefined);
}
if (this.monkey.state == "squished") {
return(undefined);
}
if (this.monkey.state == "delivery") {
return(undefined);
}
if (!this.mouseDownOnFrame) {
return(undefined);
}
if (this.mouseDownOnFrame == this.frame) {
this.mouseDownOnFrame = undefined;
return(undefined);
}
this.fireShot(ShotGrow, this.monkey._x, this.monkey._y - 12, this.scanPoint.x, this.scanPoint.y, this.maxRange);
this.mouseDownOnFrame = undefined;
};
MonkeyLevel.prototype.renderBitmap = function () {
this.bmpLevel.fillRect(this.bmpLevel.rectangle, 0);
this.bmpLevel.draw(this.bendableClip);
var _local2 = 0;
while (_local2 < this.arrShots.length) {
this.arrShots[_local2].evtDraw(this.bmpLevel);
_local2++;
}
this.bmpLevel.draw(this.unbendableClip);
};
MonkeyLevel.prototype.scanLineLimit = function (x0, y0, x1, y1, step) {
var _local6 = x1 - x0;
var _local5 = y1 - y0;
var _local4 = Maths.vectorLength(_local6, _local5);
_local6 = _local6 / _local4;
_local5 = _local5 / _local4;
_local6 = _local6 * step;
_local5 = _local5 * step;
if ((_local6 == 0) && (_local5 == 0)) {
return({x:x0, y:y0, colour:this.bmpLevel.getPixel32(x0, y0), dist:_local4});
}
var _local14 = 0;
while (((((_local14 < _local4) && (x0 >= 0)) && (y0 >= 0)) && (x0 <= this.levelWidth)) && (y0 <= this.levelWidth)) {
var _local8 = this.bmpLevel.getPixel32(x0, y0);
if ((_local8 & 4278190080) != 0) {
return({x:x0, y:y0, colour:_local8, dist:_local14});
}
x0 = x0 + _local6;
y0 = y0 + _local5;
_local14 = _local14 + step;
}
var _local8 = this.bmpLevel.getPixel32(x1, y1);
if ((_local8 & 4278190080) != 0) {
return({x:x1, y:y1, colour:_local8, dist:_local4});
}
return({x:x0, y:y0, colour:0, dist:_local4});
};
MonkeyLevel.prototype.scanLine = function (x0, y0, x1, y1, step) {
var _local6 = x1 - x0;
var _local5 = y1 - y0;
var _local7 = Maths.vectorLength(_local6, _local5);
_local6 = _local6 / _local7;
_local5 = _local5 / _local7;
_local6 = _local6 * step;
_local5 = _local5 * step;
while ((((x0 >= 0) && (y0 >= 0)) && (x0 <= this.levelWidth)) && (y0 <= this.levelWidth)) {
var _local4 = this.bmpLevel.getPixel32(x0, y0);
if ((_local4 & 4278190080) != 0) {
return({x:x0, y:y0, colour:_local4});
}
x0 = x0 + _local6;
y0 = y0 + _local5;
}
return({x:x0, y:y0, colour:0});
};
MonkeyLevel.prototype.fireShot = function (shotObject, startX, startY, targetX, targetY) {
_root.objSounds.stop("focusloop");
_root.objSounds.play("warp");
if (this.arrShots.length >= this.maxActiveShots) {
var _local4 = 0;
while (_local4 < this.arrShots.length) {
if (!this.arrShots[_local4].ending) {
this.arrShots[_local4].evtRemoveShot();
_local4 = this.arrShots.length;
}
_local4++;
}
}
var _local4 = 0;
var _local3 = this.clip["c" + _local4];
while (_local3 != undefined) {
if (!_local3.destroyed) {
var _local5 = Maths.distanceSquared(targetX, targetY, _local3._x, _local3._y);
if (_local5 < this.cameraHitDistanceSqr) {
_root.cameras["r" + _root.game.screenID]["c" + _local4] = true;
_local3.destroyed = true;
_local3.gotoAndStop("explode");
_root.game.cameras++;
this.updateUI();
_root.achieved("broke_camera");
if (_root.game.cameras == _root.game.totalCameras) {
_root.achieved("all_cameras");
}
}
}
_local4++;
_local3 = this.clip["c" + _local4];
}
if (_root.options.lightening) {
var _local10 = this.shotMarkers.getNextHighestDepth();
var _local6 = this.shotMarkers.createEmptyMovieClip("bolt" + _local10, _local10);
_local6.lineStyle();
_local6.beginFill(16777215, 40);
_local6.drawLighteningBolt(startX, startY, targetX, targetY, 35, 0);
_local6.endFill();
_local6.tween("_alpha", 0, 0.15, "linear", 0, {scope:_local6, func:_local6.removeMovieClip});
}
var _local9 = new shotObject[undefined](this, startX, startY, targetX, targetY);
_root.options.setupShot(_local9);
this.arrShots.push(_local9);
_root.achieved("first_bender");
};
MonkeyLevel.prototype.evtEnterFrame = function () {
if (_root.game.paused) {
return(undefined);
}
profiler("Enter frame");
this.frame++;
if ((this.frame % 10) == 0) {
var _local9 = getTimer() - this.fpsTime;
this.clip.ui.fps.txtFPS.text = "FPS " + Maths.formatNum(Math.floor(10000 / _local9), 2);
this.fpsTime = getTimer();
}
var _local8 = 0;
while (_local8 < this.arrShots.length) {
var _local7 = this.arrShots[_local8].evtUpdate();
if (!_local7) {
this.arrShots.splice(_local8, 1);
_local8--;
}
_local8++;
}
profiler("Update shots");
this.renderBitmap();
profiler("Render Bitmap");
this.keyL = Key.isDown(Keys.CursorLeft) || (Key.isDown(Keys.A));
this.keyR = Key.isDown(Keys.CursorRight) || (Key.isDown(Keys.D));
this.keyU = Key.isDown(Keys.CursorUp) || (Key.isDown(Keys.W));
this.keyD = Key.isDown(Keys.CursorDown) || (Key.isDown(Keys.S));
this.keyS = Key.isDown(Keys.Spacebar);
if (this.keyS) {
if (this.closeAllWarps()) {
_root.objSounds.play("warpclose");
}
}
this.speech.evtEnterFrame();
if (this.clip.hidden && (!_root.hiddenMsgs["r" + _root.game.screenID])) {
var _local4 = this.clip.hidden.testPoint.holderToLocal(this.clip);
var _local10 = this.bmpLevel.getPixel32(_local4.x, _local4.y);
if ((_local10 & 4278190080) == 0) {
this.clip.hidden.gotoAndStop("found");
_root.hiddenMsgs["r" + _root.game.screenID] = true;
_root.game.messages++;
_root.objSounds.play("bonus");
this.updateUI();
_root.achieved("secret_get");
if (_root.game.messages == _root.game.totalMessages) {
_root.achieved("all_secrets");
}
}
}
this.arm.evtEnterFrame();
switch (this.monkey.state) {
case "delivery" :
this.monkey._x = this.clip.armTarget._x;
this.monkey._y = this.clip.armTarget._y + 10;
this.monkey.animState = "delivery";
break;
case "standing" :
if (this.monkey.animState != "dropped") {
this.monkey.animState = "walk";
}
this.walkMonkey();
this.collideMonkey();
if ((this.monkey.vx == 0) && (this.monkey.animState != "dropped")) {
this.monkey.animState = "idle";
}
if ((this.monkey.animState == "idle") && (this.mouseDownOnFrame)) {
this.monkey.animState = "warp";
}
this.monkey.fallJump = this.monkey.fallJumpTollerance;
if (this.keyU) {
if (this.monkey.jumpAllowed && (!this.monkey.rejumpProtect)) {
this.monkey.fallJump = 0;
this.monkey.animState = "jump";
this.monkey.state = "jumping";
this.monkey.vy = -this.monkey.jumpInitialPPF;
this.monkey.jumpBoostFrames = this.monkey.jumpBoostMaxFrames;
this.monkey.rejumpProtect = true;
}
} else {
this.monkey.rejumpProtect = false;
}
break;
case "jumping" :
this.walkMonkey();
if (this.monkey.jumpBoostFrames > 0) {
if (!this.keyU) {
this.monkey.jumpBoostFrames = 0;
this.monkey.rejumpProtect = false;
} else {
this.monkey.jumpBoostFrames--;
this.monkey.vy = this.monkey.vy - this.monkey.jumpBoostPPF;
}
} else if (!this.keyU) {
this.monkey.rejumpProtect = false;
}
this.collideMonkey();
if (this.monkey.vy >= 0) {
this.monkey.state = "falling";
}
if (this.monkey.jumpAllowed) {
this.monkey.state = "standing";
}
break;
case "falling" :
this.walkMonkey();
this.monkey.animState = "fall";
this.monkey.fallJump--;
if (this.keyU && (this.monkey.fallJump > 0)) {
this.monkey.fallJump = 0;
this.monkey.animState = "jump";
this.monkey.state = "jumping";
this.monkey.vy = -this.monkey.jumpInitialPPF;
this.monkey.jumpBoostFrames = this.monkey.jumpBoostMaxFrames;
this.monkey.rejumpProtect = true;
}
if (!this.keyU) {
this.monkey.rejumpProtect = false;
}
this.collideMonkey();
if (this.monkey.jumpAllowed) {
this.monkey.state = "standing";
}
break;
case "squished" :
this.monkeySquishAnim();
break;
default :
trace("Unknown monkey state " + this.monkey.state);
}
this.monkey.gotoAndStop(this.monkey.animState + this.monkey.lastDir);
this.monkey.gfx.head.hat._visible = _root.game.hasHat;
profiler("Move monkey");
this.shotClip.clear();
if (this.mouseDownOnFrame != undefined) {
shotX = this.monkey._x;
shotY = this.monkey._y - 12;
this.scanPoint = this.scanLine(shotX, shotY, this.shotClip._xmouse, this.shotClip._ymouse, 1);
this.shotClip.lineStyle(1, ((this.frame % 2) ? 16777215 : 8421504), Maths.randomInt(40, 80));
this.shotClip.moveTo(shotX, shotY);
this.shotClip.lineTo(this.scanPoint.x, this.scanPoint.y);
if (((this.frame - this.mouseDownOnFrame) % 5) == 1) {
this.shotManager.addShot(shotX, shotY, this.scanPoint.x, this.scanPoint.y);
}
}
profiler("Aim line");
this.shotManager.evtEnterFrame();
profiler("Shot manager");
this.laserClip.clear();
_local8 = 0;
var _local6 = this.clip["l" + _local8];
while (_local6 != undefined) {
this.processLaser(_local6.laser);
_local8++;
_local6 = this.clip["l" + _local8];
}
profiler("Update lasers");
_local8 = 0;
var _local3 = this.clip["c" + _local8];
while (_local3 != undefined) {
if (!_local3.destroyed) {
var _local4 = this.monkey.holderToLocal(_local3.cam);
var _local5 = Maths.dotProduct(_local3.cam.aim._x, _local3.cam.aim._y, -_local4.y, _local4.x);
if (_local5 < -500) {
_local3.cam._rotation = _local3.cam._rotation + 0.3;
}
if (_local5 > 500) {
_local3.cam._rotation = _local3.cam._rotation - 0.3;
}
if (_local3.cam._rotation < -77) {
_local3.cam._rotation = -77;
}
if (_local3.cam._rotation > 73) {
_local3.cam._rotation = 73;
}
}
_local8++;
_local3 = this.clip["c" + _local8];
}
};
MonkeyLevel.prototype.closeAllWarps = function () {
var _local3 = false;
var _local2 = 0;
while (_local2 < this.arrShots.length) {
if (!this.arrShots[_local2].ending) {
_local3 = true;
this.arrShots[_local2].evtRemoveShot();
}
_local2++;
}
return(_local3);
};
MonkeyLevel.prototype.walkMonkey = function () {
if (this.keyL) {
this.monkey.vx = this.monkey.vx - this.monkey.walkPPF;
}
if (this.keyR) {
this.monkey.vx = this.monkey.vx + this.monkey.walkPPF;
}
this.monkey.vx = this.monkey.vx * this.monkey.walkDrag;
if (this.monkey.vx > this.monkey.walkFriction) {
this.monkey.vx = this.monkey.vx - this.monkey.walkFriction;
}
if (this.monkey.vx < (-this.monkey.walkFriction)) {
this.monkey.vx = this.monkey.vx + this.monkey.walkFriction;
}
if (Math.abs(this.monkey.vx) <= this.monkey.walkFriction) {
this.monkey.vx = 0;
}
this.monkey.vy = this.monkey.vy * this.monkey.airDrag;
if (Math.abs(this.monkey.vy) < 0.1) {
this.monkey.vy = 0;
}
if (!this.monkey.jumpAllowed) {
this.monkey.vy = this.monkey.vy + this.gravity;
}
this.monkey._x = this.monkey._x + this.monkey.vx;
this.monkey._y = this.monkey._y + this.monkey.vy;
if (this.monkey.vx > 0) {
this.monkey.lastDir = "right";
}
if (this.monkey.vx < 0) {
this.monkey.lastDir = "left";
}
};
MonkeyLevel.prototype.collideMonkey = function () {
var _local3 = this.monkey.holderToGlobal();
if (this.clip.linkLeft.hitTest(_local3.x, _local3.y, true)) {
return(this.changeScreen(-1, 0));
}
if (this.clip.linkRight.hitTest(_local3.x, _local3.y, true)) {
return(this.changeScreen(1, 0));
}
if (this.clip.linkDown.hitTest(_local3.x, _local3.y, true)) {
return(this.changeScreen(0, 1));
}
if ((!_root.game.hasHat) && (this.clip.hat.hit.hitTest(_local3.x, _local3.y, true))) {
this.gotHat();
}
var _local7 = 0;
var _local4 = this.clip["b" + _local7];
while (_local4 != undefined) {
if ((_local4.collected == undefined) && (_local4.hit.hitTest(_local3.x, _local3.y, true))) {
_local4._visible = false;
_local4.collected = true;
_root.pickups["r" + _root.game.screenID]["b" + _local7] = true;
_root.game.bananas++;
_root.objSounds.play("hiddenmsg");
this.updateUI();
if (_root.game.bananas == _root.game.totalBananas) {
_root.achieved("gone_bananas");
}
}
_local7++;
_local4 = this.clip["b" + _local7];
}
_local7 = 0;
var _local5 = this.clip["e" + _local7];
while (_local5 != undefined) {
if (_local5.baddie.hit.hitTest(_local3.x, _local3.y, true)) {
if (_local5.baddie.isSpikes) {
_root.objSounds.play("deathspikes");
}
if (_local5.baddie.isSaw) {
_root.objSounds.play("deathsaw");
}
if (_local5.baddie.isDrone) {
_root.objSounds.play("deathdrone");
}
this.squishMonkey();
return(undefined);
}
_local7++;
_local5 = this.clip["e" + _local7];
}
_local7 = 0;
var _local6 = this.clip["h" + _local7];
while (_local6 != undefined) {
if (_local6.hitTest(_local3.x, _local3.y, true)) {
_local6.evtTriggered();
_local6.hit = true;
_root.triggers["r" + _root.game.screenID]["h" + _local7] = true;
}
_local7++;
_local6 = this.clip["h" + _local7];
}
this.clip.debug.clear();
var _local16 = this.monkey.gfx.hitTestShape(this.laserClip);
if (_local16 != undefined) {
_root.objSounds.play("deathlaser");
this.squishMonkey();
}
var _local14 = this.monkey.hitLeft.hitTestShape(this.clip.bitmapHolder);
var _local12 = this.monkey.hitRight.hitTestShape(this.clip.bitmapHolder);
var _local18 = this.monkey.hitCentre.hitTestShape(this.clip.bitmapHolder);
var _local9 = 0;
if (_local12 != undefined) {
_local9 = _local9 + 1;
}
if (_local18 != undefined) {
_local9 = _local9 + 2;
}
if (_local14 != undefined) {
_local9 = _local9 + 4;
}
switch (_local9) {
case 0 :
break;
case 1 :
this.monkey._x = this.monkey._x - _local12.width;
this.monkey.vx = 0;
break;
case 2 :
break;
case 3 :
case 4 :
case 6 :
this.monkey._x = this.monkey._x + _local14.width;
this.monkey.vx = 0;
break;
case 5 :
this.monkey.vx = 0;
break;
case 7 :
}
var _local10 = this.monkey.hitHead.hitTestShape(this.clip.bitmapHolder);
var _local19 = this.monkey.hitNeck.hitTestShape(this.clip.bitmapHolder);
var _local11 = 0;
if (_local10 != undefined) {
_local11 = _local11 + 1;
}
if (_local19 != undefined) {
_local11 = _local11 + 2;
}
switch (_local11) {
case 0 :
this.monkey.crushCount = 0;
break;
case 1 :
this.monkey.crushCount = 0;
if (this.monkey.state == "jumping") {
this.monkey._y = this.monkey._y + _local10.height;
this.monkey.vy = 0.5;
this.monkey.jumpBoostFrames = 0;
}
break;
case 2 :
this.monkey.crushCount = 0;
break;
case 3 :
this.monkey.crushCount++;
if (this.monkey.crushCount < this.monkey.crushLimit) {
break;
}
_root.objSounds.play("deathcrush");
this.squishMonkey();
}
var _local15 = this.monkey.hitGround.hitTestShape(this.clip.bitmapHolder);
var _local17 = this.monkey.hitBody.hitTestShape(this.clip.bitmapHolder);
var _local13 = this.monkey.hitStep.hitTestShape(this.clip.bitmapHolder);
var _local8 = 0;
if (_local15 != undefined) {
_local8 = _local8 + 1;
}
if (_local13 != undefined) {
_local8 = _local8 + 2;
}
if (_local17 != undefined) {
_local8 = _local8 + 4;
}
switch (_local8) {
case 0 :
this.monkey.jumpAllowed = false;
if (this.monkey.state == "standing") {
this.monkey.state = "jumping";
this.monkey.jumpBoostFrames = 0;
}
break;
case 1 :
this.monkey._y = this.monkey._y + (this.monkey.hitGround._height - _local15.height);
this.monkey.vy = 0;
this.monkey.jumpAllowed = true;
break;
case 3 :
this.monkey._y = this.monkey._y - (_local13.height + 0.1);
this.monkey.vy = 0;
this.monkey.jumpAllowed = true;
break;
case 2 :
case 4 :
case 6 :
this.monkey.jumpAllowed = false;
break;
case 5 :
case 7 :
this.monkey.jumpAllowed = false;
}
if (_local10) {
this.monkey.jumpAllowed = false;
}
};
MonkeyLevel.prototype.changeScreen = function (dx, dy) {
this.mouseDownOnFrame = undefined;
if (dx != 0) {
_root.monkeyStartX = ((dx > 0) ? (this.monkeyLeftX) : (this.monkeyRightX));
_root.monkeyStartY = this.monkey._y;
_root.game.screenID = _root.game.screenID + dx;
}
if (dy != 0) {
_root.game.screenID = _root.game.screenID + (40 * dy);
_root.monkeyStartX = this.monkey._x;
_root.monkeyStartY = this.monkeyTopY;
_root.game.armZone = false;
}
_root.gotoAndPlay("reset");
};
MonkeyLevel.prototype.squishMonkey = function () {
_root.game.predecessors++;
_root.game.newMonkeyID();
if (_root.game.predecessors == 30) {
_root.achieved("death_100");
}
_root.objSounds.stop("focusloop");
_root.objSounds.play("monkey");
this.monkey.state = "squished";
this.squishedFrames = 70;
this.monkey._visible = false;
this.mouseDownOnFrame = undefined;
this.closeAllWarps();
if (_root.game.armZone) {
_root.game.deliverMonkey = true;
}
this.clip.ui.deathFX._visible = true;
this.clip.ui.deathFX.alphaTo(0, 0.1, "linear");
if (_root.game.dialogueZone) {
this.speech.startSeq(("die" + Maths.formatNum(Maths.randomInt(1, 37), 2)) + "_");
switch (Maths.randomInt(1, 5)) {
case 1 :
this.clip.ui.speech.portrait.gotoAndStop("eyes");
break;
case 2 :
this.clip.ui.speech.portrait.gotoAndStop("close");
break;
case 3 :
this.clip.ui.speech.portrait.gotoAndStop("hand");
break;
case 4 :
this.clip.ui.speech.portrait.gotoAndStop("slant");
break;
case 5 :
this.clip.ui.speech.portrait.gotoAndStop("side");
}
}
this.bloodClip._alpha = 50;
var _local3 = this.bloodClip.createEmptyMovieClip("bloodBase", 0);
var _local8 = this.monkey._x;
var _local7 = this.monkey._y;
var _local6 = 0;
while (_local6 < 360) {
var _local4 = _local3.getNextHighestDepth();
_local3.attachMovie("splatterBase", "splatterBase" + _local4, _local4);
var clip = _local3["splatterBase" + _local4];
clip.gotoAndStop(Maths.randomInt(2, clip._totalframes));
clip._x = _local8;
clip._y = _local7;
clip._rotation = _local6;
clip._xscale = (clip._yscale = Maths.randomInt(5, 10));
clip.scaleTo(Maths.randomInt(30, 40), Maths.randomNum(0.2, 0.4), "easeOutExpo");
_local6 = _local6 + Maths.randomInt(12, 20);
}
var _local9 = Maths.randomNum(0, 360);
if ((this.monkey.vx != 0) || (this.monkey.vy != 0)) {
_local9 = Maths.radToDeg(Math.atan2(-this.monkey.vy, -this.monkey.vx)) + Maths.randomNum(-30, 30);
}
var _local10 = Maths.randomInt(5, 15);
_local6 = 0;
while (_local6 < _local10) {
var _local4 = _local3.getNextHighestDepth();
_local3.attachMovie("splatterSpray", "splatterSpray" + _local4, _local4);
var clip = _local3["splatterSpray" + _local4];
clip.gotoAndStop(1);
clip.dirDeg = _local9 + Maths.randomNum(-15, 15);
clip.dirRad = Maths.degToRad(clip.dirDeg);
clip.speed = Maths.randomNum(11, 19);
clip.dx = clip.speed * Math.cos(clip.dirRad);
clip.dy = clip.speed * Math.sin(clip.dirRad);
clip.life = Maths.randomInt(3, 7);
clip._xscale = (clip._yscale = Maths.randomInt(70, 140));
clip._x = _local8 + Maths.randomInt(-3, 3);
clip._y = _local7 + Maths.randomInt(-3, 3);
clip._rotation = clip.dirDeg;
clip.onEnterFrame = function () {
this.life--;
if (this.life <= 0) {
this.gotoAndStop(Maths.randomInt(2, this._totalframes));
this.onEnterFrame = undefined;
} else {
this._x = this._x + this.dx;
this._y = this._y + this.dy;
}
};
_local6++;
}
_local6 = 0;
while (_local6 < 20) {
_local3 = this.bloodClip.bloodBase;
var _local4 = _local3.getNextHighestDepth();
_local3.attachMovie("bloodDroplet", "bloodDroplet" + _local4, _local4);
var clip = _local3["bloodDroplet" + _local4];
var dx = Maths.randomInt(-60, 60);
var dy = Maths.randomInt(-60, 60);
clip._x = this.deathX + dx;
clip._y = this.deathY + dy;
var _local5 = clip.holderToGlobal();
if (this.pathHit.hitTest(_local5.x, _local5.y, true)) {
clip.gotoAndStop(Maths.randomInt(1, clip._totalframes));
clip._xscale = (clip._yscale = Maths.randomInt(80, 110));
clip._rotation = Maths.radToDeg(Math.atan2(dy, dx));
} else {
clip.removeMovieClip();
}
_local6++;
}
_local3.dummy = 0;
_local3.tween("dummy", 1, 3, "linear", 0, {scope:this, func:this.deathAnimOver});
};
MonkeyLevel.prototype.deathAnimOver = function () {
var _local4 = new flash.geom.Matrix();
var _local3 = new flash.geom.ColorTransform();
_local3.alphaMultiplier = 0.5;
this.bmpBlood.draw(this.bloodClip, _local4, _local3);
this.bloodClip.bloodBase.removeMovieClip();
this.bmpBlood.applyFilter(this.bmpBlood, this.bmpBlood.rectangle, new flash.geom.Point(0, 0), this.bloodFadeFilter);
_global.objTrans.goto("reset");
};
MonkeyLevel.prototype.monkeySquishAnim = function () {
};
MonkeyLevel.prototype.gotHat = function () {
_root.achieved("hat_get");
_root.game.hasHat = true;
this.clip.hat._visible = false;
this.updateUI();
this.clip.hints.gotoAndStop("hintStandHere");
};
MonkeyLevel.prototype.drawLightening = function (clip, x, y, ittr, angleRad) {
if (ittr <= 0) {
return(undefined);
}
var _local7 = Maths.randomNum(3, 5) * ittr;
var _local2 = 2 * ittr;
var _local6 = (x + Maths.randomInt(-_local2, _local2)) + (_local7 * Math.cos(angleRad));
var _local5 = (y + Maths.randomInt(-_local2, _local2)) + (_local7 * Math.sin(angleRad));
clip.lineStyle(1, 16777215, 90);
clip.moveTo(x, y);
clip.lineTo(_local6, _local5);
if (Maths.randomInt(1, 100) > 30) {
this.drawLightening(clip, _local6, _local5, ittr - 1, angleRad + Maths.randomNum(-0.8, 0.8));
}
if (Maths.randomInt(1, 100) > 70) {
this.drawLightening(clip, _local6, _local5, ittr - 1, angleRad + Maths.randomNum(-0.8, 0.8));
}
if (Maths.randomInt(1, 100) > 80) {
this.drawLightening(clip, _local6, _local5, ittr - 2, Maths.randomNum(0, (Math.PI*2)));
}
};
MonkeyLevel.prototype.processLaser = function (laser) {
var _local3 = laser.lens.holderToLocal(this.laserClip);
var _local5 = laser.aim.holderToLocal(this.laserClip);
var _local2 = this.scanLine(_local3.x, _local3.y, _local5.x, _local5.y, 2);
this.laserClip.lineStyle(2, 16711680, Maths.randomInt(50, 80));
this.laserClip.moveTo(_local3.x, _local3.y);
this.laserClip.lineTo(_local2.x, _local2.y);
laser.globalToLocal(_local2);
laser.impact._x = _local2.x;
laser.impact._y = _local2.y;
};
MonkeyLevel.prototype.determineZones = function () {
switch (_root.game.screenID) {
case 19 :
case 20 :
case 21 :
case 22 :
case 23 :
case 24 :
case 42 :
case 43 :
case 44 :
case 45 :
case 46 :
case 47 :
case 48 :
case 49 :
case 50 :
case 51 :
case 52 :
case 53 :
case 54 :
case 55 :
case 56 :
case 57 :
case 58 :
case 59 :
case 81 :
case 82 :
case 121 :
case 122 :
case 139 :
case 140 :
case 141 :
case 142 :
_root.game.armZone = false;
if (_root.testStart) {
_root.game.deliverMonkey = false;
}
break;
default :
_root.game.armZone = _root.options.arm;
}
switch (_root.game.screenID) {
case 42 :
case 43 :
case 44 :
case 45 :
case 46 :
case 47 :
case 48 :
case 49 :
case 50 :
case 51 :
case 52 :
case 81 :
case 82 :
case 121 :
case 122 :
case 142 :
_root.game.lightZone = true;
break;
default :
_root.game.lightZone = false;
}
switch (_root.game.screenID) {
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
case 7 :
case 8 :
case 9 :
case 10 :
case 11 :
case 11 :
case 12 :
case 13 :
case 14 :
case 15 :
case 16 :
case 17 :
case 18 :
_root.setMusic("music_caves");
break;
case 19 :
case 20 :
case 21 :
case 22 :
case 23 :
case 24 :
case 25 :
case 53 :
case 54 :
case 55 :
case 56 :
case 57 :
case 58 :
case 59 :
case 99 :
case 139 :
case 140 :
_root.setMusic("music_lab");
break;
case 43 :
case 44 :
case 45 :
case 46 :
case 47 :
case 48 :
case 49 :
case 50 :
case 51 :
case 52 :
_root.setMusic("music_sewer");
break;
case 42 :
default :
case 81 :
case 82 :
case 121 :
case 122 :
case 141 :
case 142 :
_root.setMusic("music_outside");
}
_root.game.dialogueZone = true;
if (_root.game.screenID > 25) {
_root.game.dialogueZone = false;
}
};
MonkeyLevel.prototype.addExplosion = function (marker) {
var _local4 = marker.holderToLocal(this.shotMarkers);
var _local3 = this.shotMarkers.getNextHighestDepth();
this.shotMarkers.attachMovie("explosion", "explosion" + _local3, _local3);
var _local2 = this.shotMarkers["explosion" + _local3];
_local2._x = _local4.x;
_local2._y = _local4.y;
_local2._xscale = marker._xscale;
_local2._yscale = marker._yscale;
};
MonkeyLevel.prototype.updateUI = function () {
if (_root.game.screenID <= 18) {
strProgress = (("test " + _root.game.screenID) + " of ") + 18;
}
if (_root.game.screenID > 18) {
strProgress = "post-test " + (_root.game.screenID - 18);
}
if (_root.game.screenID > 25) {
strProgress = "lost / escaped";
}
if (!_root.game.hasHat) {
strProgress = "recruit";
}
this.clip.ui.txtMonkeyID.text = "#" + _root.game.monkeyID;
this.clip.ui.txtProgress.text = strProgress;
this.clip.ui.txtPredecessors.text = _root.game.predecessors;
this.clip.ui.txtGreed.text = (_root.game.bananas + " / ") + _root.game.totalBananas;
this.clip.ui.txtDestructiveness.text = (_root.game.cameras + " / ") + _root.game.totalCameras;
this.clip.ui.txtCuriosity.text = (_root.game.messages + " / ") + _root.game.totalMessages;
};
Speech.prototype.startSeq = function (seqID) {
this.currentSeq = seqID;
this.currentIdx = 0;
this.running = true;
this.showNextSeq();
};
Speech.prototype.showNextSeq = function () {
this.currentIdx++;
this.clip.gotoAndPlay("in");
this.clip.bubble.gotoAndStop(this.currentSeq + this.currentIdx);
this.endFrame = this.frame + Math.floor(this.clip.bubble._width * 0.5);
if (this.clip.bubble.invalid) {
this.running = false;
this.clip.gotoAndStop("idle");
}
};
Speech.prototype.evtEnterFrame = function () {
this.frame++;
if (this.running) {
if (this.frame == this.endFrame) {
this.clip.gotoAndPlay("out");
}
}
};
Arm.prototype.initialise = function () {
var _local3 = Maths.randomInt(0, -190);
this.clip.base._y = this.clip.base._y + _local3;
this.clip.arm._y = this.clip.arm._y + _local3;
this.clip.elbow._y = this.clip.elbow._y + _local3;
this.clip.hand._y = this.clip.hand._y + _local3;
this.levelClip.armTarget._y = this.levelClip.armTarget._y + _local3;
if (Math.random() > 0.5) {
var _local4 = 800;
this.clip.base._x = this.clip.base._x + _local4;
this.clip.arm._x = this.clip.arm._x + _local4;
this.clip.elbow._x = this.clip.elbow._x + _local4;
this.clip.hand._x = this.clip.hand._x + _local4;
this.levelClip.armTarget._x = this.levelClip.armTarget._x + _local4;
}
this.physics = new Physics(this.levelClip.physicsHolder, 0, 0, 0.95, false, false, null, false);
var _local5 = this.clip.hand.grabPoint.holderToLocal(this.clip);
this.armMass = new Mass(this.clip.arm._x, this.clip.arm._y, 15, false, this.physics, 1);
this.elbowMass = new Mass(this.clip.elbow._x, this.clip.elbow._y, 15, false, this.physics, 1);
this.handMass = new Mass(this.clip.hand._x, this.clip.hand._y, 15, false, this.physics, 1);
this.grabMass = new Mass(_local5.x, _local5.y, 15, true, this.physics, 1);
this.baseY = this.armMass.y;
this.clip.base.oy = this.clip.base._y - this.armMass.y;
this.armMass.mass = 2;
this.elbowMass.mass = 1.5;
this.grabMass.mas = 1.2;
this.armSpring = makeSpringLine(this.armMass, this.elbowMass);
this.elbowSpring = makeSpringLine(this.elbowMass, this.handMass);
this.handSpring = makeSpringLine(this.handMass, this.grabMass);
if (this.armMode == "delivery") {
this.targetX = this.monkey._x;
this.targetY = this.monkey._y;
this.monkey._x = _local5.x;
this.monkey._y = _local5.y;
_root.objSounds.play("arm");
this.levelClip.armTarget.bezierTo(this.targetX, this.targetY - 10, Maths.randomInt(-100, 670), Maths.randomInt(-100, 500), 2, "easeOutSine", 0, this.dropMonkey);
}
if (this.armMode == "cycle") {
_local5 = this.levelClip.armCycle.aim.holderToLocal(this.levelClip);
this.levelClip.armTarget.bezierTo(_local5.x, _local5.y, Maths.randomInt(-100, 670), Maths.randomInt(-100, 500), 2, "easeOutSine", 0, this.startCycleMode);
}
};
Arm.prototype.skipAnimation = function () {
if (this.droppedMonkey) {
return(false);
}
if (this.armMode != "delivery") {
return(false);
}
this.clip._visible = false;
this.monkey._x = this.targetX;
this.monkey._y = this.targetY - 10;
this.dropMonkey();
this.dispose();
return(true);
};
Arm.prototype.evtEnterFrame = function () {
if (this.armMode == "cycling") {
var _local2 = this.levelClip.armCycle.aim.holderToLocal(this.levelClip);
this.levelClip.armTarget._x = _local2.x;
this.levelClip.armTarget._y = _local2.y;
}
this.grabMass.x = this.levelClip.armTarget._x;
this.grabMass.y = this.levelClip.armTarget._y;
this.physics.step();
if (this.armMass.y > 220) {
this.armMass.y = 220;
}
this.clip.base._x = this.armMass.x;
this.clip.base._y = this.armMass.y + this.clip.base.oy;
this.clip.arm._x = this.armMass.x;
this.clip.arm._y = this.armMass.y;
this.clip.arm._rotation = this.armSpring.getPosition().rDeg + 90;
this.clip.elbow._x = this.elbowMass.x;
this.clip.elbow._y = this.elbowMass.y;
this.clip.elbow._rotation = this.elbowSpring.getPosition().rDeg + 45;
this.clip.hand._x = this.handMass.x;
this.clip.hand._y = this.handMass.y;
this.clip.hand._rotation = this.handSpring.getPosition().rDeg + 90;
};
Arm.prototype.dropMonkey = function () {
var _local2 = -500;
if (Math.random() > 0.5) {
_local2 = 1070;
}
thisRef = _root.game.objLevel.arm;
thisRef.clip.hand.gotoAndPlay("open");
thisRef.droppedMonkey = true;
thisRef.monkey.state = "standing";
thisRef.monkey.animState = "dropped";
thisRef.levelClip.armTarget.slideTo(_local2, Maths.randomInt(100, 400), 2, "easeInSine", 0, thisRef.dispose);
_root.game.deliverMonkey = false;
};
Arm.prototype.startCycleMode = function () {
thisRef = _root.game.objLevel.arm;
thisRef.armMode = "cycling";
thisRef.levelClip.armCycle.play();
if (_root.game.screenID == 139) {
_root.game.objLevel.clip.e0.play();
}
};
Arm.prototype.dispose = function () {
thisRef = _root.game.objLevel.arm;
thisRef.physics = undefined;
_root.game.objLevel.arm = undefined;
};
initVersion();
if (!isViralVersion) {
MoFunZoneAPI.MFZEasyAPI.displayConfig.workspaceWidth = 570;
MoFunZoneAPI.MFZEasyAPI.displayConfig.workspaceHeight = 440;
MoFunZoneAPI.MFZEasyAPI.displayConfig.autoPosition = "bl";
MoFunZoneAPI.MFZEasyAPI.displayConfig.dialogScale = 1;
MoFunZoneAPI.MFZEasyAPI.userInfoEnabled = true;
MoFunZoneAPI.MFZEasyAPI.achievementEnabled = true;
MoFunZoneAPI.MFZEasyAPI.achievementConfig.gameID = "infinite_monkeys_bending_reality";
MoFunZoneAPI.MFZEasyAPI.achievementConfig.testMode = false;
MoFunZoneAPI.MFZEasyAPI.readyCallBack(readyallsystem);
MoFunZoneAPI.MFZEasyAPI.downloadAPI(_root);
}
Frame 21
Stage.scaleMode = "noScale";
Stage.align = "TL";
_root.objSounds.stop("music");
stopAllLoops();
_root.options = new Options();
initAchievementsSO();
initSounds();
setMusic("music_caves", true);
Frame 31
stop();
stopAllLoops();
_root.objSounds.stop("voice");
setupHome(homeScreen);
setMusic("music_lab");
MoFunZoneAPI.MFZEasyAPI.hideLoginStatus();
Frame 41
stopAllLoops();
setupWipe(wipeScreen);
Frame 51
stopAllLoops();
setupAchievements(achievementsScreen);
setMusic("music_outside");
Frame 61
stop();
stopAllLoops();
var objGameLevel = new MonkeyLevel(this.gameHolder);
objGameLevel.initialise(_root.game.screenID);
game.objLevel = objGameLevel;
_global.objTrans.curFrame = "level";
MoFunZoneAPI.MFZEasyAPI.hideLoginStatus();
Frame 71
stopAllLoops();
play();
Frame 72
gotoAndStop ("level");
Frame 81
stopAllLoops();
_root.game.setupEndScreen(endScreen);
setMusic("music_outside");
Frame 91
stopAllLoops();
setupCredits(creditsScreen);
setMusic("music_sewer");
Symbol 26 MovieClip Frame 11
_parent.gotoAndStop(2);
Symbol 36 MovieClip Frame 1
this.onEnterFrame = function () {
bytesloaded = Math.round(_root.getBytesLoaded());
bytestotal = Math.round(_root.getBytesTotal());
percent = bytesloaded / bytestotal;
barmask._xscale = percent * 100;
};
Symbol 68 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 68 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 79 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 79 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 87 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 87 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 95 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 95 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 103 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 103 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 111 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 111 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 119 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 119 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 127 MovieClip Frame 1
if (Math.random() > 0.5) {
_xscale = (-_xscale);
_x = (_x - _parent.shiftamt);
}
Symbol 127 MovieClip Frame 90
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.gotoAndStop(2);
} else {
_parent.gotoAndStop(thenextframe);
}
}
Symbol 134 MovieClip Frame 133
_root.gotoAndStop("intro");
Symbol 135 MovieClip Frame 1
stop();
_root.stop();
shiftamt = 17;
isloaded = false;
this.onEnterFrame = function () {
bytesloaded = Math.round(_root.getBytesLoaded());
bytestotal = Math.round(_root.getBytesTotal());
percent = bytesloaded / bytestotal;
if (bytesloaded == bytestotal) {
isloaded = true;
}
};
this.onRelease = function () {
getURL ("http://www.mofunzone.com/", "_blank");
};
Symbol 141 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 11
Symbol 141 MovieClip Frame 16
stop();
Symbol 141 MovieClip Frame 26
Symbol 141 MovieClip Frame 31
stop();
Symbol 1920 MovieClip [__Packages.com.mosesSupposes.fuse.Shortcuts] Frame 0
class com.mosesSupposes.fuse.Shortcuts
{
function Shortcuts () {
}
static function initialize() {
if (shortcuts == null) {
initShortcuts();
}
}
static function doShortcut(obj, methodName) {
initialize();
var _local5 = shortcuts[methodName];
if (_local5 == undefined) {
if (typeof(obj) == "movieclip") {
_local5 = mcshortcuts[methodName];
}
}
if (_local5 == undefined) {
return(null);
}
obj = arguments.shift();
methodName = String(arguments.shift());
if (!(obj instanceof Array)) {
obj = [obj];
}
var _local3 = "";
for (var _local6 in obj) {
var _local2 = String(_local5.apply(obj[_local6], arguments));
if ((_local2 != null) && (_local2.length > 0)) {
if (_local3.length > 0) {
_local3 = (_local2 + "|") + _local3;
} else {
_local3 = _local2;
}
}
}
return(((_local3 == "") ? null : (_local3)));
}
static function addShortcutsTo() {
initialize();
var _local5 = function (o, so) {
for (var _local5 in so) {
var _local2 = so[_local5];
if (_local2.getter || (_local2.setter)) {
o.addProperty(_local5, _local2.getter, _local2.setter);
_global.ASSetPropFlags(o, _local5, 3, 1);
} else {
o[_local5] = _local2;
_global.ASSetPropFlags(o, _local5, 7, 1);
}
}
};
for (var _local7 in arguments) {
var _local4 = arguments[_local7];
if ((_local4 == MovieClip.prototype) || (typeof(_local4) == "movieclip")) {
_local5(_local4, mcshortcuts);
}
_local5(_local4, shortcuts);
}
}
static function removeShortcutsFrom() {
initialize();
var _local5 = function (o, so) {
for (var _local5 in so) {
_global.ASSetPropFlags(o, _local5, 0, 2);
var _local2 = so[_local5];
if (_local2.getter || (_local2.setter)) {
o.addProperty(_local5, null, null);
}
delete o[_local5];
}
};
for (var _local7 in arguments) {
var _local3 = arguments[_local7];
if ((_local3 == MovieClip.prototype) || (typeof(_local3) == "movieclip")) {
_local5(_local3, mcshortcuts);
}
_local5(_local3, shortcuts);
}
}
static function parseStringTypeCallback(callbackStr) {
var evaluate = function (val) {
var first = val.charAt(0);
if ((first == val.slice(-1)) && ((first == "\"") || (first == "'"))) {
return(val.slice(1, -1));
}
if (val == "true") {
return(Object(true));
}
if (val == "false") {
return(Object(false));
}
if (val == "null") {
return(Object(null));
}
if (_global.isNaN(Number(val)) == false) {
return(Object(Number(val)));
}
return(Object(eval (val)));
};
var trimWhite = function (str) {
while (str.charAt(0) == " ") {
str = str.slice(1);
}
while (str.slice(-1) == " ") {
str = str.slice(0, -1);
}
return(str);
};
var evaluateList = function (list) {
var _local11 = [];
var _local4 = 0;
while (_local4 < list.length) {
var _local3 = list[_local4];
_local3 = trimWhite(_local3);
var _local5 = (_local3.charAt(0) == "{") && ((_local3.indexOf("}") > -1) || (_local3.indexOf(":") > -1));
var _local10 = _local3.charAt(0) == "[";
if ((_local5 || (_local10)) == true) {
var _local6 = ((_local5 == true) ? ({}) : ([]));
var _local2 = _local4;
while (_local2 < list.length) {
if (_local2 == _local4) {
_local3 = _local3.slice(1);
}
var _local1;
var _local8 = (_local1.slice(-1) == ((_local5 == true) ? "}" : "]")) || (_local2 == (list.length - 1));
if (_local8 == true) {
_local1 = _local1.slice(0, -1);
}
if ((_local5 == true) && (_local1.indexOf(":") > -1)) {
var _local7 = _local1.split(":");
_local6[trimWhite(_local7[0])] = evaluate(trimWhite(_local7[1]));
} else if (_local10 == true) {
_local6.push(evaluate(trimWhite(_local1)));
}
if (_local8 == true) {
_local11.push(_local6);
_local4 = _local2;
break;
}
_local2++;
}
} else {
_local11.push(evaluate(trimWhite(_local3)));
}
_local4++;
}
return(_local11);
};
var parts = callbackStr.split("(");
var p0 = parts[0];
var p1 = parts[1];
return({func:p0.slice(p0.lastIndexOf(".") + 1), scope:eval (p0.slice(0, p0.lastIndexOf("."))), args:evaluateList(p1.slice(0, p1.lastIndexOf(")")).split(","))});
}
static function initShortcuts() {
shortcuts = new Object();
var methods = {alphaTo:"_alpha", scaleTo:"_scale", sizeTo:"_size", rotateTo:"_rotation", brightnessTo:"_brightness", brightOffsetTo:"_brightOffset", contrastTo:"_contrast", colorTo:"_tint", tintPercentTo:"_tintPercent", colorResetTo:"_colorReset", invertColorTo:"_invertColor"};
var _local4 = _global.com.mosesSupposes.fuse.FuseFMP.getAllShortcuts();
var _local7 = {blur:1, blurX:1, blurY:1, strength:1, shadowAlpha:1, highlightAlpha:1, angle:1, distance:1, alpha:1, color:1};
for (var _local9 in _local4) {
if (_local7[_local4[_local9].split("_")[1]] === 1) {
methods[_local4[_local9] + "To"] = _local4[_local9];
}
}
var _local8 = {__resolve:function (name) {
var propName = methods[name];
return(function () {
var _local4 = _global.com.mosesSupposes.fuse.ZigoEngine.doTween.apply(com.mosesSupposes.fuse.ZigoEngine, new Array(this, propName).concat(arguments));
return(_local4);
});
}};
var _local5 = {__resolve:function (name) {
var _local3 = {setter:function (v) {
_global.com.mosesSupposes.fuse.ZigoEngine.doTween(this, ((name == "_tintString") ? "_tint" : (name)), v, 0);
}};
switch (name) {
case "_colorReset" :
_local3.getter = function () {
return(100 - _global.com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(this).tintPercent);
};
break;
case "_colorTransform" :
_local3.getter = function () {
return(Color(new Color(this)).getTransform());
};
break;
case "_fade" :
_local3.getter = function () {
return(this._alpha);
};
break;
case "_size" :
_local3.getter = function () {
return(((this._width == this._height) ? (this._width) : null));
};
break;
case "_scale" :
_local3.getter = function () {
return(((this._xscale == this._yscale) ? (this._xscale) : null));
};
break;
default :
_local3.getter = function () {
return(_global.com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(this)[name.slice(1)]);
};
}
return(_local3);
}};
for (var _local9 in methods) {
shortcuts[_local9] = _local8[_local9];
if ((_local9 != "alphaTo") && (_local9 != "rotateTo")) {
shortcuts[methods[_local9]] = _local5[methods[_local9]];
}
}
shortcuts._tintString = _local5._tintString;
shortcuts._colorTransform = _local5._colorTransform;
shortcuts._fade = _local5._fade;
shortcuts.tween = function (props, endVals, seconds, ease, delay, callback) {
if ((arguments.length == 1) && (typeof(props) == "object")) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween({target:this, action:props}));
}
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, props, endVals, seconds, ease, delay, callback));
};
shortcuts.removeTween = (shortcuts.stopTween = function (props) {
com.mosesSupposes.fuse.ZigoEngine.removeTween(this, props);
});
shortcuts.removeAllTweens = (shortcuts.stopAllTweens = function () {
com.mosesSupposes.fuse.ZigoEngine.removeTween("ALL");
});
shortcuts.isTweening = function (prop) {
return(com.mosesSupposes.fuse.ZigoEngine.isTweening(this, prop));
};
shortcuts.getTweens = function () {
return(com.mosesSupposes.fuse.ZigoEngine.getTweens(this));
};
shortcuts.lockTween = function () {
com.mosesSupposes.fuse.ZigoEngine.lockTween(this, true);
};
shortcuts.unlockTween = function () {
com.mosesSupposes.fuse.ZigoEngine.lockTween(this, false);
};
shortcuts.isTweenLocked = function () {
return(com.mosesSupposes.fuse.ZigoEngine.isTweenLocked(this));
};
shortcuts.isTweenPaused = function (prop) {
return(com.mosesSupposes.fuse.ZigoEngine.isTweenPaused(this, prop));
};
shortcuts.pauseTween = function (props) {
com.mosesSupposes.fuse.ZigoEngine.pauseTween(this, props);
};
shortcuts.resumeTween = (shortcuts.unpauseTween = function (props) {
com.mosesSupposes.fuse.ZigoEngine.unpauseTween(this, props);
});
shortcuts.pauseAllTweens = function () {
com.mosesSupposes.fuse.ZigoEngine.pauseTween("ALL");
};
shortcuts.resumeAllTweens = (shortcuts.unpauseAllTweens = function () {
com.mosesSupposes.fuse.ZigoEngine.unpauseTween("ALL");
});
shortcuts.ffTween = function (props) {
com.mosesSupposes.fuse.ZigoEngine.ffTween(this, props);
};
shortcuts.rewTween = function (props, suppressStartEvents) {
com.mosesSupposes.fuse.ZigoEngine.rewTween(this, props, false, suppressStartEvents);
};
shortcuts.rewAndPauseTween = function (props, suppressStartEvents) {
com.mosesSupposes.fuse.ZigoEngine.rewTween(this, props, true, suppressStartEvents);
};
shortcuts.skipTweenTo = function (seconds, props) {
com.mosesSupposes.fuse.ZigoEngine.skipTweenTo(seconds, this, props);
};
shortcuts.bezierTo = function (destX, destY, controlX, controlY, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_bezier_", {x:destX, y:destY, controlX:controlX, controlY:controlY}, seconds, ease, delay, callback));
};
shortcuts.colorTransformTo = function (ra, rb, ga, gb, ba, bb, aa, ab, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_colorTransform", {ra:ra, rb:rb, ga:ga, gb:gb, ba:ba, bb:bb, aa:aa, ab:ab}, seconds, ease, delay, callback));
};
shortcuts.tintTo = function (rgb, percent, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_tint", {tint:rgb, percent:percent}, seconds, ease, delay, callback));
};
shortcuts.slideTo = function (destX, destY, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_x,_y", [destX, destY], seconds, ease, delay, callback));
};
shortcuts.fadeIn = function (seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_fade", 100, seconds, ease, delay, callback));
};
shortcuts.fadeOut = function (seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_fade", 0, seconds, ease, delay, callback));
};
mcshortcuts = new Object();
mcshortcuts._frame = {getter:function () {
return(this._currentframe);
}, setter:function (v) {
this.gotoAndStop(Math.round(v));
}};
mcshortcuts.frameTo = function (endframe, seconds, ease, delay, callback) {
return(com.mosesSupposes.fuse.ZigoEngine.doTween(this, "_frame", ((endframe != undefined) ? (endframe) : (this._totalframes)), seconds, ease, delay, callback));
};
}
static var registryKey = "shortcuts";
static var shortcuts = null;
static var mcshortcuts = null;
}
Symbol 1921 MovieClip [__Packages.com.mosesSupposes.fuse.FuseKitCommon] Frame 0
class com.mosesSupposes.fuse.FuseKitCommon
{
static var logOutput;
function FuseKitCommon () {
}
static function _cts() {
return("|_tint|_tintPercent|_brightness|_brightOffset|_contrast|_invertColor|_colorReset|_colorTransform|");
}
static function _resetTo100() {
return("|_alpha|_contrast|_invertColor|_tintPercent|_xscale|_yscale|_scale|");
}
static function _resetTo0() {
return("|_brightness|_brightOffset|_colorReset|_rotation|");
}
static function _underscoreable() {
return(_cts() + "_frame|_x|_y|_xscale|_yscale|_scale|_width|_height|_size|_rotation|_alpha|_fade|_visible|");
}
static function _cbprops() {
return("|skipLevel|cycles|roundResults|extra1|extra2|func|scope|args|startfunc|startscope|startargs|updfunc|updscope|updargs|");
}
static function _fuseEvents() {
return("|onStart|onStop|onPause|onResume|onAdvance|onComplete|");
}
static function _fuseprops() {
return("|command|label|delay|event|eventparams|target|addTarget|trigger|startAt|ease|easing|seconds|duration|time|");
}
static function _validateFuseCommand(c, inGroup, hasArg, outputLevel, simple) {
var _local1 = false;
var _local2 = false;
switch (c) {
case "start" :
case "stop" :
case "pause" :
case "resume" :
case "setStartProps" :
if (inGroup != true) {
_local1 = true;
}
break;
case "delay" :
case "trigger" :
if (simple == true) {
if (hasArg == true) {
_local1 = true;
}
} else {
_local2 = true;
}
inGroup = false;
break;
case "skipTo" :
if (!((hasArg == true) && (inGroup != true))) {
break;
}
_local1 = true;
}
if ((outputLevel > 0) && (_local1 == false)) {
error("109", c, inGroup, _local2);
}
return(_local1);
}
static function output(s) {
if (typeof(logOutput) == "function") {
logOutput(s);
} else {
trace(s);
}
}
static function error(errorCode) {
var _local3 = arguments[1];
var _local4 = arguments[2];
var _local6 = arguments[3];
if (VERBOSE != true) {
output(("[FuseKitCommon#" + errorCode) + "]");
return(undefined);
}
var _local2 = "";
var _local5 = newline;
switch (errorCode) {
case "001" :
_local2 = _local2 + "** ERROR: When using simpleSetup to extend prototypes, you must pass the Shortcuts class. **";
_local2 = _local2 + (_local5 + " import com.mosesSupposes.fuse.*;");
_local2 = _local2 + ((_local5 + " ZigoEngine.simpleSetup(Shortcuts);") + _local5);
break;
case "002" :
_local2 = _local2 + "** ZigoEngine.doShortcut: shortcuts missing. Use the setup commands: import com.mosesSupposes.fuse.*; ZigoEngine.register(Shortcuts); **";
break;
case "003" :
_local2 = _local2 + ((_local5 + "*** Error: DO NOT use #include \"lmc_tween.as\" with this version of ZigoEngine! ***") + _local5);
break;
case "004" :
_local2 = _local2 + (("** ZigoEngine.doTween - too few arguments [" + _local3) + "].");
if (Boolean(_local4) == true) {
_local2 = _local2 + " If you are trying to use Object Syntax without Fuse, pass FuseItem in your register() or simpleSetup() call. **";
} else {
_local2 = _local2 + " Object syntax call failed. **";
}
break;
case "005" :
_local2 = _local2 + (((("** ZigoEngine.doTween - missing targets[" + _local3) + "] and/or props[") + _local4) + "] **");
break;
case "006" :
_local2 = _local2 + (("** Error: easing shortcut string not recognized (\"" + _local3) + "\"). You may need to pass the in PennerEasing class during register or simpleSetup. **");
break;
case "007" :
_local2 = _local2 + (((("- ZigoEngine: Target locked [" + _local3) + "], ignoring tween call [") + _local4) + "]");
break;
case "008" :
_local2 = _local2 + "** You must register the Shortcuts class in order to use easy string-type callback parsing. **";
break;
case "009" :
_local2 = _local2 + (("** ZigoEngine: A callback parameter \"" + _local3) + "\" was not recognized. **");
break;
case "010" :
_local2 = _local2 + ((((("** " + ((_local3 == true) ? "ZigoEngine" : "FuseItem")) + " unable to parse ") + ((_local4 == 1) ? "callback[" : (String(_local4) + " callbacks["))) + _local6) + "]. Try using the syntax {scope:this, func:\"myFunction\"} **");
break;
case "011" :
_local2 = _local2 + (((("- ZigoEngine: Callbacks discarded via skipLevel 2 option [" + _local3) + "|") + _local4) + "].");
break;
case "012" :
_local2 = _local2 + (((((("- Engine set props or ignored no-change tween on: " + _local3) + ", props passed:[") + _local4) + "], endvals passed:[") + _local6) + "]");
break;
case "013" :
_local2 = _local2 + (((((("- Engine added tween on:\n\ttargets:[" + _local3) + "]\n\tprops:[") + _local4) + "]\n\tendvals:[") + _local6) + "]");
break;
case "014" :
_local2 = _local2 + "** Error: easing function passed is not usable with this engine. Functions need to follow the Robert Penner model. **";
break;
case "015" :
_local2 = _local2 + "** Error: The CustomEasing class must be passed during setup (register or simpleSetup) to use custom easing Arrays. **";
break;
case "016" :
_local2 = _local2 + (("[ ZigoEngine.TIME_MULTIPLIER: " + String(Number(Number(_local3) * 100))) + "% ]");
break;
case "101" :
_local2 = _local2 + "** ERROR: Fuse simpleSetup was removed in version 2.0! **";
_local2 = _local2 + (_local5 + " You must now use the following commands:");
_local2 = _local2 + ((_local5 + _local5) + "\timport com.mosesSupposes.fuse.*;");
_local2 = _local2 + (_local5 + "\tZigoEngine.simpleSetup(Shortcuts, PennerEasing, Fuse);");
_local2 = _local2 + ((_local5 + "Note that PennerEasing is optional, and FuseFMP is also accepted. (FuseFMP.simpleSetup is run automatically if included.)") + _local5);
break;
case "102" :
_local2 = _local2 + (((("** Fuse " + _local3) + " index or label not found (") + _local4) + ") or out of range. **");
break;
case "103" :
_local2 = _local2 + (((("** Fuse skipTo (" + _local3) + ") ignored - targets the current index (") + _local4) + "). **");
break;
case "104" :
_local2 = _local2 + (("** Fuse fastForward index out of play range (" + _local3) + ") - skipTo has been called instead. **");
break;
case "105" :
_local2 = _local2 + "** An unsupported Array method was called on Fuse. **";
break;
case "106" :
_local2 = _local2 + "** ERROR: You have not set up Fuse correctly. **";
_local2 = _local2 + (_local5 + "You must now use the following commands (PennerEasing is optional).");
_local2 = _local2 + (_local5 + "\timport com.mosesSupposes.fuse.*;");
_local2 = _local2 + ((_local5 + "\tZigoEngine.simpleSetup(Shortcuts, PennerEasing, Fuse);") + _local5);
break;
case "107" :
_local2 = _local2 + "** Fuse :: id not found - Aborting open(). **";
break;
case "108" :
_local2 = _local2 + "** Fuse.startRecent: No recent Fuse found to start! **";
break;
case "109" :
_local2 = _local2 + (("** Command \"" + _local3) + "\" discarded. ");
if (_local4 == true) {
_local2 = _local2 + "Not allowed within a group. **";
} else if (_local6 == true) {
_local2 = _local2 + (("Not supported in Object Syntax, use the " + _local3) + " property instead. **");
} else {
_local2 = _local2 + "The command may be unrecognized or missing an argument. **";
}
break;
case "110" :
_local2 = _local2 + (((("** " + _local3) + " illegal Fuse property discarded:\"") + _local4) + "\". Bezier keywords other than x and y cannot be set as start values. **");
break;
case "112" :
_local2 = _local2 + "** Fuse: missing com.mosesSupposes.fuse.ZigoEngine! Cannot tween. **";
break;
case "113" :
_local2 = _local2 + "** FuseItem: A callback has been discarded. Actions with a command may only contain: label, delay, scope, args. **";
break;
case "115" :
_local2 = _local2 + ((_local3 + " overlapping prop discarded: ") + _local4);
break;
case "116" :
_local2 = _local2 + ("** FuseItem Error: Delays within groups (arrays) and start/update callbacks are not supported when using Fuse without ZigoEngine. Although you need to restructure your Fuse, it should be possible to achieve the same results. **" + _local5);
break;
case "117" :
_local2 = _local2 + (("** " + _local3) + ": infinite cycles are not allowed within Fuses - discarded. **");
break;
case "118" :
_local2 = _local2 + ((("** " + _local3) + ": No targets found!") + ((_local4 == true) ? " [Unable to set start props] **" : " [Skipping tween parameters in this action] **"));
break;
case "119" :
_local2 = _local2 + ((((("** " + _local3) + ": ") + ((_local4 == 1) ? "" : (_local4 + " actions in the group"))) + " missing targets") + ((_local6 == true) ? " during setStartProps **" : " **"));
break;
case "120" :
_local2 = _local2 + (((("** " + _local3) + ": conflict with \"") + _local4) + "\". Property might be doubled within a grouped-action array. **");
break;
case "121" :
_local2 = _local2 + "** Fuse timecode formatting requires \"00:\" formatting (example:\"01:01:33\" yields 61.33 seconds.) **";
break;
case "122" :
_local2 = _local2 + (("** Event \"" + _local3) + "\" reserved by Fuse. **");
break;
case "123" :
_local2 = _local2 + (("** A Fuse event parameter failed in " + _local3) + " **");
break;
case "124" :
_local2 = _local2 + (((("** " + _local3) + ": trigger:") + _local4) + " ignored - only one trigger is allowed per action **");
break;
case "125" :
_local2 = _local2 + (_local3 + " Warning - fastForward hit an item during its tween cycle, may malfunction.");
break;
case "201" :
_local2 = _local2 + (("**** FuseFMP cannot initialize argument " + _local3) + " (BitmapFilters cannot be applied to this object type) ****");
break;
case "202" :
_local2 = _local2 + (((("** FuseFMP error: A " + _local3) + " could not be created for ") + _local4) + " **");
break;
case "203" :
_local2 = _local2 + (("** FuseFMP.setFilterProps - too few arguments passed (" + _local3) + ") - minimum 2 required. **");
break;
case "204" :
_local2 = _local2 + (("** FuseFMP.setFilterProps could not locate the filter passed. (" + _local3) + ") **");
}
output(_local2);
}
static function parseCallback(callback, targets, outputLevel, callerIsEngine, addprefix) {
if (callback._vcb == true) {
return(callback);
}
var validCBs = {_vcb:true, skipLevel:_global.com.mosesSupposes.fuse.ZigoEngine.SKIP_LEVEL, cycles:1};
if (callback == undefined) {
return(validCBs);
}
var cbErrors = [];
if (typeof(callback) == "object") {
if (((callback.skipLevel != undefined) && (typeof(callback.skipLevel) == "number")) && (callback.skipLevel != _global.com.mosesSupposes.fuse.ZigoEngine.SKIP_LEVEL)) {
if ((callback.skipLevel >= 0) && (callback.skipLevel <= 2)) {
validCBs.skipLevel = callback.skipLevel;
}
}
if (callback.cycles != undefined) {
if ((typeof(callback.cycles) == "number") && (callback.cycles > -1)) {
validCBs.cycles = callback.cycles;
} else if (callback.cycles.toUpperCase() == "LOOP") {
validCBs.cycles = 0;
}
}
if (callback.extra1 != undefined) {
validCBs.extra1 = callback.extra1;
}
if (callback.extra2 != undefined) {
validCBs.extra2 = callback.extra2;
}
if ((callback.roundResults === true) || (callback.roundResults === false)) {
validCBs.roundResults = callback.roundResults;
}
} else {
callback = {func:callback};
}
var prefixes = ["start", "upd", ""];
var easyfuncparse = _global.com.mosesSupposes.fuse.Shortcuts.parseStringTypeCallback;
for (var i in prefixes) {
var prefix = prefixes[i];
var fstr = callback[prefix + "func"];
if (((fstr != undefined) && (typeof(fstr) == "string")) && (fstr.indexOf("(") > -1)) {
if (easyfuncparse != undefined) {
var efc = easyfuncparse(fstr);
if (efc.func != undefined) {
callback[prefix + "scope"] = efc.scope;
callback[prefix + "func"] = efc.func;
callback[prefix + "args"] = efc.args;
}
} else if (outputLevel > 0) {
error("008");
}
}
}
var basescope = callback.scope;
for (var i in callback) {
var fi = i.toLowerCase().indexOf("func");
if (fi > -1) {
var prefix = i.slice(0, fi);
var func = callback[i];
var args = callback[prefix + "args"];
var scope = ((callback[prefix + "scope"] == undefined) ? (basescope) : (callback[prefix + "scope"]));
if ((typeof(func) == "string") && (scope[func] == undefined)) {
for (var j in targets) {
var targ = targets[j];
if (typeof(targ[func]) == "function") {
scope = targ;
break;
}
if (typeof(targ._parent[func]) == "function") {
scope = targ._parent;
break;
}
}
if ((scope == undefined) && (_level0[func] != undefined)) {
scope = _level0;
}
if ((scope == undefined) && (_global[func] != undefined)) {
scope = _global;
}
}
if (typeof(func) != "function") {
if (typeof(scope[String(func)]) == "function") {
func = scope[String(func)];
} else {
func = eval (String(func));
}
}
if (func == undefined) {
cbErrors.push(String((((((((addprefix == null) ? (i) : (addprefix + i)) + ":") + ((typeof(callback[i]) == "string") ? (("\"" + callback[i]) + "\"") : (callback[i]))) + "/") + prefix) + "scope:") + scope));
} else {
if ((args != undefined) && (!(args instanceof Array))) {
args = [args];
}
if (prefix == "") {
prefix = "end";
}
validCBs[prefix] = {s:scope, f:func, a:args};
if (callerIsEngine == true) {
validCBs[prefix].id = ++cbTicker;
}
if (prefix == "start") {
validCBs.start.fired = false;
}
}
} else if (_cbprops().indexOf(("|" + i) + "|") == -1) {
error("009", i);
}
}
if ((cbErrors.length > 0) && (outputLevel > 0)) {
if (outputLevel > 0) {
error("010", callerIsEngine, cbErrors.length, cbErrors.toString());
}
}
return(validCBs);
}
static var VERSION = "Fuse Kit 2.1.4 Copyright (c) 2006 Moses Gunesch, MosesSupposes.com under MIT Open Source License";
static var VERBOSE = true;
static var ALL = "ALL";
static var ALLCOLOR = "ALLCOLOR";
static var cbTicker = 0;
}
Symbol 1922 MovieClip [__Packages.com.mosesSupposes.fuse.ZigoEngine] Frame 0
class com.mosesSupposes.fuse.ZigoEngine
{
static var extensions, updateTime, tweenHolder, instance, _listeners, broadcastMessage, updateIntId;
function ZigoEngine () {
}
static function addListener(handler) {
AsBroadcaster.initialize(com.mosesSupposes.fuse.ZigoEngine);
addListener(handler);
}
static function removeListener(handler) {
}
static function isPlaying() {
return(_playing);
}
static function simpleSetup(shortcutsClass) {
if (arguments.length > 0) {
register.apply(com.mosesSupposes.fuse.ZigoEngine, arguments);
}
_global.ZigoEngine = com.mosesSupposes.fuse.ZigoEngine;
if (extensions.fuse != undefined) {
_global.Fuse = extensions.fuse;
}
if (extensions.fuseFMP != undefined) {
extensions.fuseFMP.simpleSetup();
}
initialize(MovieClip.prototype, Button.prototype, TextField.prototype);
if (extensions.shortcuts == undefined) {
com.mosesSupposes.fuse.FuseKitCommon.error("001");
}
}
static function register(classReference) {
if (extensions == undefined) {
extensions = {};
}
var _local3 = "|fuse|fuseItem|fuseFMP|shortcuts|pennerEasing|customEasing|";
for (var _local4 in arguments) {
var _local2 = arguments[_local4].registryKey;
if ((extensions[_local2] == undefined) && (_local3.indexOf(("|" + _local2) + "|") > -1)) {
extensions[_local2] = arguments[_local4];
if ((_local2 == "fuseFMP") || (_local2 == "shortcuts")) {
Object(extensions[_local2]).initialize();
}
}
}
}
static function initialize(target) {
if (arguments.length > 0) {
initializeTargets.apply(com.mosesSupposes.fuse.ZigoEngine, arguments);
if (extensions.shortcuts != undefined) {
extensions.shortcuts.addShortcutsTo.apply(extensions.shortcuts, arguments);
}
}
}
static function deinitialize(target) {
if ((arguments.length == 0) || (target == null)) {
arguments.push(MovieClip.prototype, Button.prototype, TextField.prototype);
}
deinitializeTargets.apply(com.mosesSupposes.fuse.ZigoEngine, arguments);
if (extensions.shortcuts != undefined) {
extensions.shortcuts.removeShortcutsFrom.apply(extensions.shortcuts, arguments);
}
}
static function getUpdateInterval() {
return(updateTime);
}
static function setUpdateInterval(time) {
if (_playing) {
setup(true);
updateTime = time;
setup();
} else {
updateTime = time;
}
}
static function getControllerDepth() {
return(tweenHolder.getDepth());
}
static function setControllerDepth(depth) {
if ((depth == null) || (_global.isNaN(depth) == true)) {
depth = 6789;
}
if (Object(tweenHolder).proof != null) {
tweenHolder.swapDepths(depth);
} else {
tweenHolder = _root.createEmptyMovieClip("ZigoEnginePulse", depth);
}
}
static function doShortcut(targets, methodName) {
if (extensions.shortcuts == undefined) {
if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("002");
}
return(null);
}
return(extensions.shortcuts.doShortcut.apply(extensions.shortcuts, arguments));
}
static function doTween(targets, props, endvals, seconds, ease, delay, callback) {
if (extensions.fuse.addBuildItem(arguments) == true) {
return(null);
}
if (TIME_MULTIPLIER != prevTimeMult) {
TIME_MULTIPLIER = Math.abs(TIME_MULTIPLIER);
if (_global.isNaN(TIME_MULTIPLIER) == true) {
TIME_MULTIPLIER = 1;
}
if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("016", TIME_MULTIPLIER);
}
prevTimeMult = TIME_MULTIPLIER;
}
if ((instance == undefined) || ((Object(tweenHolder).proof == undefined) && (updateTime == undefined))) {
if ((MovieClip.prototype.tween != null) && (typeof(_global.$tweenManager) == "object")) {
com.mosesSupposes.fuse.FuseKitCommon.error("003");
}
instance = new com.mosesSupposes.fuse.ZManager();
_playing = false;
}
var _local4 = instance.paramsObj(targets, props, endvals, true);
var _local7 = (((_local4.tg[0] == null) || (_local4.tg.length == 0)) ? undefined : (_local4.tg));
if (((_local4.pa == undefined) || (_local7 == undefined)) || (arguments.length < 3)) {
if (((extensions.fuseItem != null) && (arguments.length == 1)) && (typeof(arguments[0]) == "object")) {
return(extensions.fuseItem.doTween(arguments[0]));
}
if (OUTPUT_LEVEL > 0) {
if (arguments.length < 3) {
com.mosesSupposes.fuse.FuseKitCommon.error("004", (((arguments.length == 1) && (arguments[0] == null)) ? "1 (null)" : (String(arguments.length))), Boolean(extensions.fuseItem == null));
} else {
com.mosesSupposes.fuse.FuseKitCommon.error("005", _local7.toString(), _local4.pa.toString());
}
}
return(null);
}
if (_playing != true) {
setup();
}
if ((seconds == null) || (_global.isNaN(seconds) == true)) {
seconds = DURATION || 1;
} else if (seconds < 0.01) {
seconds = 0;
}
seconds = seconds * TIME_MULTIPLIER;
if (((delay < 0.01) || (delay == null)) || (_global.isNaN(delay) == true)) {
delay = 0;
}
delay = delay * TIME_MULTIPLIER;
var _local12 = com.mosesSupposes.fuse.FuseKitCommon.parseCallback(callback, _local7, OUTPUT_LEVEL, true);
var _local9;
if (typeof(ease) == "function") {
if (typeof(Function(ease).call(null, 1, 1, 1, 1)) == "number") {
_local9 = Function(ease);
} else if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("014", ease);
}
} else if ((ease == null) || (ease == "")) {
if (EASING instanceof Function) {
_local9 = Function(EASING);
} else if (extensions.pennerEasing != undefined) {
ease = EASING;
}
}
if ((typeof(ease) == "string") && (ease != "")) {
if (extensions.pennerEasing[ease] != undefined) {
_local9 = extensions.pennerEasing[ease];
} else if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("006", ease);
}
} else if (ease instanceof Array) {
if (extensions.customEasing != undefined) {
_local12.extra1 = ease;
if (typeof(ease[0]) == "number") {
_local9 = extensions.customEasing.precalced;
} else {
_local9 = extensions.customEasing.fromCurve;
}
} else if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("015", ease);
}
}
if (typeof(_local9) != "function") {
_local9 = function (t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
};
}
if (_listeners.length > 0) {
broadcastMessage.call(com.mosesSupposes.fuse.ZigoEngine, "onTweenAdd", _local7, _local4.pa, _local4.va, seconds, _local9, delay, _local12);
}
var _local6 = "";
for (var _local13 in _local7) {
var _local3 = _local7[_local13];
if (_local3.__zigoID__ == null) {
initializeTargets(_local3);
} else if (instance.getStatus("locked", _local3) == true) {
if (OUTPUT_LEVEL > 0) {
com.mosesSupposes.fuse.FuseKitCommon.error("007", ((_local3._name != undefined) ? (_local3._name) : (_local3.toString())), _local4.pa.toString());
}
continue;
}
var _local5 = instance.addTween(_local3, _local4.pa, _local4.va, seconds, _local9, delay, _local12);
_local6 = ((_local5 == null) ? "|" : (_local5 + "|")) + _local6;
}
_local6 = _local6.slice(0, -1);
return((((_local6 == "") || (_local6 == "|")) ? null : (_local6)));
}
static function removeTween(targs, props) {
instance.removeTween(targs, props);
}
static function isTweening(targ, prop) {
return(Boolean(instance.getStatus("active", targ, prop)));
}
static function getTweens(targ) {
if (instance == undefined) {
return(0);
}
return(Number(instance.getStatus("count", targ)));
}
static function lockTween(targ, setLocked) {
instance.alterTweens("lock", targ, setLocked == true);
}
static function isTweenLocked(targ) {
return(Boolean(instance.getStatus("locked", targ)));
}
static function ffTween(targs, props, suppressEndEvents) {
instance.alterTweens("ff", targs, props, null, suppressEndEvents);
}
static function skipTweenTo(seconds, targs, props) {
instance.alterTweens("skipTo", targs, props, false, false, seconds);
}
static function rewTween(targs, props, pauseFlag, suppressStartEvents) {
instance.alterTweens("rewind", targs, props, pauseFlag, suppressStartEvents);
}
static function isTweenPaused(targ, prop) {
return(Boolean(instance.getStatus("paused", targ, prop)));
}
static function pauseTween(targs, props) {
instance.alterTweens("pause", targs, props);
}
static function unpauseTween(targs, props) {
instance.alterTweens("unpause", targs, props);
}
static function resumeTween(targs, props) {
instance.alterTweens("unpause", targs, props);
}
static function setColorByKey(targetObj, type, amt, rgb) {
new Color(targetObj).setTransform(getColorTransObj(type, amt, rgb));
}
static function getColorTransObj(type, amt, rgb) {
switch (type) {
case "brightness" :
var _local3 = 100 - Math.abs(amt);
var _local4 = ((amt > 0) ? (255 * (amt / 100)) : 0);
return({ra:_local3, rb:_local4, ga:_local3, gb:_local4, ba:_local3, bb:_local4});
case "brightOffset" :
return({ra:100, rb:255 * (amt / 100), ga:100, gb:255 * (amt / 100), ba:100, bb:255 * (amt / 100)});
case "contrast" :
return({ra:amt, rb:128 - (1.28 * amt), ga:amt, gb:128 - (1.28 * amt), ba:amt, bb:128 - (1.28 * amt)});
case "invertColor" :
return({ra:100 - (2 * amt), rb:amt * 2.55, ga:100 - (2 * amt), gb:amt * 2.55, ba:100 - (2 * amt), bb:amt * 2.55});
case "tint" :
if (rgb == null) {
break;
}
var _local5;
if (typeof(rgb) == "string") {
if (rgb.charAt(0) == "#") {
rgb = rgb.slice(1);
}
rgb = ((rgb.charAt(1).toLowerCase() != "x") ? ("0x" + rgb) : (rgb));
}
_local5 = Number(rgb);
return({ra:100 - amt, rb:(_local5 >> 16) * (amt / 100), ga:100 - amt, gb:((_local5 >> 8) & 255) * (amt / 100), ba:100 - amt, bb:(_local5 & 255) * (amt / 100)});
}
return({rb:0, ra:100, gb:0, ga:100, bb:0, ba:100});
}
static function getColorKeysObj(targOrTransObj) {
var _local1 = ((targOrTransObj.ra != undefined) ? (targOrTransObj) : (new Color(targOrTransObj).getTransform()));
var _local6 = (_local1.ra == _local1.ga) && (_local1.ga == _local1.ba);
var _local8 = (_local1.rb == _local1.gb) && (_local1.gb == _local1.bb);
var _local3 = {tintPercent:Number(((_local6 == true) ? (100 - _local1.ra) : 0))};
if (_local3.tintPercent != 0) {
var _local5 = 100 / _local3.tintPercent;
_local3.tint = (((_local1.rb * _local5) << 16) | ((_local1.gb * _local5) << 8)) | (_local1.bb * _local5);
var _local2 = _local3.tint.toString(16);
var _local4 = 6 - _local2.length;
while ((_local4--) > 0) {
_local2 = "0" + _local2;
}
_local3.tintString = "0x" + _local2.toUpperCase();
}
if ((_local6 == true) && (_local8 == true)) {
if (_local1.ra < 0) {
_local3.invertColor = _local1.rb * 0.392156862745098;
} else if ((_local1.ra == 100) && (_local1.rb != 0)) {
_local3.brightOffset = _local1.rb * 0.392156862745098;
}
if (_local1.ra != 100) {
if ((_local1.rb == 0) || ((_local1.rb != 0) && (((255 * ((100 - _local1.ra) / 100)) - _local1.rb) <= 1))) {
_local3.brightness = ((_local1.rb != 0) ? (100 - _local1.ra) : (_local1.ra - 100));
}
if (((128 - (1.28 * _local1.ra)) - _local1.rb) <= 1) {
_local3.contrast = _local1.ra;
}
}
}
return(_local3);
}
static function initializeTargets() {
for (var _local5 in arguments) {
var _local4 = arguments[_local5];
if ((((_local4 == MovieClip.prototype) || (_local4 == Button.prototype)) || (_local4 == TextField.prototype)) || (_local4 == Object.prototype)) {
if (_local4.oldAddListener == undefined) {
if (_local4 == TextField.prototype) {
_local4.oldAddListener = _local4.addListener;
_global.ASSetPropFlags(_local4, "oldAddListener", 7, 1);
}
_local4.addListener = function (o) {
if (this.__zigoID__ == undefined) {
com.mosesSupposes.fuse.ZigoEngine.initializeTargets(this);
}
if (this instanceof TextField) {
Function(this.oldAddListener).call(this, o);
} else {
this.addListener(o);
}
};
if (_local4 == MovieClip.prototype) {
_global.ASSetPropFlags(_local4, "addListener", 7, 1);
}
}
} else if (_local4.__zigoID__ == undefined) {
_local4.__zigoID__ = zigoIDs;
_global.ASSetPropFlags(_local4, "__zigoID__", 7, 1);
zigoIDs++;
if ((_local4._listeners == null) || (_local4.addListener == null)) {
AsBroadcaster.initialize(_local4);
}
}
}
}
static function deinitializeTargets() {
for (var _local4 in arguments) {
var _local3 = arguments[_local4];
if (_local3.__zigoID__ != undefined) {
_global.ASSetPropFlags(_local3, "__zigoID__,_listeners,broadcastMessage,addListener,removeListener", 0, 2);
delete _local3.__zigoID__;
delete _local3._listeners;
delete _local3.broadcastMessage;
delete _local3.addListener;
delete _local3.removeListener;
}
if (_local3.oldAddListener != undefined) {
_global.ASSetPropFlags(_local3, "oldAddListener", 0, 2);
_local3.addListener = _local3.oldAddListener;
delete _local3.oldAddListener;
}
}
}
static function __mgrRelay(inst, method, args) {
if (inst == instance) {
Function(com.mosesSupposes.fuse.ZigoEngine[method]).apply(com.mosesSupposes.fuse.ZigoEngine, args);
}
}
static function setup(deinitFlag) {
if (deinitFlag == true) {
_playing = false;
clearInterval(updateIntId);
delete tweenHolder.onEnterFrame;
return(undefined);
}
instance.cleanUp();
clearInterval(updateIntId);
delete updateIntId;
if ((updateTime != null) && (updateTime > 0)) {
updateIntId = setInterval(instance, "update", updateTime);
} else {
if (Object(tweenHolder).proof == null) {
setControllerDepth(6789);
Object(tweenHolder).proof = 1;
}
var _inst = instance;
tweenHolder.onEnterFrame = function () {
_inst.update.call(_inst);
};
}
_playing = true;
instance.now = getTimer();
}
static var VERSION = com.mosesSupposes.fuse.FuseKitCommon.VERSION + ", ZigoEngine based on concepts by L.Zigo";
static var EASING = "easeOutQuint";
static var DURATION = 1;
static var TIME_MULTIPLIER = 1;
static var ROUND_RESULTS = false;
static var OUTPUT_LEVEL = 1;
static var AUTOSTOP = false;
static var SKIP_LEVEL = 0;
static var _playing = false;
static var zigoIDs = 0;
static var prevTimeMult = 1;
}
Symbol 1923 MovieClip [__Packages.com.mosesSupposes.fuse.ZManager] Frame 0
class com.mosesSupposes.fuse.ZManager
{
var tweens, now;
function ZManager () {
tweens = {};
numTweens = 0;
}
function addTween(obj, props, endvals, seconds, ease, delay, callback) {
var _local24 = ((callback.skipLevel == undefined) ? 0 : (callback.skipLevel));
var _local44 = ((callback.cycles == undefined) ? 1 : (callback.cycles));
var _local30 = callback.extra1;
var _local29 = callback.extra2;
var _local23 = [];
var _local14 = _global.com.mosesSupposes.fuse.FuseFMP;
var _local43 = String(("|" + _local14.getAllShortcuts().join("|")) + "|");
var _local42 = com.mosesSupposes.fuse.FuseKitCommon._cts();
var _local25 = "";
var _local28 = "";
var _local22 = obj.__zigoID__;
var _local7 = tweens[String(_local22)];
if ((_local7 != undefined) && (com.mosesSupposes.fuse.ZigoEngine.AUTOSTOP == true)) {
if (obj._listeners.length > 0) {
for (var _local40 in _local7.props) {
_local23.unshift(_local40);
}
}
_local7.numProps = 0;
cleanUp(true);
}
for (var _local47 in props) {
var _local5 = props[_local47];
var _local4 = endvals[_local47];
var _local15 = 0;
if (_local5 == "_fade") {
_local5 = "_alpha";
_local15 = ((_local4 < 50) ? -1 : 1);
}
var _local16 = _local42.indexOf(("|" + _local5) + "|") > -1;
var _local18 = _local7.colorProp;
if (_local7 != undefined) {
if ((_local16 == true) && (_local18 != undefined)) {
_local23.unshift(_local18);
delete _local7.props[_local18];
delete _local7.colorProp;
_local7.numProps--;
} else if (_local7.props[_local5] != undefined) {
_local23.unshift(_local5);
delete _local7[_local5];
_local7.numProps--;
}
}
var _local3 = {c:-1, fmp:-1, complex:-1};
var _local11 = ((_local24 == 0) && ((seconds + delay) == 0)) || ((_local24 > 0) && (seconds == 0));
var _local10 = false;
var _local13 = (_local14 != undefined) && (_local43.indexOf(("|" + _local5) + "|") > -1);
var _local19 = (_local5.toLowerCase().indexOf("colors") > -1) && (_local4 instanceof Array);
var _local27 = ((_local13 == true) && (_local5.indexOf("lor") > -1)) && (_local5.charAt(2) != "l");
if (_local13 == true) {
_local3.fmp = _local14;
_local3.ps = _local14.getFilterProp(obj, _local5, true);
_local3.special = true;
}
if (((_local16 == true) || (_local19 == true)) || (_local27 && (_local11 == false))) {
_local3.complex = 1;
if (_local16 == true) {
_local3.c = new Color(obj);
_local3.ps = Color(_local3.c).getTransform();
var _local17 = ((((_local5 == "_tint") || (_local5 == "_tintPercent")) || (_local5 == "_colorReset")) ? "tint" : (_local5.slice(1)));
var _local9 = null;
var _local12 = null;
if (_local5 != "_colorTransform") {
if (_local17 == "tint") {
if (typeof(_local4) == "object") {
_local12 = _local4.tint;
_local9 = ((_global.isNaN(_local4.percent) == true) ? 100 : (_local4.percent));
} else if ((_local5 == "_tintPercent") || (_local5 == "_colorReset")) {
var _local20 = com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(obj).tintPercent;
if (_local5 == "_colorReset") {
_local9 = Math.min(_local20, 100 - Math.abs(Number(_local4)));
} else {
_local9 = ((typeof(_local4) == "string") ? ((_local20 || 0) + Number(_local4)) : Number(_local4));
}
_local9 = Math.max(0, Math.min(_local9, 100));
_local12 = com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(obj).tint || 0;
} else {
_local12 = _local4;
_local9 = 100;
}
} else {
_local9 = ((typeof(_local4) == "string") ? ((com.mosesSupposes.fuse.ZigoEngine.getColorKeysObj(obj)[_local17] || 0) + Number(_local4)) : (_local4));
}
_local4 = com.mosesSupposes.fuse.ZigoEngine.getColorTransObj(_local17, _local9, _local12);
}
if (_local11 == true) {
if (_local5 == "_colorTransform") {
Color(_local3.c).setTransform(_local4);
} else {
com.mosesSupposes.fuse.ZigoEngine.setColorByKey(obj, _local17, _local9, _local12);
}
} else {
var _local21 = getChangeObj(_local3.ps, _local4, false, false);
_local3.ch = _local21.map;
if (_local21.changed == true) {
_local10 = true;
}
}
} else if (_local11 == true) {
_local14.setFilterProp(obj, _local5, _local4);
} else if (_local19 == true) {
_local3.c = 2;
_local3.ch = [];
for (var _local40 in _local4) {
if (_local4[_local40] != null) {
if (_local3.ps == null) {
_local3.ps = [];
}
_local3.ps[_local40] = com.mosesSupposes.fuse.ZigoEngine.getColorTransObj("tint", 100, ((_local3.ps[_local40] == null) ? obj[_local5][_local40] : _local3.ps[_local40]));
var _local21 = getChangeObj(_local3.ps[_local40], com.mosesSupposes.fuse.ZigoEngine.getColorTransObj("tint", 100, _local4[_local40]), true, false);
_local3.ch[_local40] = _local21.map;
if (_local21.changed == true) {
_local10 = true;
}
}
}
} else {
_local3.c = 1;
_local3.ps = com.mosesSupposes.fuse.ZigoEngine.getColorTransObj("tint", 100, _local3.ps);
var _local21 = getChangeObj(_local3.ps, com.mosesSupposes.fuse.ZigoEngine.getColorTransObj("tint", 100, _local4), true, false);
_local3.ch = _local21.map;
if (_local21.changed == true) {
_local10 = true;
}
}
} else if (_local5 == "_bezier_") {
removeTween(obj, "_x,_y", true);
if (_local11 == true) {
if ((_local4.x != null) && (_global.isNaN(Number(_local4.x)) == false)) {
obj._x = ((typeof(_local4.x) == "string") ? (obj._x + Number(_local4.x)) : (_local4.x));
}
if ((_local4.y != null) && (_global.isNaN(Number(_local4.y)) == false)) {
obj._y = ((typeof(_local4.y) == "string") ? (obj._y + Number(_local4.y)) : (_local4.y));
}
} else {
_local3.special = true;
_local3.ps = 0;
_local3.ch = 1;
_local3.bz = {sx:obj._x, sy:obj._y};
if ((_local4.x == null) || (_global.isNaN(Number(_local4.x)))) {
_local4.x = _local3.bz.sx;
}
if ((_local4.y == null) || (_global.isNaN(Number(_local4.y)))) {
_local4.y = _local3.bz.sy;
}
_local3.bz.chx = ((typeof(_local4.x) == "string") ? (Number(_local4.x)) : (_local4.x - _local3.bz.sx));
if (_global.isNaN(_local3.bz.chx) == true) {
_local3.bx.chx = 0;
}
_local3.bz.chy = ((typeof(_local4.y) == "string") ? (Number(_local4.y)) : (_local4.y - _local3.bz.sy));
if (_global.isNaN(_local3.bz.chy) == true) {
_local3.bx.chy = 0;
}
if ((_local4.controlX == null) || (_global.isNaN(Number(_local4.controlX)))) {
_local3.bz.ctrlx = _local3.bz.sx + (_local3.bz.chx / 2);
} else {
_local3.bz.ctrlx = ((typeof(_local4.controlX) == "string") ? (_local3.bz.sx + Number(_local4.controlX)) : (_local4.controlX));
}
if ((_local4.controlY == null) || (_global.isNaN(Number(_local4.controlY)))) {
_local3.bz.ctrly = _local3.bz.sy + (_local3.bz.chy / 2);
} else {
_local3.bz.ctrly = ((typeof(_local4.controlY) == "string") ? (_local3.bz.sy + Number(_local4.controlY)) : (_local4.controlY));
}
_local3.bz.ctrlx = _local3.bz.ctrlx - _local3.bz.sx;
_local3.bz.ctrly = _local3.bz.ctrly - _local3.bz.sy;
_local10 = (_local3.bz.chx + _local3.bz.chy) != 0;
}
} else {
if (typeof(_local4) == "object") {
_local3.complex = ((_local4 instanceof Array) ? 0 : 1);
}
if ((_local5 == "_x") || (_local5 == "_y")) {
removeTween(obj, "_bezier_", true);
}
if ((_local5 == "_frame") && (typeof(obj) == "movieclip")) {
_local3.ps = obj._currentframe;
_local3.special = true;
} else if (_local13 == false) {
if (_local3.complex > -1) {
_local3.ps = ((_local3.complex == 0) ? ([]) : ({}));
for (var _local40 in _local4) {
_local3.ps[_local40] = obj[_local5][_local40];
}
} else {
_local3.ps = obj[_local5];
}
}
if (_local11 == true) {
if (_local13 == true) {
_local14.setFilterProp(obj, _local5, ((typeof(_local4) == "string") ? (_local3.ps + Number(_local4)) : (_local4)));
} else if (_local3.complex > -1) {
for (var _local40 in _local4) {
if ((_local4[_local40] != null) && (_global.isNaN(Number(_local4[_local40])) == false)) {
obj[_local5][_local40] = ((typeof(_local4[_local40]) == "string") ? (_local3.ps[_local40] + Number(_local4[_local40])) : _local4[_local40]);
if (_global.isNaN(obj[_local5][_local40]) == true) {
obj[_local5][_local40] = 0;
}
}
}
} else {
obj[_local5] = ((typeof(_local4) == "string") ? (_local3.ps + Number(_local4)) : (_local4));
if (_local15 == 1) {
obj._visible = true;
} else if (_local15 == -1) {
obj._visible = false;
}
}
} else if (_local3.complex > -1) {
var _local21 = getChangeObj(_local3.ps, _local4, _local13, _local3.complex == 0);
_local3.ch = _local21.map;
if (_local21.changed == true) {
_local10 = true;
}
} else {
if ((_local4 == null) || (_global.isNaN(Number(_local4)))) {
_local4 = _local3.ps;
}
_local3.ch = ((typeof(_local4) == "string") ? (Number(_local4)) : (Number(_local4) - _local3.ps));
if (_global.isNaN(_local3.ch) == true) {
_local3.ch = 0;
}
_local10 = _local3.ch != 0;
}
}
if (((_local24 == 0) && ((_local10 == true) || (_local11 == false))) || ((_local10 == true) && (_local11 == false))) {
if ((_local3.complex > -1) && (!(_local3.c === 2))) {
_local3.ps = [_local3.ps];
_local3.ch = [_local3.ch];
}
_local3.ts = now + (delay * 1000);
_local3.pt = -1;
_local3.d = seconds * 1000;
_local3.ef = ease;
_local3.sf = false;
_local3.cycles = _local44;
if (_local30 != undefined) {
_local3.e1 = _local30;
}
if (_local29 != undefined) {
_local3.e2 = _local29;
}
_local3.v = _local15;
if (callback.start != undefined) {
_local3.scb = callback.start;
}
if (callback.upd != undefined) {
_local3.ucb = callback.upd;
}
if (callback.end != undefined) {
_local3.ecb = callback.end;
}
if (callback.roundResults != undefined) {
_local3.rr = callback.roundResults;
}
if (tweens[String(_local22)] == undefined) {
_local7 = (tweens[String(_local22)] = {numProps:0, locked:false, targ:obj, targID:String(("\"" + ((obj._name != undefined) ? (obj._name) : (obj.toString()))) + "\""), targZID:_local22, props:{}});
numTweens++;
}
if (_local16 == true) {
_local7.colorProp = _local5;
}
_local7.props[_local5] = _local3;
_local7.numProps++;
_local25 = (_local5 + ",") + _local25;
_local28 = (((typeof(_local4) == "string") ? (("\"" + _local4) + "\"") : (_local4)) + ",") + _local28;
}
_local3 = undefined;
}
if ((_local7 == undefined) || (_local7.numProps <= 0)) {
cleanUp();
}
if ((_local23.length > 0) && (com.mosesSupposes.fuse.ZigoEngine._listeners.length > 0)) {
com.mosesSupposes.fuse.ZigoEngine.broadcastMessage("onTweenInterrupt", {target:obj, props:_local23, __zigoID__:_local22, during:"add"});
}
if (_local25 == "") {
if (_local24 == 2) {
if (com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL == 2) {
com.mosesSupposes.fuse.FuseKitCommon.error("011", ((obj._name != undefined) ? (obj._name) : (obj.toString())), props.toString());
}
} else {
var _local48 = obj._listeners.length > 0;
if (_local48 == true) {
obj.broadcastMessage("onTweenStart", {target:obj, props:props});
}
if (callback.start != undefined) {
callback.start.f.apply(callback.start.s, callback.start.a);
}
if (_local48 == true) {
obj.broadcastMessage("onTweenUpdate", {target:obj, props:props});
}
if (callback.upd != undefined) {
callback.upd.f.apply(callback.upd.s, callback.upd.a);
}
if (_local48 == true) {
obj.broadcastMessage("onTweenEnd", {target:obj, props:props});
}
if (callback.end != undefined) {
callback.end.f.apply(callback.end.s, callback.end.a);
}
}
cleanUp();
}
if (com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL == 2) {
if (_local25 == "") {
com.mosesSupposes.fuse.FuseKitCommon.error("012", ((obj._name != undefined) ? (obj._name) : (obj.toString())), props.toString(), endvals.toString());
} else {
com.mosesSupposes.fuse.FuseKitCommon.error("013", ((obj._name != undefined) ? (obj._name) : (obj.toString())), _local25.slice(0, -1), _local28.slice(0, -1));
}
}
return(((_local25 == "") ? null : (_local25.slice(0, -1))));
}
function removeTween(targs, props, noInit) {
var _local4 = {};
var _local12 = paramsObj(targs, props);
if (_local12.none == true) {
return(undefined);
}
var _local16 = _local12.all;
var _local17 = _local12.allprops;
var _local9 = ((_local16 == true) ? (tweens) : (Object(_local12.tg)));
var _local8 = false;
for (var _local20 in _local9) {
var _local3 = ((_local16 == true) ? (_local20) : (String(_local9[_local20].__zigoID__)));
var _local2 = tweens[_local3];
var _local6 = ((_local17 == true) ? (_local2.props) : (_local12.props));
for (var _local14 in _local6) {
var _local5 = (_local14 == com.mosesSupposes.fuse.FuseKitCommon.ALLCOLOR) && (_local2.colorProp != undefined);
if ((_local2.props[_local14] != undefined) || (_local5 == true)) {
if (_local4[_local3] == null) {
_local4[_local3] = [];
}
_local4[_local3].unshift(_local14);
if ((_local14 == _local2.colorProp) || (_local5 == true)) {
delete _local2.props[_local2.colorProp];
delete _local2.colorProp;
} else {
delete _local2.props[_local14];
}
_local2.numProps--;
if (_local2.numProps <= 0) {
_local8 = true;
break;
}
}
}
}
if (com.mosesSupposes.fuse.ZigoEngine._listeners.length > 0) {
for (var _local19 in _local4) {
var _local7 = tweens[_local19].targ;
com.mosesSupposes.fuse.ZigoEngine.broadcastMessage("onTweenInterrupt", {target:((typeof(_local7.addProperty) == "function") ? (_local7) : (("[MISSING(\"" + tweens[_local19].targID) + "\")]")), props:_local4[_local19], __zigoID__:tweens[_local19].targZID, during:((noInit == true) ? "add" : "remove")});
}
}
if (_local8 == true) {
cleanUp(noInit);
}
}
function alterTweens(type, targs, props, pauseFlag, noEvents, skipTo) {
if (type == "lock") {
tweens[String(targs.__zigoID__)].locked = props;
return(undefined);
}
var _local11 = paramsObj(targs, props);
if (_local11.none == true) {
return(undefined);
}
var _local14 = _local11.all;
var _local15 = _local11.allprops;
var _local9 = ((_local14 == true) ? (tweens) : (Object(_local11.tg)));
var _local8 = 0;
for (var _local16 in _local9) {
var _local7 = ((_local14 == true) ? (_local16) : (String(_local9[_local16].__zigoID__)));
var _local5 = tweens[_local7];
var _local4 = ((_local15 == true) ? (_local5.props) : (_local11.props));
if (_local4.ALLCOLOR == true) {
_local4[_local5.colorProp] = true;
delete _local4.ALLCOLOR;
}
for (var _local10 in _local4) {
_local8++;
var _local2 = _local5.props[_local10];
if (type == "rewind") {
if (pauseFlag == true) {
_local2.pt = now;
}
_local2.ts = now;
if (noEvents != true) {
_local2.sf = false;
if (_local2.scb != undefined) {
_local2.scb.fired = false;
}
}
} else if (type == "ff") {
if (noEvents == true) {
_local2.suppressEnd = true;
}
_local2.o = true;
_local2.pt = -1;
_local2.ts = now - _local2.d;
} else if (type == "skipTo") {
_local2.ts = Math.min(now, (_local2.ts + (now - _local2.ts)) - (skipTo * 1000));
} else if (type == "pause") {
if (_local2.pt == -1) {
_local2.pt = now;
}
} else if (type == "unpause") {
if (_local2.pt != -1) {
_local2.ts = now - (_local2.pt - _local2.ts);
_local2.pt = -1;
}
}
}
}
if ((type == "ff") && (_local8 > 0)) {
update();
} else if ((type == "rewind") && (_local8 > 0)) {
update(true);
}
}
function getStatus(type, targ, param) {
if (targ == null) {
return(null);
}
var _local8 = String(targ).toUpperCase() == com.mosesSupposes.fuse.FuseKitCommon.ALL;
var _local4 = tweens[String(targ.__zigoID__)];
switch (type) {
case "paused" :
var _local2 = _local4.props;
if (param != null) {
if (_local2[String(param)] == undefined) {
return(false);
}
return(Boolean(_local2[String(param)].pt != -1));
}
for (var _local6 in _local2) {
if (_local2[_local6].pt != -1) {
return(true);
}
}
return(false);
case "active" :
if (param == null) {
return(Boolean(_local4 != undefined));
}
if (String(param).toUpperCase() == com.mosesSupposes.fuse.FuseKitCommon.ALLCOLOR) {
return(Boolean(_local4.colorProp != undefined));
}
return(Boolean(_local4.props[String(param)] != undefined));
case "count" :
if (!_local8) {
return(_local4.numProps);
}
var _local3 = 0;
for (var _local6 in tweens) {
_local3 = _local3 + tweens[_local6].numProps;
}
return(_local3);
case "locked" :
return(_local4.locked);
}
}
function update(force) {
var _local22 = {};
var _local24 = {};
var _local23 = {};
var _local15 = {};
var _local13 = {};
var _local14 = {};
var _local26 = false;
var _local20 = com.mosesSupposes.fuse.ZigoEngine.ROUND_RESULTS;
for (var _local35 in tweens) {
var _local12 = tweens[_local35];
var _local5 = _local12.targ;
var _local34 = _local12.props;
var _local21 = _local5._listeners.length > 0;
if (_local5.__zigoID__ == undefined) {
_local26 = true;
if (com.mosesSupposes.fuse.ZigoEngine._listeners.length > 0) {
var _local25 = [];
for (var _local30 in _local34) {
_local25.unshift(_local30);
}
com.mosesSupposes.fuse.ZigoEngine.broadcastMessage("onTweenInterrupt", {target:((typeof(_local5.addProperty) == "function") ? (_local5) : (("[MISSING:" + _local12.targID) + "]")), props:_local25, __zigoID__:_local12.targZID, during:"update"});
}
continue;
}
for (var _local30 in _local34) {
var _local3 = _local34[_local30];
if (((_local3.ts > now) || (_local3.pt != -1)) && (force != true)) {
continue;
}
var _local9 = now >= (_local3.ts + _local3.d);
if (_local3.complex == -1) {
var _local6;
if (_local9 == true) {
_local6 = _local3.ps + _local3.ch;
if ((_local3.cycles > 1) || (_local3.cycles == 0)) {
if (_local3.cycles > 1) {
_local3.cycles--;
}
_local3.ps = _local6;
_local3.ch = -_local3.ch;
_local3.ts = now;
_local9 = false;
}
} else {
_local6 = _local3.ef(now - _local3.ts, _local3.ps, _local3.ch, _local3.d, _local3.e1, _local3.e2);
}
if (_global.isNaN(_local6) == false) {
if ((_local30 != "_bezier_") && ((_local3.rr == true) || ((_local20 == true) && (!(_local3.rr === false))))) {
_local6 = Math.round(Number(_local6));
}
if (_local3.special != true) {
_local5[_local30] = _local6;
} else if (_local3.fmp != -1) {
_local3.fmp.setFilterProp(_local5, _local30, _local6);
} else if (_local30 == "_bezier_") {
var _local10 = _local3.bz;
var _local18 = _local10.sx + (_local6 * (((2 * (1 - _local6)) * _local10.ctrlx) + (_local6 * _local10.chx)));
var _local17 = _local10.sy + (_local6 * (((2 * (1 - _local6)) * _local10.ctrly) + (_local6 * _local10.chy)));
if ((_local3.rr == true) || ((_local20 == true) && (!(_local3.rr === false)))) {
_local18 = Math.round(Number(_local18));
_local17 = Math.round(Number(_local17));
}
_local5._x = _local18;
_local5._y = _local17;
} else if (_local30 == "_frame") {
MovieClip(_local5).gotoAndStop(Math.ceil(_local6));
}
}
} else {
var _local16 = (_local9 == true) && ((_local3.cycles > 1) || (_local3.cycles == 0));
var _local7 = [];
for (var _local27 in _local3.ch) {
var _local4 = ((_local3.complex == 0) ? ([]) : ({}));
for (var _local28 in _local3.ch[_local27]) {
var _local8 = _local3.ch[_local27][_local28];
var _local11 = _local3.ps[_local27][_local28];
if (_local9 == true) {
_local4[_local28] = _local11 + _local8;
if (_local16 == true) {
_local3.ch[_local27][_local28] = -_local8;
}
} else {
_local4[_local28] = _local3.ef(now - _local3.ts, _local11, _local8, _local3.d, _local3.e1, _local3.e2);
}
if (_global.isNaN(_local4[_local28]) == false) {
if ((_local3.rr == true) || ((_local20 == true) && (!(_local3.rr === false)))) {
_local4[_local28] = Math.round(_local4[_local28]);
}
}
if ((_local3.fmp == -1) && (_local3.c == -1)) {
_local5[_local30][_local28] = _local4[_local28];
}
}
_local7.push(_local4);
if ((_local3.fmp == -1) && (_local3.c == 2)) {
_local5[_local30][_local27] = Number(((_local4.rb << 16) | (_local4.gb << 8)) | _local4.bb);
}
}
if (_local3.fmp != -1) {
if (_local3.c == 1) {
_local3.fmp.setFilterProp(_local5, _local30, ((_local7[0].rb << 16) | (_local7[0].gb << 8)) | _local7[0].bb);
} else if (_local3.c == 2) {
var _local19 = [];
for (var _local28 in _local7) {
_local19.unshift(((_local7[_local28].rb << 16) | (_local7[_local28].gb << 8)) | _local7[_local28].bb);
}
_local3.fmp.setFilterProp(_local5, _local30, _local19);
} else {
_local3.fmp.setFilterProp(_local5, _local30, _local7[0]);
}
} else if (_local3.c != -1) {
_local3.c.setTransform(_local7[0]);
}
if (_local16 == true) {
if (_local3.cycles > 1) {
_local3.cycles--;
}
_local9 = false;
_local3.ts = now;
_local3.ps = _local7;
}
}
if (_local3.sf == false) {
if (_local3.v != 0) {
_local5._visible = true;
}
if (_local21 == true) {
if (_local15[_local35] == undefined) {
_local15[_local35] = [_local5, []];
}
_local15[_local35][1].unshift(_local30);
}
_local3.sf = true;
}
if (_local3.scb.fired == false) {
_local22[String(_local3.scb.id)] = _local3.scb;
_local3.scb.fired = true;
}
if (_local21 == true) {
if (_local13[_local35] == undefined) {
_local13[_local35] = [_local5, []];
}
_local13[_local35][1].unshift(_local30);
}
if (_local3.ucb != undefined) {
_local24[String(_local3.ucb.id)] = _local3.ucb;
}
if (_local9 == true) {
if (_local3.v === -1) {
_local5._visible = false;
}
if (_local3.suppressEnd != true) {
if (_local21 == true) {
if (_local14[_local35] == undefined) {
_local14[_local35] = [_local5, []];
}
_local14[_local35][1].unshift(_local30);
}
if (_local3.ecb != undefined) {
_local23[String(_local3.ecb.id)] = _local3.ecb;
}
}
delete _local34[_local30];
if (_local30 == _local12.colorProp) {
delete _local12.colorProp;
}
_local12.numProps--;
if (_local12.numProps <= 0) {
_local26 = true;
}
}
delete _local3.suppressEnd;
}
}
for (var _local35 in _local15) {
_local15[_local35][0].broadcastMessage("onTweenStart", {target:_local15[_local35][0], props:_local15[_local35][1]});
}
for (var _local35 in _local22) {
_local22[_local35].f.apply(_local22[_local35].s, _local22[_local35].a);
}
for (var _local35 in _local13) {
_local13[_local35][0].broadcastMessage("onTweenUpdate", {target:_local13[_local35][0], props:_local13[_local35][1]});
}
for (var _local35 in _local24) {
_local24[_local35].f.apply(_local24[_local35].s, _local24[_local35].a);
}
for (var _local35 in _local14) {
_local14[_local35][0].broadcastMessage("onTweenEnd", {target:_local14[_local35][0], props:_local14[_local35][1]});
}
for (var _local35 in _local23) {
_local23[_local35].f.apply(_local23[_local35].s, _local23[_local35].a);
}
if (_local26) {
cleanUp();
}
now = getTimer();
}
function cleanUp(noInit) {
for (var _local4 in tweens) {
var _local2 = tweens[_local4].targ;
if ((tweens[_local4].numProps <= 0) || (_local2.__zigoID__ == undefined)) {
if ((((_local2 != undefined) && (_local2.tween == undefined)) && (noInit != true)) && (_local2._listeners.length <= 0)) {
com.mosesSupposes.fuse.ZigoEngine.deinitializeTargets(_local2);
}
delete tweens[_local4];
numTweens--;
}
}
if (numTweens <= 0) {
numTweens = 0;
delete tweens;
tweens = {};
if (noInit != true) {
com.mosesSupposes.fuse.ZigoEngine.__mgrRelay(this, "setup", [true]);
}
}
}
function paramsObj(targs, props, endvals, retainFade) {
var _local6 = {};
_local6.all = String(targs).toUpperCase() == com.mosesSupposes.fuse.FuseKitCommon.ALL;
_local6.none = Boolean(targs == null);
if (_local6.all == true) {
_local6.tg = [null];
} else {
_local6.tg = ((targs instanceof Array) ? (targs) : ([targs]));
for (var _local11 in _local6.tg) {
var _local7 = _local6.tg[_local11];
if ((_local7 == null) || (!((typeof(_local7) == "object") || (typeof(_local7) == "movieclip")))) {
_local6.tg.splice(Number(_local11), 1);
}
}
}
_local6.allprops = props == null;
var _local1;
var _local4;
var _local3 = {};
if (_local6.allprops == false) {
if ((typeof(props) == "string") && ((String(props).indexOf(" ") > -1) || (String(props).indexOf(",") > -1))) {
props = String(props.split(" ").join("")).split(",");
}
_local1 = ((props instanceof Array) ? (props.slice()) : ([props]));
if (endvals != undefined) {
if ((typeof(endvals) == "string") && ((String(endvals).indexOf(" ") > -1) || (String(endvals).indexOf(",") > -1))) {
endvals = String(endvals.split(" ").join("")).split(",");
}
_local4 = ((endvals instanceof Array) ? (endvals.slice()) : ([endvals]));
while (_local4.length < _local1.length) {
_local4.push(_local4[_local4.length - 1]);
}
_local4.splice(_local1.length, _local4.length - _local1.length);
}
for (var _local11 in _local1) {
var _local2 = Number(_local11);
if ((_local1[_local11] != "_scale") && (_local1[_local11] != "_size")) {
if (_local3[_local1[_local11]] == undefined) {
if ((_local1[_local11] == "_fade") && (retainFade != true)) {
_local1[_local11] = "_alpha";
}
if (String(_local1[_local11]).toUpperCase() == com.mosesSupposes.fuse.FuseKitCommon.ALLCOLOR) {
_local1[_local11] = com.mosesSupposes.fuse.FuseKitCommon.ALLCOLOR;
}
_local3[_local1[_local11]] = true;
} else {
_local1.splice(_local2, 1);
_local4.splice(_local2, 1);
}
} else {
var _local8 = String(_local1.splice(_local2, 1)[0]);
var _local5 = _local4.splice(_local2, 1)[0];
if (_local8 == "_scale") {
if (_local3._xscale == undefined) {
_local1.splice(_local2, 0, "_xscale");
_local4.splice(_local2, 0, _local5);
_local3._xscale = true;
_local2++;
}
if (_local3._yscale == undefined) {
_local1.splice(_local2, 0, "_yscale");
_local4.splice(_local2, 0, _local5);
_local3._yscale = true;
}
}
if (_local8 == "_size") {
if (_local3._width == undefined) {
_local1.splice(_local2, 0, "_width");
_local4.splice(_local2, 0, _local5);
_local3._width = true;
_local2++;
}
if (_local3._yscale == undefined) {
_local1.splice(_local2, 0, "_height");
_local4.splice(_local2, 0, _local5);
_local3._height = true;
}
}
}
}
for (var _local11 in _local1) {
if (((_local1[_local11] == "_xscale") && (_local3._width == true)) || ((_local1[_local11] == "_yscale") && (_local3._height == true))) {
_local1.splice(Number(_local11), 1);
_local4.splice(Number(_local11), 1);
delete _local3[_local1[_local11]];
}
}
}
_local6.pa = _local1;
_local6.va = _local4;
_local6.props = _local3;
return(_local6);
}
function getChangeObj(ps, ep, isFMP, useArray) {
var _local3 = {map:((useArray == true) ? ([]) : ({})), changed:false};
for (var _local7 in ep) {
if ((((((isFMP == true) && (_local7.charAt(1) == "b")) || (ep[_local7] != ps[_local7])) || (useArray == true)) && (ep[_local7] != null)) && (_global.isNaN(Number(ep[_local7])) == false)) {
_local3.map[_local7] = ((typeof(ep[_local7]) == "string") ? (Number(ep[_local7])) : (ep[_local7] - ps[_local7]));
if (_global.isNaN(_local3.map[_local7]) == true) {
_local3.map[_local7] = 0;
} else if (_local3.map[_local7] != 0) {
_local3.changed = true;
}
}
}
return(_local3);
}
var numTweens = 0;
}
Symbol 1924 MovieClip [__Packages.com.mosesSupposes.fuse.PennerEasing] Frame 0
class com.mosesSupposes.fuse.PennerEasing
{
function PennerEasing () {
}
static function linear(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInQuad(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOutQuad(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOutQuad(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 function easeInExpo(t, b, c, d) {
return(((t == 0) ? (b) : ((c * Math.pow(2, 10 * ((t / d) - 1))) + b)));
}
static function easeOutExpo(t, b, c, d) {
return(((t == d) ? (b + c) : ((c * ((-Math.pow(2, (-10 * t) / d)) + 1)) + b)));
}
static function easeInOutExpo(t, b, c, d) {
if (t == 0) {
return(b);
}
if (t == d) {
return(b + c);
}
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * Math.pow(2, 10 * (t - 1))) + b);
}
t--;
return(((c / 2) * ((-Math.pow(2, -10 * t)) + 2)) + b);
}
static function easeOutInExpo(t, b, c, d) {
if (t == 0) {
return(b);
}
if (t == d) {
return(b + c);
}
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * ((-Math.pow(2, -10 * t)) + 1)) + b);
}
return(((c / 2) * (Math.pow(2, 10 * (t - 2)) + 1)) + b);
}
static function easeInElastic(t, b, c, d, a, p) {
var _local5;
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;
_local5 = p / 4;
} else {
_local5 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p))) + b);
}
static function easeOutElastic(t, b, c, d, a, p) {
var _local5;
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;
_local5 = p / 4;
} else {
_local5 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOutElastic(t, b, c, d, a, p) {
var _local5;
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;
_local5 = p / 4;
} else {
_local5 = (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) - _local5) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static function easeOutInElastic(t, b, c, d, a, p) {
var _local5;
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;
_local5 = p / 4;
} else {
_local5 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
return(((0.5 * ((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p))) + (c / 2)) + b);
}
return(((c / 2) + (0.5 * ((a * Math.pow(2, 10 * (t - 2))) * Math.sin((((t * d) - _local5) * (Math.PI*2)) / p)))) + b);
}
static function easeInBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / d;
return((((c * t) * t) * (((s + 1) * t) - s)) + b);
}
static function easeOutBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = (t / d) - 1;
return((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
static function easeInOutBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static function easeOutInBack(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
t--;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
t--;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) - s)) + 1)) + b);
}
static function easeOutBounce(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeInBounce(t, b, c, d) {
return((c - easeOutBounce(d - t, 0, c, d)) + b);
}
static function easeInOutBounce(t, b, c, d) {
if (t < (d / 2)) {
return((easeInBounce(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOutBounce((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static function easeOutInBounce(t, b, c, d) {
if (t < (d / 2)) {
return((easeOutBounce(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeInBounce((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static function easeInCubic(t, b, c, d) {
t = t / d;
return((((c * t) * t) * t) + b);
}
static function easeOutCubic(t, b, c, d) {
t = (t / d) - 1;
return((c * (((t * t) * t) + 1)) + b);
}
static function easeInOutCubic(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((c / 2) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((t * t) * t) + 2)) + b);
}
static function easeOutInCubic(t, b, c, d) {
t = t / (d / 2);
t--;
return(((c / 2) * (((t * t) * t) + 1)) + b);
}
static function easeInQuart(t, b, c, d) {
t = t / d;
return(((((c * t) * t) * t) * t) + b);
}
static function easeOutQuart(t, b, c, d) {
t = (t / d) - 1;
return(((-c) * ((((t * t) * t) * t) - 1)) + b);
}
static function easeInOutQuart(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((((c / 2) * t) * t) * t) * t) + b);
}
t = t - 2;
return((((-c) / 2) * ((((t * t) * t) * t) - 2)) + b);
}
static function easeOutInQuart(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
t--;
return((((-c) / 2) * ((((t * t) * t) * t) - 1)) + b);
}
t--;
return(((c / 2) * ((((t * t) * t) * t) + 1)) + b);
}
static function easeInQuint(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOutQuint(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOutQuint(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static function easeOutInQuint(t, b, c, d) {
t = t / (d / 2);
t--;
return(((c / 2) * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInSine(t, b, c, d) {
return((((-c) * Math.cos((t / d) * (Math.PI/2))) + c) + b);
}
static function easeOutSine(t, b, c, d) {
return((c * Math.sin((t / d) * (Math.PI/2))) + b);
}
static function easeInOutSine(t, b, c, d) {
return((((-c) / 2) * (Math.cos((Math.PI * t) / d) - 1)) + b);
}
static function easeOutInSine(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((c / 2) * Math.sin((Math.PI * t) / 2)) + b);
}
t--;
return((((-c) / 2) * (Math.cos((Math.PI * t) / 2) - 2)) + b);
}
static function easeInCirc(t, b, c, d) {
t = t / d;
return(((-c) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
static function easeOutCirc(t, b, c, d) {
t = (t / d) - 1;
return((c * Math.sqrt(1 - (t * t))) + b);
}
static function easeInOutCirc(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((-c) / 2) * (Math.sqrt(1 - (t * t)) - 1)) + b);
}
t = t - 2;
return(((c / 2) * (Math.sqrt(1 - (t * t)) + 1)) + b);
}
static function easeOutInCirc(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
t--;
return(((c / 2) * Math.sqrt(1 - (t * t))) + b);
}
t--;
return(((c / 2) * (2 - Math.sqrt(1 - (t * t)))) + b);
}
static var registryKey = "pennerEasing";
}
Symbol 1925 MovieClip [__Packages.MoFunZoneAPI.MFZDisplayConfig] Frame 0
class MoFunZoneAPI.MFZDisplayConfig
{
function MFZDisplayConfig () {
workspaceWidth = 550;
workspaceHeight = 400;
autoPosition = "cc";
bringToTop = false;
dialogScale = 1;
}
var workspaceWidth = 550;
var workspaceHeight = 400;
var autoPosition = "cc";
var bringToTop = false;
var dialogScale = 1;
}
Symbol 1926 MovieClip [__Packages.MoFunZoneAPI.MFZAchievementConfig] Frame 0
class MoFunZoneAPI.MFZAchievementConfig
{
var gameID, testMode;
function MFZAchievementConfig () {
gameID = "";
testMode = true;
}
}
Symbol 1927 MovieClip [__Packages.MoFunZoneAPI.MFZResource] Frame 0
class MoFunZoneAPI.MFZResource
{
static var _resourceconfig, _intervalId, _debug, _topleveltimeline;
function MFZResource () {
}
static function getAPI() {
return(_resource);
}
static function readyCallBack(funtionPointer) {
_readyFuntion = funtionPointer;
}
static function achievementreport() {
_resource.screenwidth = _resourceconfig.workspaceWidth;
_resource.screenheight = _resourceconfig.workspaceHeight;
_resource.dialogpositionmode = _resourceconfig.autoPosition;
_resource.dialogscale = _resourceconfig.dialogScale;
_resource.bring = _resourceconfig.bringToTop;
_resource.setupSystemPosition();
clearInterval(_intervalId);
if (_readyFuntion != null) {
_readyFuntion(true);
}
}
static function setupinterval(target_mc) {
_intervalId = setInterval(achievementreport, 1000);
}
static function loadResource(resource_address, topleveltimeline, config, debug) {
System.security.allowDomain("*");
_debug = debug;
if (_resource != null) {
return(undefined);
}
_resourceconfig = config;
_topleveltimeline = topleveltimeline;
_resource = topleveltimeline.createEmptyMovieClip("mfz_api_resources", topleveltimeline.getNextHighestDepth());
var _local1 = new Object();
_local1.onLoadComplete = setupinterval;
_local1.onLoadError = function (target_mc) {
if (MoFunZoneAPI.MFZResource._readyFuntion != null) {
MoFunZoneAPI.MFZResource._readyFuntion(false);
}
};
_local1.onLoadProgress = function (target, bytesLoaded, bytesTotal) {
};
var _local2 = new MovieClipLoader();
_local2.addListener(_local1);
_local2.loadClip(resource_address, _resource);
}
static var _resource = null;
static var _readyFuntion = null;
}
Symbol 1928 MovieClip [__Packages.MoFunZoneAPI.MFZUserLogin] Frame 0
class MoFunZoneAPI.MFZUserLogin
{
static var _intervalId, _resourceAPI, _debug;
function MFZUserLogin () {
}
static function getUserName() {
if (_resource != null) {
return(_resource.username);
}
return(null);
}
static function getGender() {
if (_resource != null) {
return(_resource.gender);
}
return(null);
}
static function getEXP() {
if (_resource != null) {
return(_resource.exp);
}
return(null);
}
static function readyCallBack(funtionPointer) {
_readyFuntion = funtionPointer;
}
static function achievementreport() {
clearInterval(_intervalId);
_resource.resourceAPI = _resourceAPI;
_resource._readyFuntion = _readyFuntion;
_resource.getUserLogin();
}
static function setupinterval(target_mc) {
_intervalId = setInterval(achievementreport, 1000);
}
static function loadUserName(user_address, resource, debug) {
System.security.allowDomain("*");
_debug = debug;
_resourceAPI = resource;
_resource = _resourceAPI.createEmptyMovieClip("mfz_api_userinfo", _resourceAPI.getNextHighestDepth());
var _local1 = new Object();
_local1.onLoadComplete = setupinterval;
_local1.onLoadError = function (target_mc) {
if (MoFunZoneAPI.MFZUserLogin._readyFuntion != null) {
MoFunZoneAPI.MFZUserLogin._readyFuntion(false);
}
};
_local1.onLoadProgress = function (target, bytesLoaded, bytesTotal) {
};
var _local2 = new MovieClipLoader();
_local2.addListener(_local1);
_local2.loadClip(user_address, _resource);
}
static function loadMe(file, config, ready, classlist) {
readyCallBack(ready);
loadUserName(file, classlist[0].getAPI());
}
static var _resource = null;
static var _readyFuntion = null;
}
Symbol 1929 MovieClip [__Packages.MoFunZoneAPI.MFZEasyAPI] Frame 0
class MoFunZoneAPI.MFZEasyAPI
{
static var systemcount, _readyCallBack;
function MFZEasyAPI () {
}
static function autoBring() {
if (MoFunZoneAPI.MFZResource.getAPI() != null) {
MoFunZoneAPI.MFZResource.getAPI().autoBring();
}
}
static function stopBring() {
if (MoFunZoneAPI.MFZResource.getAPI() != null) {
MoFunZoneAPI.MFZResource.getAPI().stopBring();
}
}
static function showNotifyDialog(wordmessage) {
if (MoFunZoneAPI.MFZResource.getAPI() != null) {
MoFunZoneAPI.MFZResource.getAPI().showNotifyDialog(wordmessage);
}
}
static function getUserName() {
return(MoFunZoneAPI.MFZUserLogin.getUserName());
}
static function getGender() {
return(MoFunZoneAPI.MFZUserLogin.getGender());
}
static function getEXP() {
return(MoFunZoneAPI.MFZUserLogin.getEXP());
}
static function hideLoginStatus() {
if (MoFunZoneAPI.MFZUserLogin.getUserName() != null) {
MoFunZoneAPI.MFZResource.getAPI().hideLogin();
}
}
static function showLoginStatus() {
if (MoFunZoneAPI.MFZUserLogin.getUserName() != null) {
MoFunZoneAPI.MFZResource.getAPI().showLogin();
}
}
static function success(id) {
if (MoFunZoneAPI.MFZAchievement.getAchievement() != null) {
MoFunZoneAPI.MFZAchievement.success(id);
}
}
static function configDisplay(screenWidth, screenHeight, position, dialogSize) {
displayconfig = new MoFunZoneAPI.MFZDisplayConfig();
displayconfig.workspaceWidth = screenWidth;
displayconfig.workspaceHeight = screenHeight;
displayconfig.autoPosition = position;
displayconfig.bringToTop = false;
displayconfig.dialogScale = dialogSize;
}
static function configAchievement(gameid, test) {
achievementconfig = new MoFunZoneAPI.MFZAchievementConfig();
achievementconfig.testMode = test;
achievementconfig.gameID = gameid;
}
static function downloadAPI(main_time_line) {
if (displayconfig == null) {
trace("API Download : Call configDisplay( ) before downloadAPI()");
return(undefined);
}
if (userInfoEnabled) {
turnOnSystem(MoFunZoneAPI.MFZUserLogin, null, "http://www.mofunzone.com/api/as2/user_info.swf");
}
if (achievementEnabled) {
if (achievementconfig != null) {
turnOnSystem(MoFunZoneAPI.MFZAchievement, achievementconfig, "http://www.mofunzone.com/api/as2/achievement.swf");
} else {
trace("achievementEnabled : Call configAchievement() before downloadAPI()");
return(undefined);
}
}
connectToSystem(main_time_line, "http://www.mofunzone.com/api/as2/resources.swf");
}
static function connectToSystem(maintimeline, guiswf) {
function ready(r) {
MoFunZoneAPI.MFZEasyAPI.systemcount++;
if ((MoFunZoneAPI.MFZEasyAPI.systemcount == MoFunZoneAPI.MFZEasyAPI.apilist.length) || (MoFunZoneAPI.MFZEasyAPI.apilist.length == 0)) {
if (MoFunZoneAPI.MFZEasyAPI._readyCallBack != null) {
MoFunZoneAPI.MFZEasyAPI._readyCallBack(true);
}
} else {
MoFunZoneAPI.MFZEasyAPI.apilist[MoFunZoneAPI.MFZEasyAPI.systemcount].api.loadMe(MoFunZoneAPI.MFZEasyAPI.apilist[MoFunZoneAPI.MFZEasyAPI.systemcount].file, MoFunZoneAPI.MFZEasyAPI.apilist[MoFunZoneAPI.MFZEasyAPI.systemcount].config, ready, MoFunZoneAPI.MFZEasyAPI.apineed);
}
}
function readyGUI(success) {
if (success) {
if (MoFunZoneAPI.MFZEasyAPI.apilist.length > 0) {
MoFunZoneAPI.MFZEasyAPI.apilist[MoFunZoneAPI.MFZEasyAPI.systemcount].api.loadMe(MoFunZoneAPI.MFZEasyAPI.apilist[MoFunZoneAPI.MFZEasyAPI.systemcount].file, MoFunZoneAPI.MFZEasyAPI.apilist[MoFunZoneAPI.MFZEasyAPI.systemcount].config, ready, MoFunZoneAPI.MFZEasyAPI.apineed);
} else {
MoFunZoneAPI.MFZEasyAPI._readyCallBack(true);
}
} else {
MoFunZoneAPI.MFZEasyAPI._readyCallBack(false);
}
}
systemcount = 0;
if (displayconfig == null) {
trace("MFZ GUI/Display Resource create error: call configDisplay() first");
return(undefined);
}
MoFunZoneAPI.MFZResource.readyCallBack(readyGUI);
MoFunZoneAPI.MFZResource.loadResource(guiswf, maintimeline, displayconfig);
}
static function readyCallBack(callback) {
_readyCallBack = callback;
}
static function turnOnSystem(API, config, swffile) {
apilist.push({api:API, config:config, file:swffile});
}
static var apilist = new Array();
static var displayconfig = new MoFunZoneAPI.MFZDisplayConfig();
static var displayConfig = displayconfig;
static var achievementconfig = new MoFunZoneAPI.MFZAchievementConfig();
static var achievementConfig = achievementconfig;
static var userInfoEnabled = false;
static var achievementEnabled = false;
static var apineed = new Array(MoFunZoneAPI.MFZResource, MoFunZoneAPI.MFZUserLogin);
}
Symbol 1930 MovieClip [__Packages.MoFunZoneAPI.MFZAchievement] Frame 0
class MoFunZoneAPI.MFZAchievement
{
static var _intervalId, _resourceAPI, _config, _username, _debug;
function MFZAchievement () {
}
static function getAchievement() {
return(_resource);
}
static function readyCallBack(funtionPointer) {
_readyFuntion = funtionPointer;
}
static function success(gameid) {
if (_resource != null) {
_resource.success(gameid);
}
}
static function achievementreport() {
clearInterval(_intervalId);
_resource.resourceAPI = _resourceAPI;
_resource._readyFuntion = _readyFuntion;
_resource.gameid = _config.gameID;
_resource.test = _config.testMode;
_resource.username = _username;
_resource.loadAchievement();
}
static function setupinterval(target_mc) {
_intervalId = setInterval(achievementreport, 1000);
}
static function loadAchievement(achievement_address, config, resource, username, debug) {
System.security.allowDomain("*");
_debug = debug;
_resourceAPI = resource;
_username = username;
_config = config;
_resource = _resourceAPI.createEmptyMovieClip("mfz_api_achievement", _resourceAPI.getNextHighestDepth());
var _local1 = new Object();
_local1.onLoadComplete = setupinterval;
_local1.onLoadError = function (target_mc) {
if (MoFunZoneAPI.MFZAchievement._readyFuntion != null) {
MoFunZoneAPI.MFZAchievement._readyFuntion(false);
}
};
_local1.onLoadProgress = function (target, bytesLoaded, bytesTotal) {
};
var _local2 = new MovieClipLoader();
_local2.addListener(_local1);
_local2.loadClip(achievement_address, _resource);
}
static function loadMe(file, config, ready, classlist) {
readyCallBack(ready);
loadAchievement(file, MoFunZoneAPI.MFZAchievementConfig(config), classlist[0].getAPI(), classlist[1].getUserName());
}
static var _resource = null;
static var _readyFuntion = null;
}
Symbol 194 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 220 MovieClip [explosion] Frame 30
this.removeMovieClip();
Symbol 225 MovieClip Frame 1
this._alpha = 0;
Symbol 333 MovieClip Frame 1
stop();
Symbol 366 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 367 MovieClip Frame 19
stop();
Symbol 438 MovieClip Frame 1
btnSkip.onRelease = function () {
_global.objTrans.goto("home");
};
Symbol 438 MovieClip Frame 11
_root.objSounds.play("intro1");
Symbol 438 MovieClip Frame 152
_root.objSounds.play("intro2");
Symbol 438 MovieClip Frame 204
_root.objSounds.play("intro3");
Symbol 438 MovieClip Frame 252
_root.objSounds.play("intro4");
Symbol 438 MovieClip Frame 419
_root.objSounds.play("intro5");
Symbol 438 MovieClip Frame 615
_global.objTrans.goto("home");
stop();
Symbol 448 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 448 MovieClip Frame 11
this.showing = false;
Symbol 448 MovieClip Frame 21
_root.objSounds.play("achievement");
this.showing = true;
Symbol 448 MovieClip Frame 190
this.showing = false;
_root.processAchievementQueue();
Symbol 454 MovieClip Frame 1
stop();
Symbol 488 MovieClip Frame 1
this._brightness = _root.Maths.randomInt(-15, -45);
gotoAndPlay(_root.Maths.randomInt(2, 400));
Symbol 488 MovieClip Frame 401
gfx.head.mouth.gotoAndPlay(_root.Maths.randomInt(1, gfx.head.mouth._totalframes));
Symbol 489 MovieClip Frame 1
btnDeeperbeige.onRelease = _root.linkAuthor;
btnSponsor.onRelease = _root.linkSponsorGame;
Symbol 498 MovieClip Frame 1
function evtToggleSounds() {
_root.objSounds.toggleMute();
updateStatus();
}
function evtToggleMusic() {
if (_root.objSounds.isPlaying("music")) {
_root.objSounds.stop("music");
} else {
_root.setMusic(_root.curMusic, true);
}
updateStatus();
}
function updateStatus() {
soundStrikethru._visible = _root.objSounds.muted;
musicStrikethru._visible = !_root.objSounds.isPlaying("music");
}
btnSound.onRelease = evtToggleSounds;
btnMusic.onRelease = evtToggleMusic;
updateStatus();
Symbol 503 MovieClip Frame 6
_root.objSounds.play("footstep1");
Symbol 503 MovieClip Frame 14
_root.objSounds.play("footstep2");
Symbol 504 MovieClip Frame 1
this._brightness = _root.Maths.randomInt(-15, -45);
gotoAndPlay(_root.Maths.randomInt(2, 400));
Symbol 504 MovieClip Frame 401
gfx.head.mouth.gotoAndPlay(_root.Maths.randomInt(1, gfx.head.mouth._totalframes));
Symbol 558 MovieClip Frame 1
_root.objSounds.play("crushotronrumble", 25);
Symbol 558 MovieClip Frame 70
_root.objSounds.play("crushotronrumble", 25);
Symbol 584 MovieClip Frame 1
this._visible = false;
_root.game.objLevel.addExplosion(this);
Symbol 585 MovieClip Frame 17
_parent.gotoAndStop("destroyed");
Symbol 586 MovieClip Frame 1
stop();
Symbol 586 MovieClip Frame 11
_root.objSounds.play("cameraexplode");
Symbol 616 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 8
_root.objSounds.play("footstep1");
Symbol 631 MovieClip Frame 19
_root.objSounds.play("footstep2");
Symbol 643 MovieClip Frame 1
_root.objSounds.play("jump");
Symbol 643 MovieClip Frame 13
gotoAndPlay ("loop");
Symbol 651 MovieClip Frame 8
gotoAndPlay ("loop");
Symbol 669 MovieClip Frame 8
stop();
_root.game.objLevel.monkey.animState = "idle";
Symbol 674 MovieClip Frame 17
stop();
Symbol 675 MovieClip Frame 15
stop();
Symbol 676 MovieClip Frame 25
stop();
Symbol 677 MovieClip Frame 1
stop();
hit._visible = false;
Symbol 699 MovieClip Frame 7
stop();
Symbol 699 MovieClip Frame 13
stop();
Symbol 720 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 758 MovieClip Frame 1
stop();
var value = false;
btnToggle.onRelease = function () {
gotoAndStop ("on");
value = true;
_root.options.readOptions();
};
Symbol 758 MovieClip Frame 11
stop();
var value = true;
btnToggle.onRelease = function () {
gotoAndStop ("off");
value = false;
_root.options.readOptions();
};
Symbol 762 MovieClip Frame 1
stop();
var value = "low";
btnToggle.onRelease = function () {
gotoAndStop ("medium");
value = "medium";
_root.options.readOptions();
};
Symbol 762 MovieClip Frame 11
stop();
var value = "medium";
btnToggle.onRelease = function () {
gotoAndStop ("high");
value = "high";
_root.options.readOptions();
};
Symbol 762 MovieClip Frame 21
stop();
var value = "high";
btnToggle.onRelease = function () {
gotoAndStop ("mediumdown");
value = "medium";
_root.options.readOptions();
};
Symbol 762 MovieClip Frame 31
stop();
var value = "medium";
btnToggle.onRelease = function () {
gotoAndStop ("low");
value = "low";
_root.options.readOptions();
};
Symbol 777 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 777 MovieClip Frame 21
_root.game.setPause(true);
btnKiller.useHandCursor = false;
_root.options.updateOptions();
panel.btnClose.onRelease = function () {
gotoAndPlay ("out");
};
panel.btnQuit.onRelease = function () {
_global.objTrans.goto("home");
};
Symbol 777 MovieClip Frame 31
stop();
Symbol 777 MovieClip Frame 50
gotoAndStop ("idle");
_root.game.setPause(false);
Symbol 789 MovieClip Frame 1
stop();
Symbol 1070 MovieClip Frame 11
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 41
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 86
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 106
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 146
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 176
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 196
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 206
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 221
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 241
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 261
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 276
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 311
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 331
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 346
_parent.portrait.gotoAndStop("close");
Symbol 1070 MovieClip Frame 371
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 391
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 401
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 411
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 431
_parent.portrait.gotoAndStop("close");
Symbol 1070 MovieClip Frame 456
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 471
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 491
_parent.portrait.gotoAndStop("close");
Symbol 1070 MovieClip Frame 511
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 541
_parent.portrait.gotoAndStop("close");
Symbol 1070 MovieClip Frame 556
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 601
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 606
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 611
_parent.portrait.gotoAndStop("close");
Symbol 1070 MovieClip Frame 616
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 621
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 631
_parent.portrait.gotoAndStop("close");
Symbol 1070 MovieClip Frame 636
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 641
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 646
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 656
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 661
_parent.portrait.gotoAndStop("close");
Symbol 1070 MovieClip Frame 671
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 676
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 681
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 691
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 696
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 701
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 711
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 716
_parent.portrait.gotoAndStop("close");
Symbol 1070 MovieClip Frame 726
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 731
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 736
_parent.portrait.gotoAndStop("hand");
Symbol 1070 MovieClip Frame 746
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 751
_parent.portrait.gotoAndStop("close");
Symbol 1070 MovieClip Frame 761
_parent.portrait.gotoAndStop("eyes");
Symbol 1070 MovieClip Frame 766
_parent.portrait.gotoAndStop("side");
Symbol 1070 MovieClip Frame 771
_parent.portrait.gotoAndStop("slant");
Symbol 1070 MovieClip Frame 776
_parent.portrait.gotoAndStop("close");
Symbol 1071 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 1071 MovieClip Frame 20
gotoAndStop ("idle");
Symbol 1071 MovieClip Frame 33
stop();
_root.objSounds.play("talk");
Symbol 1071 MovieClip Frame 61
this.speech.showNextSeq();
Symbol 1203 MovieClip Frame 1
stop();
Symbol 1254 MovieClip Frame 1
_root.objSounds.play("crushotronrumble");
Symbol 1254 MovieClip Frame 46
_root.objSounds.play("crushotronrumble");
Symbol 1254 MovieClip Frame 65
_root.objSounds.play("crushotronbang");
Symbol 1254 MovieClip Frame 91
_root.objSounds.play("crushotronrumble");
Symbol 1254 MovieClip Frame 110
_root.objSounds.play("crushotronbang");
Symbol 1254 MovieClip Frame 155
_root.objSounds.play("crushotronbang");
Symbol 1361 MovieClip Frame 1
_root.objSounds.play("crushotronrumble");
Symbol 1361 MovieClip Frame 98
_root.objSounds.play("crushotronrumble");
Symbol 1432 MovieClip Frame 15
stop();
Symbol 1453 MovieClip Frame 8
gotoAndPlay ("loop");
Symbol 1454 MovieClip Frame 35
_root.objSounds.play("thunder");
Symbol 1454 MovieClip Frame 43
_root.objSounds.play("monkey");
Symbol 1454 MovieClip Frame 47
_root.objSounds.play("monkey");
Symbol 1454 MovieClip Frame 64
_root.objSounds.play("thunder");
Symbol 1454 MovieClip Frame 81
_root.objSounds.play("monkey");
Symbol 1454 MovieClip Frame 94
_root.objSounds.play("monkey", 50);
Symbol 1475 MovieClip Frame 110
_parent.gotoAndStop("destroyed");
Symbol 1476 MovieClip Frame 1
stop();
Symbol 1476 MovieClip Frame 11
_root.objSounds.play("labexplode");
Symbol 1476 MovieClip Frame 21
play();
Symbol 1476 MovieClip Frame 30
_root.game.endGame("revenge");
stop();
Symbol 1499 MovieClip Frame 40
_root.objSounds.play("crushotronrumble", 25);
Symbol 1499 MovieClip Frame 189
_root.objSounds.play("crushotronrumble", 25);
Symbol 1662 MovieClip Frame 30
_root.objSounds.play("crushotronrumble");
Symbol 1662 MovieClip Frame 77
_root.objSounds.play("crushotronbang");
Symbol 1662 MovieClip Frame 110
_root.objSounds.play("crushotronbang");
Symbol 1662 MovieClip Frame 129
_root.objSounds.play("crushotronrumble");
Symbol 1685 MovieClip Frame 1
_root.objSounds.play("steam");
Symbol 1723 MovieClip Frame 1
_root.objSounds.play("crushotronrumble");
Symbol 1723 MovieClip Frame 162
_root.objSounds.play("crushotronrumble");
Symbol 1743 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, _totalframes));
Symbol 1744 MovieClip Frame 1
_root.objSounds.play("scrape");
Symbol 1744 MovieClip Frame 48
_root.objSounds.play("clang");
Symbol 1744 MovieClip Frame 86
_root.objSounds.play("clang", 30);
Symbol 1744 MovieClip Frame 101
_root.objSounds.play("scrape");
Symbol 1744 MovieClip Frame 148
_root.objSounds.play("clang");
Symbol 1744 MovieClip Frame 186
_root.objSounds.play("clang", 30);
Symbol 1744 MovieClip Frame 201
_root.objSounds.play("scrape");
Symbol 1744 MovieClip Frame 248
_root.objSounds.play("clang");
Symbol 1744 MovieClip Frame 286
_root.objSounds.play("clang", 30);
Symbol 1744 MovieClip Frame 301
_root.objSounds.play("scrape");
Symbol 1744 MovieClip Frame 348
_root.objSounds.play("clang");
Symbol 1744 MovieClip Frame 386
_root.objSounds.play("clang", 30);
Symbol 1754 MovieClip Frame 1
_root.game.objLevel.arm.clip.hand.gotoAndPlay("closed");
Symbol 1754 MovieClip Frame 61
_root.game.objLevel.arm.clip.hand.gotoAndPlay("open");
Symbol 1754 MovieClip Frame 121
_root.game.objLevel.arm.clip.hand.gotoAndPlay("closed");
Symbol 1754 MovieClip Frame 182
_root.game.objLevel.arm.clip.hand.gotoAndPlay("open");
Symbol 1767 MovieClip Frame 1
_root.game.objLevel.arm.clip.hand.gotoAndPlay("closed");
Symbol 1767 MovieClip Frame 76
_root.game.objLevel.arm.clip.hand.gotoAndPlay("open");
Symbol 1767 MovieClip Frame 136
_root.game.objLevel.arm.clip.hand.gotoAndPlay("closed");
Symbol 1767 MovieClip Frame 211
_root.game.objLevel.arm.clip.hand.gotoAndPlay("open");
Symbol 1767 MovieClip Frame 271
_root.game.objLevel.arm.clip.hand.gotoAndPlay("closed");
Symbol 1767 MovieClip Frame 346
_root.game.objLevel.arm.clip.hand.gotoAndPlay("open");
Symbol 1774 MovieClip Frame 1
_root.game.objLevel.arm.clip.hand.gotoAndPlay("closed");
Symbol 1774 MovieClip Frame 132
_root.game.objLevel.arm.clip.hand.gotoAndPlay("open");
Symbol 1774 MovieClip Frame 201
_root.game.objLevel.arm.clip.hand.gotoAndPlay("closed");
Symbol 1774 MovieClip Frame 319
_root.game.objLevel.arm.clip.hand.gotoAndPlay("open");
Symbol 1774 MovieClip Frame 407
_root.game.objLevel.arm.clip.hand.gotoAndPlay("closed");
Symbol 1774 MovieClip Frame 520
_root.game.objLevel.arm.clip.hand.gotoAndPlay("open");
Symbol 1836 MovieClip Frame 1
aim._visible = false;
Symbol 1842 MovieClip Frame 1
stop();
Symbol 1842 MovieClip Frame 50
stop();
Symbol 1849 MovieClip Frame 1
stop();
Symbol 1849 MovieClip Frame 11
_root.objSounds.play("sirenloop", undefined, true);
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 1
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("blah");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 1
onClipEvent (load) {
this.hit = false;
this.evtTriggered = function () {
this.objGame.speech.startSeq("hat");
this.evtTriggered = undefined;
};
}
Instance of Symbol 588 MovieClip "h2" in Symbol 1872 MovieClip Frame 1
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this._parent.hints.gotoAndStop("hintExit");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 2
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("lesshints");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 3
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("lazors");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 4
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("listenup");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 5
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("afraid");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 5
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
_root.achieved("happysaw");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 6
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("growhere");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 6
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("benddown");
};
}
Instance of Symbol 588 MovieClip "h2" in Symbol 1872 MovieClip Frame 6
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("smart");
};
}
Instance of Symbol 588 MovieClip "h3" in Symbol 1872 MovieClip Frame 6
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("done");
};
}
Instance of Symbol 588 MovieClip "h4" in Symbol 1872 MovieClip Frame 6
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("climb");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 7
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("stepitup");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 7
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("coolhead");
};
}
Instance of Symbol 588 MovieClip "h2" in Symbol 1872 MovieClip Frame 7
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("welldone");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 8
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("whatnow");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 8
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("excellent");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 9
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("cantlook");
};
}
Instance of Symbol 588 MovieClip "h2" in Symbol 1872 MovieClip Frame 9
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("goodmonkey");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 9
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("gettingit");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 10
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("makestep");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 11
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("nohelp");
};
}
Symbol 1872 MovieClip Frame 12
_root.objSounds.registerSources(_root.game.objLevel.monkey, [_root.game.objLevel.clip.c0], "stoneloop", 350);
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 12
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("nochance");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 15
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("remember");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 17
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("planning");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 18
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("final");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 19
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("proposition");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 20
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("choice");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 20
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
_root.achieved("found_lab");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 21
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("clonefree");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 21
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("goodchoice");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 22
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("cloneend");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 22
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("freesure");
};
}
Instance of Symbol 588 MovieClip "h2" in Symbol 1872 MovieClip Frame 22
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
_root.game.endGame("clonemaster");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 23
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("lastchance");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 23
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("dontshoot");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 24
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("freedom");
};
}
Instance of Symbol 588 MovieClip "h1" in Symbol 1872 MovieClip Frame 24
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
this.objGame.speech.startSeq("escape");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 45
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
_root.achieved("found_sewer");
};
}
Symbol 1872 MovieClip Frame 54
_root.objSounds.registerSources(_root.game.objLevel.monkey, [_root.game.objLevel.clip.c0, _root.game.objLevel.clip.c1, _root.game.objLevel.clip.c2], "stoneloop", 250);
Instance of Symbol 1815 MovieClip "eric" in Symbol 1872 MovieClip Frame 121
onClipEvent (load) {
this.onRelease = function () {
_root.objSounds.play("eric");
_root.achieved("found_eric");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 121
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
_root.game.endGame("escape");
};
}
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 139
onClipEvent (load) {
this.doorsOpen = false;
this.evtTriggered = function () {
if (this.doorsOpen) {
return(undefined);
}
this.doorsOpen = true;
_root.game.objLevel.clip.lamps.gotoAndStop("on");
_root.game.objLevel.clip.unbendableClip.gotoAndPlay("open");
};
}
Symbol 1872 MovieClip Frame 140
_root.objSounds.play("sirenloop", 55, true);
Symbol 1872 MovieClip Frame 141
_root.objSounds.play("sirenloop", 20, true);
Instance of Symbol 588 MovieClip "h0" in Symbol 1872 MovieClip Frame 142
onClipEvent (load) {
this.evtTriggered = function () {
if (this.hit) {
return(undefined);
}
_root.game.endGame("emancipator");
};
}
Symbol 1914 MovieClip Frame 1
eric.onRelease = function () {
_parent.findEric._alpha = 100;
_parent.findEric.alphaTo(0, 1, "linear", 10);
};
btnDeeperbeige.onRelease = _root.linkAuthor;
btnNick.onRelease = _root.linkAnimator;
btnSponsor.onRelease = _root.linkSponsor;
Symbol 1919 MovieClip Frame 1
findEric._alpha = 0;
Symbol 1919 MovieClip Frame 2574
stop();
_global.objTrans.goto("home");