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("\u00A92008 deeperbeige.com", function () {
return(undefined);
});
var _local3 = new ContextMenuItem("http://deeperbeige.com", function () {
getURL ("http://deeperbeige.com", "_blank");
});
_local3.separatorBefore = true;
_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 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");
}
}
stop();
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");
}
};
com.mosesSupposes.fuse.ZigoEngine.simpleSetup(com.mosesSupposes.fuse.Shortcuts, com.mosesSupposes.fuse.PennerEasing);
_root.baseURL = "http://flash.crackingideas.com/game/";
if (_root.user_suid != undefined) {
_root.badgeURL = ("http://www.crackingideas.com/user/award_badge/" + user_suid) + "/";
}
var objTrans = new ScreenTrans(_root, _root.screen, "picklevel", false);
var objPreloader = new Preloader(_root);
objPreloader.onUpdate = function () {
_root.preloader.needle.gotoAndStop(this.percentLoaded);
_root.preloader.fillup.gotoAndStop(this.percentLoaded);
_root.preloader.lamp1.gotoAndStop(this.percentLoaded);
_root.preloader.lamp2.gotoAndStop(this.percentLoaded);
_root.preloader.lamp3.gotoAndStop(this.percentLoaded);
};
objPreloader.onLoaded = function () {
_root.fadeToBlack.transFunc = function () {
_root.gotoAndStop("intro");
};
_root.fadeToBlack.gotoAndPlay("transition");
};
setupRightClickMenu(false);
Frame 21
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.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 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) {
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);
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 initObjectsFromStage(objGame) {
trace("Discovery phase");
var j = 0;
var _local3 = objGame.clip.level["b" + j];
while (_local3 != undefined) {
if (_local3.goalitem) {
_local3.item = "goalitem";
if (((((_local3.standard || (_local3.cog)) || (_local3.bigcog)) || (_local3.reel)) || (_local3.bulb)) || (_local3.bigbulb)) {
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var objMass = new Mass(_local18.x, _local18.y, 24, false, objGame.objPhysics, j);
objMass.mass = 1.5;
objMass.clip = _local3;
objMass.shadowClip = _local3;
objMass.goalItem = true;
_local3.objMass = objMass;
objMass.collisionSound = "clunk";
if (_local3.cog) {
objMass.radius = 20;
}
if (_local3.bigcog) {
objMass.radius = 30;
}
if (_local3.reel) {
objMass.radius = 24;
}
if (_local3.bulb) {
objMass.radius = 18;
objMass.collisionSound = "glassclink";
}
if (_local3.bigbulb) {
objMass.radius = 24;
objMass.collisionSound = "glassclink";
}
}
if ((((_local3.rivets || (_local3.amp)) || (_local3.recorder)) || (_local3.boiler)) || (_local3.dome)) {
var _local4;
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
if (_local3.rivets) {
_local4 = new SpringBox(_local18.x, _local18.y, 35, 35, 0, 0, 17, 0.7, 1.2, j, objGame.objPhysics);
}
if (_local3.amp) {
_local4 = new SpringBox(_local18.x, _local18.y, 37, 39, 0, 0, 19, 0.7, 1.2, j, objGame.objPhysics);
}
if (_local3.recorder) {
_local4 = new SpringBox(_local18.x, _local18.y, 28, 28, 0, 0, 14, 0.7, 1.2, j, objGame.objPhysics);
}
if (_local3.boiler) {
_local4 = new SpringBox(_local18.x, _local18.y, 40, 59, 0, 0, 24, 0.7, 1.2, j, objGame.objPhysics);
}
if (_local3.dome) {
_local4 = new SpringBox(_local18.x, _local18.y, 32, 32, 0, 0, 14, 0.7, 1.2, j, objGame.objPhysics);
}
_local3.objBox = _local4;
_local4.m_tl.goalItem = true;
_local4.m_tr.goalItem = true;
_local4.m_bl.goalItem = true;
_local4.m_br.goalItem = true;
_local4.m_tl.shadowClip = _local3;
_local4.m_tr.shadowClip = _local3;
_local4.m_bl.shadowClip = _local3;
_local4.m_br.shadowClip = _local3;
_local4.m_tl.clip = _local3;
_local4.m_tr.clip = _local3;
_local4.m_bl.clip = _local3;
_local4.m_br.clip = _local3;
_local4.m_tl.collisionSound = "clunk";
_local4.m_tr.collisionSound = "clunk";
_local4.m_bl.collisionSound = "clunk";
_local4.m_br.collisionSound = "clunk";
}
if ((_local3.boot || (_local3.bar)) || (_local3.spring)) {
var _local21 = _local3.mf.holderToLocal(objGame.objPhysics.baseClip);
var _local19 = _local3.mb.holderToLocal(objGame.objPhysics.baseClip);
_local3.m_f = new Mass(_local21.x, _local21.y, 16, false, objGame.objPhysics, j);
_local3.m_b = new Mass(_local19.x, _local19.y, 16, false, objGame.objPhysics, j);
_local3.objLine = makeSpringLine(_local3.m_f, _local3.m_b);
_local3.m_f.collisionSound = "clunk";
_local3.m_b.collisionSound = "clunk";
if (_local3.boot) {
_local3.m_f.radius = 21;
_local3.m_b.radius = 25;
_local3.m_f.collisionSound = "thud";
_local3.m_b.collisionSound = "thud";
}
if (_local3.spring) {
_local3.m_f.radius = 11;
_local3.m_b.radius = 11;
_local3.m_f.collisionSound = "spring";
_local3.m_b.collisionSound = "spring";
}
_local3.m_f.shadowClip = _local3;
_local3.m_b.shadowClip = _local3;
_local3.m_f.clip = _local3;
_local3.m_b.clip = _local3;
}
}
if (_local3.barbell) {
_local3.item = "barbell";
var _local21 = _local3.mf.holderToLocal(objGame.objPhysics.baseClip);
var _local19 = _local3.mb.holderToLocal(objGame.objPhysics.baseClip);
_local3.m_f = new Mass(_local21.x, _local21.y, 21, false, objGame.objPhysics, j);
_local3.m_b = new Mass(_local19.x, _local19.y, 21, false, objGame.objPhysics, j);
_local3.objLine = makeSpringLine(_local3.m_f, _local3.m_b);
_local3.m_f.isNotWinchable = true;
_local3.m_b.isNotWinchable = true;
_local3.m_f.collisionSound = "clunk";
_local3.m_b.collisionSound = "clunk";
}
if (_local3.hammer) {
_local3.item = "hammer";
var _local21 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var _local19 = _local3.head.holderToLocal(objGame.objPhysics.baseClip);
_local3.m_b = new Mass(_local21.x, _local21.y, 20, true, objGame.objPhysics, j);
_local3.m_f = new Mass(_local19.x, _local19.y, 50, false, objGame.objPhysics, j);
_local3.objLine = makeSpringLine(_local3.m_f, _local3.m_b);
_local3.m_f.isHammer = true;
_local3.m_f.clip = _local3.head;
_local3.m_b.isNotWinchable = true;
_local3.m_f.collisionSound = "clunk";
_local3.m_b.collisionSound = "clunk";
}
if (_local3.breakabledoor) {
_local3.item = "breakabledoor";
_local3.health = _local3._totalframes;
_local3.hit._visible = false;
}
if (_local3.floatdoor) {
_local3.item = "floatdoor";
var _local21 = _local3.mf.holderToLocal(objGame.objPhysics.baseClip);
var _local19 = _local3.mb.holderToLocal(objGame.objPhysics.baseClip);
_local3.m_f = new Mass(_local21.x, _local21.y, 47, false, objGame.objPhysics, j);
_local3.m_b = new Mass(_local19.x, _local19.y, 47, true, objGame.objPhysics, j);
_local3.objLine = makeSpringLine(_local3.m_f, _local3.m_b);
_local3.m_f.isNotWinchable = true;
_local3.m_b.isNotWinchable = true;
_local3.m_f.collisionSound = "rockcrash";
_local3.m_b.collisionSound = "rockcrash";
}
if (_local3.spyglass) {
_local3.item = "spyglass";
var _local21 = _local3.f.holderToLocal(objGame.objPhysics.baseClip);
var _local19 = _local3.b.holderToLocal(objGame.objPhysics.baseClip);
_local3.m_f = new Mass(_local21.x, _local21.y, 32, false, objGame.objPhysics, j);
_local3.m_b = new Mass(_local19.x, _local19.y, 9, false, objGame.objPhysics, j);
_local3.objLine = makeSpringLine(_local3.m_f, _local3.m_b);
_local3.m_f.isSpyglassLens = true;
_local3.m_b.isSpyglassHandle = true;
_local3.m_f.isNotWinchable = true;
_local3.light._alpha = 0;
_local3.m_f.shadowClip = _local3;
_local3.m_b.shadowClip = _local3;
_local3.m_f.collisionSound = "glassclink";
_local3.m_b.collisionSound = "glassclink";
}
if (_local3.window) {
_local3.item = "window";
_local3.hit._visible = false;
}
if (_local3.cannon) {
_local3.item = "cannon";
_local3.aimCannon = function () {
this.rotateTo(Maths.randomInt(-30, -50), 2, "easeInOutSine", 3, {scope:this, func:this.fireCannon});
};
_local3.fireCannon = function () {
if (objGame.state != "flight") {
return(undefined);
}
this.gotoAndPlay("fire");
var _local4 = this.holderToLocal(objGame.objPhysics.baseClip);
var _local3 = this.barrel.holderToLocal(objGame.objPhysics.baseClip);
var _local5 = Math.atan2(_local3.y - _local4.y, _local3.x - _local4.x);
var _local2 = this._parent.b1;
if (_local2.objMass != undefined) {
_local2.objMass.removeMass();
}
var objMass = new Mass(_local3.x, _local3.y, 35, false, objGame.objPhysics, j);
objMass.isBomb = true;
objMass.mass = 2;
objMass.clip = _local2;
objMass.vx = 20 * Math.cos(_local5);
objMass.vy = 20 * Math.sin(_local5);
objMass.shadowClip = _local2;
_local2.objMass = objMass;
_local2._visible = true;
_local2._x = objMass.x;
_local2._y = objMass.y;
_local2.gotoAndPlay("countdown");
_local2.explode = function () {
if (this.objMass.springs.length > 0) {
this.objGame.toggleWinch();
}
this.objGame.createExplosion(this._x, this._y, 20, 500);
this.evtExploded();
this._visible = false;
this.objMass.removeMass();
this.explode = undefined;
};
objMass.collisionSound = "clunk";
};
}
if (_local3.ball) {
_local3.item = "ball";
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var objMass = new Mass(_local18.x, _local18.y, 19, false, objGame.objPhysics, j);
objMass.mass = 1.5;
objMass.clip = _local3;
_local3.objMass = objMass;
objMass.shadowClip = _local3;
objMass.collisionSound = "clunk";
}
if (_local3.bomb) {
_local3.item = "bomb";
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var objMass = new Mass(_local18.x, _local18.y, 35, false, objGame.objPhysics, j);
objMass.isBomb = true;
objMass.mass = 2;
objMass.clip = _local3;
objMass.shadowClip = _local3;
_local3.objMass = objMass;
_local3.objGame = objGame;
_local3.counting = false;
_local3.explodeSpeed = (_local3.fragile ? 5 : 10);
_local3.explode = function () {
if (this.objMass.springs.length > 0) {
this.objGame.toggleWinch();
}
this.objGame.createExplosion(this._x, this._y, 20, 500);
this.evtExploded();
this._visible = false;
this.objMass.removeMass();
this.explode = undefined;
};
objMass.collisionSound = "clunk";
}
if (_local3.fusebomb) {
_local3.item = "fusebomb";
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var objMass = new Mass(_local18.x, _local18.y, 57, false, objGame.objPhysics, j);
objMass.isBomb = true;
objMass.isNotWinchable = true;
objMass.mass = 4;
objMass.clip = _local3;
_local3.objMass = objMass;
_local3.objGame = objGame;
_local3.counting = false;
_local3.hit._visible = false;
_local3.explode = function () {
this.ropeClip.removeMovieClip();
this.objGame.createExplosion(this._x, this._y, 20, 500);
this.evtExploded();
this._visible = false;
this.objMass.removeMass();
this.evtExploded = undefined;
this.explode = undefined;
};
objMass.collisionSound = "clunk";
}
if (_local3.ropeanchor) {
_local3.item = "ropeanchor";
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var _local17 = objGame.clip.level.b2.holderToLocal(objGame.objPhysics.baseClip);
var _local11 = 5;
_local3.segments = [];
_local3.burntRope = false;
var _local13 = (_local17.x - _local18.x) / _local11;
var _local12 = (_local17.y - _local18.y) / _local11;
var _local16 = Maths.vectorLength(_local13, _local12);
var _local20 = Maths.radToDeg(Math.atan2(_local12, _local13));
var _local10 = _local18.x;
var _local9 = _local18.y;
var _local6;
var _local8 = 0;
while (_local8 < _local11) {
var objMass = new Mass(_local10, _local9, 5, ((_local6 == undefined) ? true : false), objGame.objPhysics, -1);
if (_local6 != undefined) {
var _local24 = makeSpringLine(_local6, objMass);
_local6.springLine = _local24;
}
objMass.mass = 1.2;
objMass.isNotWinchable = true;
var _local5 = objGame.clip.level.drawing.attachMovieClip("ropeSegment", _local10, _local9);
_local5._rotation = _local20;
_local5._xscale = _local16;
_local5.hit._visible = false;
objMass.clip = _local5;
_local10 = _local10 + _local13;
_local9 = _local9 + _local12;
_local3.segments.push(objMass);
_local6 = objMass;
_local8++;
}
var _local24 = makeSpringLine(objMass, objGame.clip.level.b2.objMass);
_local3.segments.push(objGame.clip.level.b2.objMass);
objGame.clip.level.b2.ropeClip = _local5;
}
if (_local3.lightbulb) {
_local3.item = "lightbulb";
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var objMass = new Mass(_local18.x, _local18.y, 22, false, objGame.objPhysics, j);
objMass.mass = 1.8;
objMass.clip = _local3;
_local3.objMass = objMass;
objMass.isLightbulb = true;
objMass.shadowClip = _local3;
objMass.collisionSound = "glassclink";
}
if (_local3.thincontact) {
_local3.item = "thincontact";
var _local18 = _local3.ml.holderToLocal(objGame.objPhysics.baseClip);
var _local17 = _local3.mr.holderToLocal(objGame.objPhysics.baseClip);
var _local15 = new Mass(_local18.x, _local18.y, 8, true, objGame.objPhysics, j);
var _local14 = new Mass(_local17.x, _local17.y, 8, true, objGame.objPhysics, j);
_local15.isNotWinchable = true;
_local14.isNotWinchable = true;
_local15.clip = _local3;
_local14.clip = _local3;
_local3.massL = _local15;
_local3.massR = _local14;
_local3.hit._visible = false;
}
if (_local3.widecontact) {
_local3.item = "widecontact";
_local3.surfaces = addSurfaces(_local3, "s", objGame.objPhysics, 0.4, 0.95);
_local3.hitL._visible = false;
_local3.hitR._visible = false;
}
if (_local3.battery) {
_local3.item = "battery";
var _local21 = _local3.mf.holderToLocal(objGame.objPhysics.baseClip);
var _local19 = _local3.mb.holderToLocal(objGame.objPhysics.baseClip);
_local3.m_f = new Mass(_local21.x, _local21.y, 21, false, objGame.objPhysics, j);
_local3.m_b = new Mass(_local19.x, _local19.y, 21, false, objGame.objPhysics, j);
_local3.objLine = makeSpringLine(_local3.m_f, _local3.m_b);
_local3.m_f.shadowClip = _local3;
_local3.m_b.shadowClip = _local3;
_local3.m_f.isBatteryPositive = true;
_local3.m_b.isBatteryNegative = true;
_local3.m_f.collisionSound = "clunk";
_local3.m_b.collisionSound = "clunk";
}
if (_local3.boulder) {
_local3.item = "ball";
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var objMass = new Mass(_local18.x, _local18.y, 90, false, objGame.objPhysics, j);
objMass.mass = 2.5;
objMass.clip = _local3;
_local3.objMass = objMass;
objMass.isNotWinchable = true;
objMass.collisionSound = "rockcrash";
}
if (_local3.hitchecker) {
_local3.item = "hitchecker";
_local3.active = true;
}
if (_local3.fan) {
_local3.item = "fan";
_local3.hit._visible = false;
_local3.leaves = [];
if (objGame.arrFans == undefined) {
objGame.arrFans = _root.objSounds.registerSources(objGame.clip.level.choppa, [], "wind-loop", 270);
}
objGame.arrFans.push(_local3.n0);
objGame.arrFans.push(_local3.n1);
objGame.arrFans.push(_local3.n2);
}
if (_local3.mixer) {
_local3.item = "mixer";
_local3.dr = 0.01;
_local3.surfaces = addSurfaces(_local3, "s", objGame.objPhysics, 0.9, 0.95);
_root.objSounds.play("windmill-loop", 50, true);
}
if (_local3.screw) {
_local3.item = "screw";
_local3.surfaces = addSurfaces(_local3.screw, "s", objGame.objPhysics, 0.9, 0.95);
}
if (_local3.piston) {
_local3.item = "piston";
_local3.surfaces = addSurfaces(_local3.piston, "s", objGame.objPhysics, 0.9, 0.95);
if (objGame.pistonOffset == undefined) {
objGame.pistonOffset = 1;
}
_local3.gotoAndPlay(objGame.pistonOffset);
objGame.pistonOffset = objGame.pistonOffset + 25;
var _local18 = _local3.crank.holderToLocal(objGame.objPhysics.baseClip);
var _local17 = _local3.crank.arm.holderToLocal(objGame.objPhysics.baseClip);
var _local23 = new Mass(_local18.x, _local18.y, 36, true, objGame.objPhysics, -2);
var _local22 = new Mass(_local17.x, _local17.y, 37, true, objGame.objPhysics, -2);
_local3.mCrank = _local23;
_local3.mBigEnd = _local22;
}
if (_local3.electromagnet) {
_local3.item = "electromagnet";
_local3.lines._alpha = 0;
_local3.gfx.rotor1.stop();
_local3.gfx.rotor2.stop();
objGame.objPhysics.attractingMasses = true;
objGame.objPhysics.attractionScale = 100;
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var objMass = new Mass(_local18.x, _local18.y, 154, true, objGame.objPhysics, j);
_local3.activated = false;
_local3.objMass = objMass;
objGame.mTail.attractionMass = 1;
objGame.mCockpit.attractionMass = 1;
}
if (_local3.button) {
_local3.item = "button";
_local3.state = "off";
_local3.hit._visible = false;
_local3.objGame = objGame;
}
if (_local3.handle) {
_local3.item = "handle";
var _local18 = _local3.holderToLocal(objGame.objPhysics.baseClip);
var _local17 = _local3.arm.handle.holderToLocal(objGame.objPhysics.baseClip);
_local3.prevAngle = _local3.arm._rotation;
_local3.mHub = new Mass(_local18.x, _local18.y, 10, true, objGame.objPhysics, -1);
_local3.mHandle = new Mass(_local17.x, _local17.y, 8, false, objGame.objPhysics, j);
_local3.sArm = new Spring(_local3.mHub, _local3.mHandle);
_local3.mHub.isNotWinchable = true;
_root.objSounds.play("ratchet-loop", 0, true);
objGame.handleClip = _local3;
}
if (_local3.conveyerbelt) {
_local3.item = "conveyerbelt";
_local3.surfaces = addSurfaces(_local3, "s", objGame.objPhysics, 0.9, 0.95);
_local3.hit._visible = false;
_local3.dr = 0;
}
if (_local3.wave) {
_local3.item = "wave";
}
trace(((" " + j) + ": ") + _local3.item);
j++;
_local3 = objGame.clip.level["b" + j];
}
}
function stageObjectsEnterFrame(objGame) {
var _local6 = 0;
var _local2 = objGame.clip.level["b" + _local6];
while (_local2 != undefined) {
switch (_local2.item) {
case "conveyerbelt" :
_local6 = 0;
while (_local6 < objGame.objPhysics.masses.length) {
var _local5 = objGame.objPhysics.masses[_local6];
var _local11 = {x:_local5.x, y:_local5.y};
objGame.clip.level.physics.localToGlobal(_local11);
if (_local2.hit.hitTest(_local11.x, _local11.y, true)) {
_local5.extForceX = _local5.extForceX + _local2.dr;
}
_local6++;
}
break;
case "fan" :
if (_local2.stopped) {
_local2.anim.anim.stop();
_local2.anim.vent.stop();
} else {
_local2.anim.anim.play();
_local2.anim.vent.play();
if ((objGame.frame % 4) == 0) {
var _local4 = _local2.debris.attachMovieClip("leaf");
_local4.gotoAndStop(Maths.randomInt(1, _local4._totalframes));
_local4._x = 0;
_local4._y = Maths.randomNum(-150, 150);
_local4.vr = Maths.randomNum(5, 10);
_local4.vx = Maths.randomNum(10, 20);
_local4.inside._y = 7 * (13 - _local4.vr);
_local2.leaves.push(_local4);
}
var _local8 = 0;
while (_local8 < objGame.objPhysics.masses.length) {
var _local7 = objGame.objPhysics.masses[_local8];
var _local11 = {x:_local7.x, y:_local7.y};
objGame.objPhysics.baseClip.localToGlobal(_local11);
if (_local2.hit.hitTest(_local11.x, _local11.y, true)) {
var _local9 = Maths.distance(_local2._x, _local2._y, _local7.x, _local7.y);
if (_local9 > _local2.hit._width) {
_local9 = _local2.hit._width;
}
var _local12 = (_local2.hit._width - _local9) / _local2.hit._width;
_local7.extForceX = _local7.extForceX + ((_local12 * _local2.fanStrength) * Math.cos(Maths.degToRad(_local2._rotation)));
_local7.extForceY = _local7.extForceY + ((_local12 * _local2.fanStrength) * Math.sin(Maths.degToRad(_local2._rotation)));
}
_local8++;
}
}
var _local8 = 0;
while (_local8 < _local2.leaves.length) {
var _local4 = _local2.leaves[_local8];
_local4._x = _local4._x + _local4.vx;
_local4._rotation = _local4._rotation + _local4.vr;
if (_local4._x > _local2.hit._width) {
_local4._alpha = _local4._alpha - 5;
if (_local4._alpha <= 0) {
_local4.removeMovieClip();
_local2.leaves.splice(_local8, 1);
_local8--;
}
}
_local8++;
}
break;
case "wave" :
_local8 = 0;
while (_local8 < objGame.objPhysics.masses.length) {
var _local7 = objGame.objPhysics.masses[_local8];
var _local11 = {x:_local7.x, y:_local7.y};
objGame.objPhysics.baseClip.localToGlobal(_local11);
if (_local2.hit.hitTest(_local11.x, _local11.y, true)) {
_local7.extForceY = _local7.extForceY - (4 * objGame.gravity);
_local7.vx = _local7.vx * 0.95;
_local7.vy = _local7.vy * 0.95;
}
_local8++;
}
break;
case "hitchecker" :
if (_local2.active) {
_local8 = 0;
while (_local8 < objGame.objPhysics.masses.length) {
var _local7 = objGame.objPhysics.masses[_local8];
var _local11 = {x:_local7.x, y:_local7.y};
objGame.objPhysics.baseClip.localToGlobal(_local11);
if (_local2.hitTest(_local11.x, _local11.y, true)) {
_local2.massTouching(_local7);
}
_local8++;
}
}
break;
case "electromagnet" :
if (_local2.activated) {
_local2.objMass.attractionMass = _local2.strength;
} else {
_local2.objMass.attractionMass = 0;
}
break;
case "button" :
if (_local2.state == "off") {
_local8 = 0;
while (_local8 < objGame.objPhysics.masses.length) {
var _local7 = objGame.objPhysics.masses[_local8];
if (_local7.fixed) {
} else {
var _local11 = {x:_local7.x, y:_local7.y};
objGame.objPhysics.baseClip.localToGlobal(_local11);
if (_local2.hit.hitTest(_local11.x, _local11.y, true)) {
_root.objSounds.play("switch");
_local2.evtTriggered();
_local2.state = "on";
_local2.gotoAndStop("on");
}
}
_local8++;
}
}
break;
case "ball" :
break;
case "lightbulb" :
break;
case "battery" :
break;
case "bomb" :
if (!_local2.counting) {
if (_local2.objMass.springs.length > 0) {
_local2.counting = true;
_local2.gotoAndPlay("countdown");
}
}
if (_local2.objMass.hasHitSurface) {
_local2.objMass.isThrown = false;
var _local10 = Maths.vectorLength(_local2.objMass.collisionNormal.x, _local2.objMass.collisionNormal.y);
if (_local10 > _local2.explodeSpeed) {
_local2.explode();
}
}
break;
case "fusebomb" :
break;
case "goalitem" :
var _local11 = _local2.holderToGlobal();
if (objGame.clip.level.flag.hit.hitTest(_local11.x, _local11.y, true)) {
objGame.levelComplete(_local2);
}
switch (_local2.slamdunkLeft) {
case 0 :
if (objGame.clip.level.choppa.slamdunk.hitRight.hitTest(_local11.x, _local11.y, true)) {
_local2.slamdunkLeft++;
}
break;
case 1 :
if (objGame.clip.level.choppa.slamdunk.hitMiddle.hitTest(_local11.x, _local11.y, true)) {
_local2.slamdunkLeft++;
}
break;
case 2 :
if (!objGame.clip.level.choppa.slamdunk.hitLeft.hitTest(_local11.x, _local11.y, true)) {
break;
}
_local2.slamdunkLeft++;
}
switch (_local2.slamdunkRight) {
case 0 :
if (objGame.clip.level.choppa.slamdunk.hitLeft.hitTest(_local11.x, _local11.y, true)) {
_local2.slamdunkRight++;
}
break;
case 1 :
if (objGame.clip.level.choppa.slamdunk.hitMiddle.hitTest(_local11.x, _local11.y, true)) {
_local2.slamdunkRight++;
}
break;
case 2 :
if (!objGame.clip.level.choppa.slamdunk.hitRight.hitTest(_local11.x, _local11.y, true)) {
break;
}
_local2.slamdunkRight++;
}
_local2.prevX = _local2._x;
_local2.prevY = _local2._y;
break;
case "mixer" :
if (objGame.mTail.hasHitSurface || (objGame.mCockpit.hasHitSurface)) {
_local2.dr = _local2.dr - 0.001;
} else {
_local2.dr = _local2.dr + 0.001;
}
if (_local2.dr < 0.01) {
_local2.dr = 0.01;
}
if (_local2.dr > 0.2) {
_local2.dr = 0.2;
}
_local2._rotation = _local2._rotation - _local2.dr;
_local8 = 0;
while (_local8 < _local2.surfaces.length) {
_local2.surfaces[_local8].removeSurface();
_local8++;
}
_local2.surfaces = addSurfaces(_local2, "s", objGame.objPhysics, 0.9, 0.95);
break;
case "screw" :
_local8 = 0;
while (_local8 < _local2.surfaces.length) {
_local2.surfaces[_local8].removeSurface();
_local8++;
}
_local2.surfaces = addSurfaces(_local2.screw, "s", objGame.objPhysics, 0.9, 0.95);
break;
case "piston" :
var _local13 = _local2.crank.arm.holderToLocal(_local2);
var _local15 = Math.abs(_local2.conrod.littleEnd._y);
var _local14 = _local2.crank._x - _local13.x;
var _local16 = Math.sqrt((_local15 * _local15) - (_local14 * _local14));
var _local19 = Math.atan2(_local16, _local14);
_local2.conrod._x = _local13.x;
_local2.conrod._y = _local13.y;
_local2.conrod._rotation = 90 - Maths.radToDeg(_local19);
_local2.piston._y = _local13.y - _local16;
_local11 = _local2.crank.arm.holderToLocal(objGame.objPhysics.baseClip);
_local2.mBigEnd.x = _local11.x;
_local2.mBigEnd.y = _local11.y;
_local8 = 0;
while (_local8 < _local2.surfaces.length) {
_local2.surfaces[_local8].removeSurface();
_local8++;
}
_local2.surfaces = addSurfaces(_local2.piston, "s", objGame.objPhysics, 0.9, 0.95);
break;
case "breakabledoor" :
_local8 = 0;
for(;;){
if (_local8 >= objGame.objPhysics.masses.length) {
break;
}
var _local5 = objGame.objPhysics.masses[_local8];
if (_local5.isHammer && (_local5.hasHitSurface)) {
_local11 = _local5.clip.holderToLocal();
if (_local2.hit.hitTest(_local11.x, _local11.y, true)) {
var _local10 = Maths.vectorLength(_local5.collisionNormal.x, _local5.collisionNormal.y);
if (_local10 > _local2.strength) {
_local2.health = _local2.health - (_local10 - _local2.strength);
if (_local2.health <= 0) {
_local2.health = 0;
_local2.evtBroken();
}
_local2.gotoAndStop(Math.floor(_local2._totalframes - _local2.health));
}
}
}
_local8++;
};
}
_local6++;
_local2 = objGame.clip.level["b" + _local6];
}
}
function stageObjectsPaint(objGame) {
var _local20 = 0;
var _local2 = objGame.clip.level["b" + _local20];
while (_local2 != undefined) {
switch (_local2.item) {
case "ropeanchor" :
var _local4 = 0;
while (_local4 < (_local2.segments.length - 1)) {
var _local3 = _local2.segments[_local4];
var _local8 = _local2.segments[_local4 + 1];
var _local17 = _local8.x - _local3.x;
var _local16 = _local8.y - _local3.y;
var _local9 = Maths.vectorLength(_local17, _local16);
var _local19 = Maths.radToDeg(Math.atan2(_local16, _local17));
_local3.clip._x = _local3.x;
_local3.clip._y = _local3.y;
_local3.clip._rotation = _local19;
_local3.clip._xscale = _local9;
_local4++;
}
break;
case "spyglass" :
var _local12 = _local2.objLine.getPosition();
_local2._x = _local12.x;
_local2._y = _local12.y;
_local2._rotation = _local12.rDeg;
var _local11 = objGame.clip.level.b1;
var _local10 = objGame.clip.level.b2;
var _local6 = objGame.clip.level.b3;
var _local17 = _local2.m_f.x - _local11._x;
var _local16 = _local2.m_f.y - _local11._y;
var _local19 = Maths.radToDeg(Math.atan2(_local16, _local17));
_local2.light._rotation = _local19 - _local2._rotation;
var _local14 = _local2.light.holderToGlobal();
if (_local11.hit.hitTest(_local14.x, _local14.y, true)) {
_local2.light._alpha = Math.min(100, _local2.light._alpha + 5);
var _local7 = _local2.light.focalPoint.holderToGlobal();
if ((!_local10.counting) && (_local10.hit.hitTest(_local7.x, _local7.y, true))) {
_local10.counting = true;
_local10.gotoAndPlay("countdown");
}
_local2.light.sparks._visible = false;
if (!_local6.burntRope) {
_local4 = 0;
while (_local4 < (_local6.segments.length - 1)) {
var _local3 = _local6.segments[_local4];
if (_local3.clip.hit.hitTest(_local7.x, _local7.y, true)) {
_local2.focussedFrames++;
_local2.light.sparks._visible = true;
if (_local2.focussedFrames > 7) {
_local2.burntRope = true;
_local3.clip.removeMovieClip();
_local3.springs[_local3.springs.length - 1].removeSpring();
_local4 = _local6.segments.length;
}
}
_local4++;
}
}
} else {
_local2.light._alpha = Math.max(0, _local2.light._alpha - 5);
_local2.light.sparks._visible = false;
}
if (!_local2.light.sparks._visible) {
_local2.focussedFrames = 0;
}
break;
case "barbell" :
_local12 = _local2.objLine.getPosition();
_local2._x = _local12.x;
_local2._y = _local12.y;
_local2._rotation = _local12.rDeg;
break;
case "floatdoor" :
_local12 = _local2.objLine.getPosition();
_local2._rotation = _local12.rDeg;
break;
case "hammer" :
_local12 = _local2.objLine.getPosition();
_local2._rotation = _local12.rDeg;
break;
case "ball" :
case "lightbulb" :
case "bomb" :
case "fusebomb" :
_local2._x = _local2.objMass.x;
_local2._y = _local2.objMass.y;
break;
case "goalitem" :
if (_local2.objMass != undefined) {
_local2._x = _local2.objMass.x;
_local2._y = _local2.objMass.y;
if (_local2.objMass.hasHitSurface) {
_local2.droppedAtX = undefined;
_local2.slamdunkLeft = 0;
_local2.slamdunkRight = 0;
}
}
if (_local2.objBox != undefined) {
_local12 = _local2.objBox.getPosition();
_local2._x = _local12.x;
_local2._y = _local12.y;
_local2._rotation = _local12.rDeg + 90;
if (_local2.objBox.m_tl.hasHitSurface) {
_local2.droppedAtX = undefined;
_local2.slamdunkLeft = 0;
_local2.slamdunkRight = 0;
}
if (_local2.objBox.m_tr.hasHitSurface) {
_local2.droppedAtX = undefined;
_local2.slamdunkLeft = 0;
_local2.slamdunkRight = 0;
}
if (_local2.objBox.m_bl.hasHitSurface) {
_local2.droppedAtX = undefined;
_local2.slamdunkLeft = 0;
_local2.slamdunkRight = 0;
}
if (_local2.objBox.m_br.hasHitSurface) {
_local2.droppedAtX = undefined;
_local2.slamdunkLeft = 0;
_local2.slamdunkRight = 0;
}
}
if (_local2.objLine != undefined) {
_local12 = _local2.objLine.getPosition();
_local2._x = _local12.x;
_local2._y = _local12.y;
_local2._rotation = _local12.rDeg;
if (_local2.objBox.m_f.hasHitSurface) {
_local2.droppedAtX = undefined;
_local2.slamdunkLeft = 0;
_local2.slamdunkRight = 0;
}
if (_local2.objBox.m_b.hasHitSurface) {
_local2.droppedAtX = undefined;
_local2.slamdunkLeft = 0;
_local2.slamdunkRight = 0;
}
}
break;
case "battery" :
_local12 = _local2.objLine.getPosition();
_local2._x = _local12.x;
_local2._y = _local12.y;
_local2._rotation = _local12.rDeg;
break;
case "handle" :
_local17 = _local2.mHandle.x - _local2.mHub.x;
_local16 = _local2.mHandle.y - _local2.mHub.y;
var _local18 = Math.atan2(_local16, _local17) - (Math.PI/2);
var _local15 = Maths.radToDeg(_local18);
_local2.arm._rotation = _local15;
_local2.arm.handle._rotation = -_local15;
var _local5 = _local2.prevAngle - _local2.arm._rotation;
if (_local5 < -100) {
_local5 = 0;
}
if (_local5 < -20) {
_local5 = -20;
}
if (_local5 > 100) {
_local5 = 0;
}
if (_local5 > 20) {
_local5 = 20;
}
_root.objSounds.volume("ratchet-loop", Math.min(100, Math.abs(20 * _local5)));
_local2.angleChanged(_local5);
_local2.prevAngle = _local2.arm._rotation;
break;
case "conveyerbelt" :
}
_local20++;
_local2 = objGame.clip.level["b" + _local20];
}
}
function pauseObjects(objGame) {
var _local3 = 0;
var _local2 = objGame.clip.level["b" + _local3];
while (_local2 != undefined) {
switch (_local2.item) {
case "lift" :
case "wave" :
case "piston" :
case "screw" :
_local2.stop();
break;
case "bomb" :
_local2.stop();
_root.objSounds.stop("bomb-tick");
}
_local3++;
_local2 = objGame.clip.level["b" + _local3];
}
}
function unpauseObjects(objGame) {
var _local2 = 0;
var _local1 = objGame.clip.level["b" + _local2];
while (_local1 != undefined) {
switch (_local1.item) {
case "lift" :
if (_local1._currentframe < _local1._totalframes) {
_local1.play();
}
break;
case "bomb" :
case "wave" :
_local1.play();
}
_local2++;
_local1 = objGame.clip.level["b" + _local2];
}
}
function setupLevelIndicators(levelsClip) {
initLevelSO();
initAchievementsSO();
_root.allLevelsComplete = true;
var _local4;
var _local6 = 20;
var _local7 = 0;
var _local9 = 0;
var _local10 = 0;
var _local8 = 0;
var _local3 = 1;
while (_local4 = levelsClip["l" + _local3] , _local4) {
var _local2 = _root.arrLevels[_local3];
_local4.id = _local3;
_local4.gotoAndStop((_local2.available ? "available" : "unavailable"));
_local4.txtLevel.htmlText = ("<b>" + Maths.formatNum(_local3, 2)) + "</b>";
_local4.passed._visible = false;
if (_local2.passed) {
_local7++;
_local4.passed._visible = true;
}
if (_local2.perfect) {
_local10++;
_local4.passed.gotoAndStop("perfect");
}
if (_local2.fast) {
_local9++;
_local4.passed.gotoAndStop("fast");
}
_local8 = _local8 + _local2.bestFrames;
if (((!_local2.passed) && (_local2.available)) && (_local3 < _local6)) {
_local6 = _local3;
}
if (!_local2.passed) {
_root.allLevelsComplete = false;
}
var _local5 = _root.levels["s" + _local3];
_local5.txtTitle.htmlText = ("<b>" + _local2.title.toUpperCase()) + "</b>";
_local5.txtTime.htmlText = ("<b><i>" + getNeatTime(_local2.bestFrames).strTime) + "</i></b>";
_local5.perfect.gotoAndStop((_local2.perfect ? "on" : "off"));
_local5.fast.gotoAndStop((_local2.fast ? "on" : "off"));
_local5._alpha = 0;
_local5._visible = false;
_local4.summaryClip = _local5;
_local3++;
}
if ((_local7 > 3) && (_root.seenChangeChopperScreen > 0)) {
changeChopperHint.gotoAndPlay("show");
} else {
changeChopperHint.gotoAndStop("hide");
}
if (_root.workingOnLevel == undefined) {
_root.workingOnLevel = _local6;
}
levelsClip["l" + _root.workingOnLevel].gotoAndStop("selected");
_root.levelTitle._alpha = 0;
txtCollected.htmlText = ("<b>" + _local7) + "/20</b>";
txtFast.htmlText = ("<b>" + _local9) + "/20</b>";
txtPerfect.htmlText = ("<b>" + _local10) + "/20</b>";
txtTotalTime.htmlText = ("<b>" + getNeatTime(_local8).strTime) + "</b>";
_root.totalMilliseconds = getNeatTime(_local8).milliseconds;
levels.onEnterFrame = function () {
_root.delay--;
if (_root.objTrans.transitioning) {
return(undefined);
}
if (Key.isDown(Keys.Enter)) {
_root.transToGame();
}
if (Key.isDown(Keys.CursorLeft) || (Key.isDown(Keys.A))) {
selectLevel(-1, 0);
}
if (Key.isDown(Keys.CursorRight) || (Key.isDown(Keys.D))) {
selectLevel(1, 0);
}
if (Key.isDown(Keys.CursorUp) || (Key.isDown(Keys.W))) {
selectLevel(0, -1);
}
if (Key.isDown(Keys.CursorDown) || (Key.isDown(Keys.S))) {
selectLevel(0, 1);
}
};
}
function rollOverLevel(id) {
var _local2 = _root.levels["l" + id];
var _local3 = _local2.summaryClip;
_local3.fadeIn(0.2, "easeInOutSine");
}
function rollOutLevel(id) {
var _local2 = _root.levels["l" + id];
var _local3 = _local2.summaryClip;
_local3.fadeOut(0.4, "easeInOutSine");
}
function transToGame() {
_root.objTrans.goto("game");
_root.frame.nextTarget = "game_in";
_root.frame.gotoAndPlay("levelselect_out");
}
function selectLevel(dx, dy) {
if (_root.delay > 0) {
return(undefined);
}
_root.delay = 6;
var _local8 = _root.arrLevels[_root.workingOnLevel];
var _local12 = _root.levels["l" + _local8.id]._x;
var _local11 = _root.levels["l" + _local8.id]._y;
var _local9 = 0;
var _local10 = _local8.id;
var _local3 = 0;
while (_local3 < _local8.links.length) {
var _local2 = _root.arrLevels[_local8.links[_local3]];
if (!_local2.available) {
} else {
var _local5 = _root.levels["l" + _local2.id]._x - _local12;
var _local4 = _root.levels["l" + _local2.id]._y - _local11;
var _local7 = Maths.vectorLength(_local5, _local4);
_local5 = _local5 / _local7;
_local4 = _local4 / _local7;
var _local6 = Maths.dotProduct(_local5, _local4, dx, dy);
if (_local6 < 0.4) {
} else if (_local6 > _local9) {
_local9 = _local6;
_local10 = _local2.id;
}
}
_local3++;
}
deselectLevels(_local10);
_root.levels["l" + _local10].gotoAndStop("selected");
}
function setupAchievements() {
var _local2 = 1;
while (_local2 < _root.arrAchievements.length) {
clip = _root["a" + _local2];
if (_root.arrAchievements[_local2].complete) {
clip.box.gotoAndStop("on");
}
clip.txtTitle.htmlText = ("<b>" + achievementName(_local2)) + "</b>";
clip.txtDescription.htmlText = ("<b>" + achievementDescription(_local2).toUpperCase()) + "</b>";
clip._alpha = 0;
clip.fadeIn(0.6, "easeInOutSine", 1 + (0.15 * _local2));
_local2++;
}
if (arrAchievements[14].complete) {
_root.objSounds.play("allachievements");
}
}
function achieved(id) {
trace(((("Achievement " + id) + " gained (") + achievementName(id)) + ")");
if (_root.arrAchievements[id].complete) {
return(0);
}
_root.arrAchievements[id].complete = true;
var _local7 = SharedObject.getLocal("wallaceandgromitipo");
_local7.data.arrAchievements = _root.arrAchievements;
_local7.flush();
_root.achievement.gotoAndPlay("anim");
_root.achievement.panel.txtAchievementName.htmlText = ("<b>" + achievementName(id)) + "</b>";
_root.achievement.panel.txtAchievementDescription.htmlText = ("<b>" + achievementDescription(id).toUpperCase()) + "</b>";
if (_root.user_suid != undefined) {
var _local6 = new LoadVars();
var _local5 = new LoadVars();
switch (id) {
case 13 :
_local6.sendAndLoad(_root.badgeURL + "9", _local5, "GET");
break;
case 6 :
_local6.sendAndLoad(_root.badgeURL + "10", _local5, "GET");
break;
}
}
var _local3 = 0;
var _local2 = 0;
while (_local2 < _root.arrAchievements.length) {
if (_root.arrAchievements[_local2].complete) {
_local3++;
}
_local2++;
}
if (_local3 >= (_root.arrAchievements.length - 2)) {
achieved(14);
Mouse.show();
trace("Got every achievement");
}
return(1);
}
function deselectLevels(exceptID) {
var _local3;
var _local2 = 1;
while (_local3 = _root.levels["l" + _local2] , _local3) {
if (_local2 == exceptID) {
} else {
_local3.gotoAndStop((_root.arrLevels[_local2].available ? "available" : "unavailable"));
}
_local2++;
}
_root.curLevelID = exceptID;
_root.workingOnLevel = curLevelID;
}
function passedLevel(id, perfect, fast, levelFrames) {
var _local5 = _root.arrLevels[id];
_local5.passed = true;
if (perfect) {
_local5.perfect = true;
}
if (fast) {
_local5.fast = true;
}
if (_local5.bestFrames == 0) {
_local5.bestFrames = levelFrames;
}
if (levelFrames < _local5.bestFrames) {
_local5.bestFrames = levelFrames;
}
_root.workingOnLevel = undefined;
switch (id) {
case 1 :
_root.arrLevels[2].available = true;
break;
case 2 :
_root.arrLevels[3].available = true;
break;
default :
var _local4 = 0;
var _local3 = 0;
for(;;){
if (_local3 >= _root.arrLevels.length) {
break;
}
var _local2 = _root.arrLevels[_local3];
if (_local2.available && (!_local2.passed)) {
_local4++;
}
if ((!_local2.available) && (_local4 <= 3)) {
_local2.available = true;
_local4++;
}
_local3++;
};
}
var _local6 = SharedObject.getLocal("wallaceandgromitipo");
_local6.data.arrLevels = _root.arrLevels;
_local6.flush();
}
function initLevelSO() {
var _local2 = SharedObject.getLocal("wallaceandgromitipo");
if (_local2.data.arrLevels == undefined) {
_local2.data.arrLevels = [{dummy:true}, {id:1, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:250, title:"Flight Prototype", links:[2, 6]}, {id:2, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:400, title:"Heavy Lifting", links:[1, 3, 7]}, {id:3, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:550, title:"Button Graduate", links:[2, 4, 8]}, {id:4, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:700, title:"Latteral thinking", links:[3, 5, 9]}, {id:5, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:800, title:"Controlling the weather", links:[4, 10]}, {id:6, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:1400, title:"Sail Away", links:[1, 7, 11]}, {id:7, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:800, title:"In Emergency Break Glass", links:[2, 6, 8, 12]}, {id:8, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:750, title:"Blown Away", links:[3, 7, 9, 13]}, {id:9, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:1800, title:"Sorting the Junkroom", links:[4, 8, 10, 14]}, {id:10, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:800, title:"Getting a Bit Cranky", links:[5, 9, 15]}, {id:11, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:1760, title:"Sewer Splash", links:[6, 12, 16]}, {id:12, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:1250, title:"Heavy Labour", links:[7, 11, 13, 17]}, {id:13, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:1100, title:"A Delicate Matter", links:[8, 12, 14, 18]}, {id:14, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:1550, title:"Race the Water", links:[9, 13, 15, 19]}, {id:15, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:800, title:"An Electromagnetic Quandry", links:[10, 14, 20]}, {id:16, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:750, title:"The Plunger of Trouble", links:[11, 17]}, {id:17, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:950, title:"Cannonball Catch", links:[12, 16, 18]}, {id:18, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:1050, title:"Conrod Calamity", links:[13, 17, 19]}, {id:19, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:1550, title:"You Have to Burn The Rope", links:[14, 18, 20]}, {id:20, available:false, passed:false, perfect:false, fast:false, bestFrames:0, par:2000, title:"Completing the Circuit", links:[15, 19]}];
_local2.data.arrLevels[1].available = true;
_local2.flush();
}
_root.arrLevels = _local2.data.arrLevels;
}
function initAchievementsSO() {
var _local2 = SharedObject.getLocal("wallaceandgromitipo");
if (_local2.data.arrAchievements == undefined) {
_local2.data.arrAchievements = [{dummy:true}, {id:1, complete:false}, {id:2, complete:false}, {id:3, complete:false}, {id:4, complete:false}, {id:5, complete:false}, {id:6, complete:false}, {id:7, complete:false}, {id:8, complete:false}, {id:9, complete:false}, {id:10, complete:false}, {id:11, complete:false}, {id:12, complete:false}, {id:13, complete:false}, {id:14, complete:false}];
_local2.flush();
}
_root.arrAchievements = _local2.data.arrAchievements;
}
function achievementName(id) {
switch (id) {
case 1 :
return("SLIGHTLY PERFECT");
case 2 :
return("SLIGHTLY FAST");
case 3 :
return("PERFECTLY FAST");
case 4 :
return("MOSTLY PERFECT");
case 5 :
return("MOSTLY FAST");
case 6 :
return("PERFECTLY PERFECT");
case 7 :
return("BLINDINGLY FAST");
case 8 :
return("BACK OF THE NET");
case 9 :
return("LONG SHOT");
case 10 :
return("SLAM DUNK");
case 11 :
return("BOMB CATCH");
case 12 :
return("THE HARD WAY");
case 13 :
return("COLECT 'EM ALL");
case 14 :
return("HUGE ACHIEVEMENT");
}
return("UNKNOWN");
}
function achievementDescription(id) {
switch (id) {
case 1 :
return("Get a perfect rating on any level");
case 2 :
return("Get a fast rating on any level");
case 3 :
return("Get both perfect and fast ratings at the same time");
case 4 :
return("Collect 15 perfect ratings");
case 5 :
return("Collect 15 fast ratings");
case 6 :
return("Gain all 20 perfect ratings");
case 7 :
return("Gain all 20 fast ratings");
case 8 :
return("Slam an item into the tube at top speed");
case 9 :
return("Throw an item cleanly into the tube from far away");
case 10 :
return("Spin an item right over yourself and clean into the tube");
case 11 :
return("Drop and then re-catch a bomb that you're carrying");
case 12 :
return("Smash the glass on level 7 without using the winch");
case 13 :
return("Beat every level and collect all the parts in the game");
case 14 :
return("Gain every other achievement");
}
return("UNKNOWN");
}
function getNeatTime(frame) {
var _local1 = Math.floor(frame / 30);
var _local5 = Math.floor(_local1 / 60);
var _local3 = _local1 % 60;
var _local4 = (frame / 30) - _local1;
var _local6 = 1000 * _local1;
var _local2 = {milliseconds:_local6, minutes:Maths.formatNum(_local5, 2), seconds:Maths.formatNum(_local3, 2), tenths:Maths.formatNum(_local4 * 100, 2)};
_local2.strTime = ((_local5 + "m ") + Maths.formatNum(_local3, 2)) + "sec";
return(_local2);
}
function setupSelectChopperScreen() {
_root.sel_red._alpha = 0;
_root.sel_cream._alpha = 0;
_root.sel_orange._alpha = 0;
_root["sel_" + _root.chopperColour]._alpha = 100;
}
function selectChopper(colour) {
if (_root.chopperColour == colour) {
return(undefined);
}
_root["sel_" + _root.chopperColour].fadeOut(0.3, "easeInOutSine");
_root.chopperColour = colour;
_root["sel_" + _root.chopperColour].fadeIn(0.3, "easeInOutSine");
}
function initSounds() {
_root.objSounds = new Sounds(_root.soundHolder);
var _local3 = 40;
_root.objSounds.registerSound("blade-01_00", _local3);
_root.objSounds.registerSound("blade-01_01", _local3);
_root.objSounds.registerSound("blade-01_02", _local3);
_root.objSounds.registerSound("blade-01_03", _local3);
_root.objSounds.registerSound("blade-01_04", _local3);
_root.objSounds.registerSound("blade-01_05", _local3);
_root.objSounds.registerSound("blade-01_06", _local3);
_root.objSounds.registerSound("blade-01_07", _local3);
_root.objSounds.registerSound("blade-01_08", _local3);
_root.objSounds.registerSound("blade-01_09", _local3);
_root.objSounds.registerSound("blade-01_10", _local3);
_root.objSounds.registerSound("blade-01_11", _local3);
_root.objSounds.registerSound("blade-01_12", _local3);
_root.objSounds.registerSound("blade-01_13", _local3);
_root.objSounds.registerSound("blade-01_14", _local3);
_root.objSounds.registerSound("blade-01_15", _local3);
_root.objSounds.registerSound("blade-01_16", _local3);
_root.objSounds.registerSound("blade-01_17", _local3);
_root.objSounds.registerSound("blade-01_18", _local3);
_root.objSounds.registerSound("blade-01_19", _local3);
_root.objSounds.registerSound("blade-01_20", _local3);
_root.objSounds.registerGroup("blade", ["blade-01_00", "blade-01_01", "blade-01_02", "blade-01_03", "blade-01_04", "blade-01_05", "blade-01_06", "blade-01_07", "blade-01_08", "blade-01_09", "blade-01_10", "blade-01_11", "blade-01_12", "blade-01_13", "blade-01_14", "blade-01_15", "blade-01_16", "blade-01_17", "blade-01_18", "blade-01_19", "blade-01_20"]);
_root.objSounds.registerSound("bomb-tick");
_root.objSounds.registerSound("bomb-armed");
_root.objSounds.registerSound("boulder-01");
_root.objSounds.registerSound("boulder-02");
_root.objSounds.registerSound("boulder-03");
_root.objSounds.registerSound("boulder-04");
_root.objSounds.registerSound("boulder-05");
_root.objSounds.registerGroup("rockcrash", ["boulder-01", "boulder-02", "boulder-03", "boulder-04", "boulder-05"]);
_root.objSounds.registerSound("lightbulb-01");
_root.objSounds.registerSound("lightbulb-02");
_root.objSounds.registerSound("lightbulb-03");
_root.objSounds.registerSound("lightbulb-04");
_root.objSounds.registerSound("lightbulb-05");
_root.objSounds.registerGroup("glassclink", ["lightbulb-01", "lightbulb-02", "lightbulb-03", "lightbulb-04", "lightbulb-05"]);
_root.objSounds.registerSound("magnet-01");
_root.objSounds.registerSound("magnet-02");
_root.objSounds.registerSound("magnet-03");
_root.objSounds.registerSound("magnet-04");
_root.objSounds.registerGroup("magnet", ["magnet-01", "magnet-02", "magnet-03", "magnet-04"]);
_root.objSounds.registerSound("switch1");
_root.objSounds.registerSound("switch2");
_root.objSounds.registerSound("switch3");
_root.objSounds.registerGroup("switch", ["switch1", "switch2", "switch3"]);
_root.objSounds.registerSound("clunk1");
_root.objSounds.registerSound("clunk2");
_root.objSounds.registerSound("clunk3");
_root.objSounds.registerSound("clunk4");
_root.objSounds.registerSound("clunk5");
_root.objSounds.registerGroup("clunk", ["clunk1", "clunk2", "clunk3", "clunk4", "clunk5"]);
_root.objSounds.registerSound("transition-01");
_root.objSounds.registerSound("transition-02");
_root.objSounds.registerGroup("transition", ["transition-01", "transition-02"]);
_root.objSounds.registerSound("thud1");
_root.objSounds.registerSound("thud2");
_root.objSounds.registerGroup("thud", ["thud1", "thud2"]);
_root.objSounds.registerSound("deliverytube");
_root.objSounds.registerSound("sewerflood");
_root.objSounds.registerSound("boom");
_root.objSounds.registerSound("fuse");
_root.objSounds.registerSound("spring");
_root.objSounds.registerSound("power-on");
_root.objSounds.registerSound("glass-smash");
_root.objSounds.registerSound("door-open");
_root.objSounds.registerSound("door-close");
_root.objSounds.registerSound("imperfect");
_root.objSounds.registerSound("nonfast");
_root.objSounds.registerSound("chain-drop");
_root.objSounds.registerSound("chain-retract");
_root.objSounds.registerSound("windmill-loop");
_root.objSounds.registerSound("wind-loop");
_root.objSounds.registerSound("ratchet-loop");
_root.objSounds.registerSound("rollover-tick");
_root.objSounds.registerSound("rollover-tock");
_root.objSounds.registerSound("loop_game", 80);
_root.objSounds.registerSound("loop_menu", 80);
_root.objSounds.registerSound("loop_fail", 60);
_root.objSounds.registerSound("loop_win", 60);
_root.objSounds.registerSound("achievement1");
_root.objSounds.registerSound("achievement2");
_root.objSounds.registerGroup("achievement", ["achievement1", "achievement2"]);
_root.objSounds.registerSound("attention1");
_root.objSounds.registerSound("attention2");
_root.objSounds.registerSound("attention3");
_root.objSounds.registerSound("attention4");
_root.objSounds.registerGroup("attention", ["attention1", "attention2", "attention3", "attention4"]);
_root.objSounds.registerSound("caution1");
_root.objSounds.registerSound("caution2");
_root.objSounds.registerSound("caution3");
_root.objSounds.registerSound("caution4");
_root.objSounds.registerSound("caution5");
_root.objSounds.registerSound("caution6");
_root.objSounds.registerGroup("caution", ["caution1", "caution2", "caution3", "caution4", "caution5", "caution6"]);
_root.objSounds.registerSound("fail1");
_root.objSounds.registerSound("fail2");
_root.objSounds.registerSound("fail3");
_root.objSounds.registerSound("fail4");
_root.objSounds.registerSound("fail5");
_root.objSounds.registerSound("fail6");
_root.objSounds.registerSound("fail7");
_root.objSounds.registerGroup("fail", ["fail1", "fail2", "fail3", "fail4", "fail5", "fail6", "fail7"]);
_root.objSounds.registerSound("slowdown1");
_root.objSounds.registerSound("slowdown2");
_root.objSounds.registerGroup("slowdown", ["slowdown1", "slowdown2"]);
_root.objSounds.registerSound("gamecomplete");
_root.objSounds.registerGroup("allachievements", ["gamecomplete"]);
_root.objSounds.registerSound("restart1");
_root.objSounds.registerSound("restart2");
_root.objSounds.registerSound("restart3");
_root.objSounds.registerGroup("restart", ["restart1", "restart2", "restart3"]);
_root.objSounds.registerSound("win01");
_root.objSounds.registerSound("win02");
_root.objSounds.registerSound("win03");
_root.objSounds.registerSound("win04");
_root.objSounds.registerSound("win05");
_root.objSounds.registerSound("win06");
_root.objSounds.registerSound("win07");
_root.objSounds.registerSound("win08");
_root.objSounds.registerSound("win09");
_root.objSounds.registerSound("win10");
_root.objSounds.registerSound("win11");
_root.objSounds.registerSound("win12");
_root.objSounds.registerSound("win13");
_root.objSounds.registerGroup("win", ["win01", "win02", "win03", "win04", "win05", "win06", "win07", "win08", "win09", "win10", "win11", "win12", "win13"]);
_root.objSounds.isVoicePlaying = function () {
if (this.isPlaying("win")) {
return(true);
}
if (this.isPlaying("restart")) {
return(true);
}
if (this.isPlaying("slowdown")) {
return(true);
}
if (this.isPlaying("fail")) {
return(true);
}
if (this.isPlaying("caution")) {
return(true);
}
if (this.isPlaying("attention")) {
return(true);
}
if (this.isPlaying("achievement")) {
return(true);
}
if (this.isPlaying("allachievements")) {
return(true);
}
return(false);
};
_root.objSounds.groups.win.isVoice = true;
_root.objSounds.groups.restart.isVoice = true;
_root.objSounds.groups.slowdown.isVoice = true;
_root.objSounds.groups.fail.isVoice = true;
_root.objSounds.groups.caution.isVoice = true;
_root.objSounds.groups.attention.isVoice = true;
_root.objSounds.groups.achievement.isVoice = true;
_root.objSounds.groups.allachievements.isVoice = true;
}
function stopAllLoopingSounds() {
_root.objSounds.stop("ratchet-loop");
_root.objSounds.stop("windmill-loop");
_root.objSounds.stop("bomb-tick");
}
function Music() {
this.playing = false;
this.muted = false;
this.loopID = "menu";
}
function startIntroPhysics(clip) {
_root.objSounds.play("chain-drop");
clip.physicsPaint = function () {
var _local1 = clip.slChain.getPosition();
clip.chainGfx._x = _local1.x;
clip.chainGfx._y = _local1.y;
clip.chainGfx._rotation = _local1.rDeg;
clip.mMouse.x = clip.physicsHolder._xmouse;
clip.mMouse.y = clip.physicsHolder._ymouse;
};
var _local3 = false;
clip.objPhysics = new Physics(clip.physicsHolder, 0, 0.2, 0.99, false, false, clip.physicsPaint, _local3);
clip.mAnchor = new Mass(clip.anchor._x, clip.anchor._y, 5, true, clip.objPhysics, 1);
clip.mChain = new Mass(clip.chain._x, clip.chain._y, 5, false, clip.objPhysics, 1);
clip.mCog = new Mass(clip.cog._x, clip.cog._y, 34, false, clip.objPhysics, 1);
clip.slLink = makeSpringLine(clip.mAnchor, clip.mChain);
clip.slChain = makeSpringLine(clip.mCog, clip.mChain);
clip.mMouse = new Mass(clip.physicsHolder._xmouse, clip.physicsHolder._ymouse, 10, true, clip.objPhysics, 2);
clip.objPhysics.attractingMasses = true;
clip.objPhysics.attractionScale = 25;
clip.mMouse.attractionMass = -7;
clip.mCog.attractionMass = -7;
}
function ChoppaGame(clip) {
this.clip = clip;
this.clip.objGame = this;
this.interfaceClip = _root.frame;
this.initialise();
}
function moveToMenu() {
intro.onEnterFrame = undefined;
_root.fadeToBlack.transFunc = function () {
_root.gotoAndStop("picklevel");
_root.frame.gotoAndPlay("levelselect_in");
};
_root.fadeToBlack.gotoAndPlay("transition");
}
stop();
Mouse.show();
music.stop();
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.vectorProject = function (v1, v2) {
var _local2 = Maths.vectorLength(v2.dx, v2.dy);
var _local4 = v2.dx / _local2;
var _local3 = v2.dy / _local2;
var _local5 = Maths.dotProduct(v1.dx, v1.dy, _local4, _local3);
return({x:v2.x, y:v2.y, dx:_local4 * _local5, dy:_local3 * _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.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 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 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 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);
};
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;
}
};
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 (this.groups[id].isVoice && (this.isVoicePlaying())) {
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.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.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);
}
var _local15 = 0;
while (_local15 < this.masses.length) {
var _local13 = this.masses[_local15];
_local13.hasHitSurface = false;
if (!_local13.fixed) {
_local13.prevX = _local13.x;
_local13.prevY = _local13.y;
var _local6 = _local13.sumSpringForces();
_local6.x = _local6.x + (this.gravityX * _local13.mass);
_local6.y = _local6.y + (this.gravityY * _local13.mass);
_local6.x = _local6.x + _local13.extForceX;
_local6.y = _local6.y + _local13.extForceY;
_local13.extForceX = 0;
_local13.extForceY = 0;
_local13.vx = _local13.vx + (_local6.x / _local13.mass);
_local13.vy = _local13.vy + (_local6.y / _local13.mass);
}
_local15++;
}
if (this.attractingMasses) {
_local15 = 0;
while (_local15 < this.masses.length) {
var _local13 = this.masses[_local15];
if (_local13.attractionMass != 0) {
_local13.applyAttractionForces();
}
_local15++;
}
}
_local15 = 0;
while (_local15 < this.masses.length) {
var _local13 = this.masses[_local15];
if (!_local13.fixed) {
if (_local13.vx > _local13.friction) {
_local13.vx = _local13.vx - _local13.friction;
} else if (_local13.vx < (-_local13.friction)) {
_local13.vx = _local13.vx + _local13.friction;
} else {
_local13.vx = 0;
}
if (_local13.vy > _local13.friction) {
_local13.vy = _local13.vy - _local13.friction;
} else if (_local13.vy < (-_local13.friction)) {
_local13.vy = _local13.vy + _local13.friction;
} else {
_local13.vy = 0;
}
_local13.vx = _local13.vx * this.drag;
_local13.vy = _local13.vy * this.drag;
}
_local15++;
}
_local15 = 0;
while (_local15 < this.masses.length) {
var _local13 = this.masses[_local15];
_local13.x = _local13.x + _local13.vx;
_local13.y = _local13.y + _local13.vy;
_local15++;
}
this.masses.sort(massSort, Array.NUMERIC);
_local15 = 0;
while (_local15 < this.masses.length) {
this.masses[_local15].testedSet = [];
_local15++;
}
var _local7 = [];
if (this.collidableMasses) {
_local15 = 0;
while (_local15 < this.masses.length) {
var _local9 = this.masses[_local15];
var _local17 = (this.biggestMassRadius + _local9.radius) + 1;
var _local16 = _local9.x + _local17;
var _local2 = _local15 + 1;
while (_local2 < this.masses.length) {
var _local8 = this.masses[_local2];
if (_local8.x > _local16) {
_local2 = this.masses.length;
} else if ((((((_local9 != undefined) && (_local8 != undefined)) && (_local9.testedSet[_local2] == undefined)) && (_local9.collisionSet != undefined)) && (_local8.collisionSet != undefined)) && (_local9.collisionSet != _local8.collisionSet)) {
var _local5 = _local9.x - _local8.x;
var _local4 = _local9.y - _local8.y;
var _local12 = (_local5 * _local5) + (_local4 * _local4);
var _local10 = (_local9.radius + _local8.radius) * (_local9.radius + _local8.radius);
if (_local12 < _local10) {
_local7.push({massA:_local9, massB:_local8});
}
_local9.testedSet[_local2] = true;
_local8.testedSet[_local15] = true;
}
_local2++;
}
_local16 = _local9.x - _local17;
_local2 = _local15 - 1;
while (_local2 >= 0) {
var _local8 = this.masses[_local2];
if (_local8.x < _local16) {
_local2 = -1;
} else if ((((((_local9 != undefined) && (_local8 != undefined)) && (_local9.testedSet[_local2] == undefined)) && (_local9.collisionSet != undefined)) && (_local8.collisionSet != undefined)) && (_local9.collisionSet != _local8.collisionSet)) {
var _local5 = _local9.x - _local8.x;
var _local4 = _local9.y - _local8.y;
var _local12 = (_local5 * _local5) + (_local4 * _local4);
var _local10 = _local9.radiusSquared + _local8.radiusSquared;
if (_local12 < _local10) {
_local7.push({massA:_local9, massB:_local8});
}
_local9.testedSet[_local2] = true;
_local8.testedSet[_local15] = true;
}
_local2--;
}
_local15++;
}
}
_local7.sort(collisionSort);
_local15 = 0;
while (_local15 < _local7.length) {
_local7[_local15].massA.resolveCollision(_local7[_local15].massB);
_local15++;
}
_local15 = 0;
while (_local15 < this.masses.length) {
var _local14 = this.masses[_local15];
if (_local14.fixed) {
} else {
var _local2 = 0;
while (_local2 < this.surfaces.length) {
var _local11 = this.surfaces[_local2];
_local11.handleCollision(_local14);
_local2++;
}
}
_local15++;
}
if (this.framePaintCallback) {
this.framePaintCallback();
}
if (this.defaultPaint) {
_local15 = 0;
while (_local15 < this.masses.length) {
var _local13 = this.masses[_local15];
_local13.clipRep._x = _local13.x;
_local13.clipRep._y = _local13.y;
_local15++;
}
_local15 = 0;
while (_local15 < this.springs.length) {
var _local3 = this.springs[_local15];
_local3.clipRep.clear();
_local3.clipRep.lineStyle(1, 16711680, 100);
_local3.clipRep.moveTo(_local3.mass1.x, _local3.mass1.y);
_local3.clipRep.lineTo(_local3.mass2.x, _local3.mass2.y);
_local15++;
}
}
};
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)) && (this.collisionSet != _local2.collisionSet)) {
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();
};
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);
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);
}
return(false);
};
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);
};
Music.prototype.start = function () {
this.playing = true;
this.startNextLoop();
};
Music.prototype.stop = function () {
this.playing = false;
_root.objSounds.stop("loop_game");
_root.objSounds.stop("loop_menu");
_root.objSounds.stop("loop_win");
_root.objSounds.stop("loop_fail");
};
Music.prototype.startNextLoop = function () {
if (!this.playing) {
return(undefined);
}
_root.objSounds.play("loop_" + this.loopID);
_root.objSounds.sounds["loop_" + this.loopID].objMusic = this;
_root.objSounds.sounds["loop_" + this.loopID].onSoundComplete = function () {
this.objMusic.startNextLoop();
};
switch (this.loopID) {
case "menu" :
this.loopID = "menu";
break;
case "game" :
this.loopID = "game";
break;
case "fail" :
this.loopID = "menu";
break;
case "win" :
this.loopID = "menu";
}
};
Music.prototype.setLoop = function (id) {
trace(("Music: setLoop(" + id) + ")");
this.loopID = id;
};
ChoppaGame.prototype.initialise = function () {
this.clip.level.gotoAndStop(_root.curLevelID);
this.frame = 0;
this.w = 640;
this.h = 480;
this.usedWinch = false;
this.state = "paused";
this.pausedFrames = 0;
this.path = [];
this.pathSegs = 60;
this.winchState = "idle";
this.torque = 0.04;
this.perfect = true;
this.bladeFrames = 10;
this.chopperColour = _root.chopperColour;
this.chopperDir = "right";
this.clip.level.choppa.gotoAndPlay(this.chopperColour + "_right");
this.speedyFrames = 0;
this.saidSpeedy = false;
switch (this.chopperColour) {
case "red" :
this.idleLift = 0.3;
this.throttleLift = 1.2;
this.throttleLiftLow = 0.7;
this.robustness = 18;
this.winchStrength = 12;
break;
case "cream" :
this.idleLift = 0.6;
this.throttleLift = 0.6;
this.throttleLiftLow = 0.4;
this.robustness = 22;
this.winchStrength = 14;
break;
case "orange" :
this.idleLift = 0.2;
this.throttleLift = 1.4;
this.throttleLiftLow = 1.4;
this.robustness = 12;
this.winchStrength = 12;
}
var _local11 = false;
var _local12 = this.paint;
this.gravity = 0.2;
this.objPhysics = new Physics(this.clip.level.physics, 0, this.gravity, 0.99, true, false, _local12, _local11);
var _local9 = this.clip.level.choppa.tail.holderToLocal(this.clip);
var _local8 = this.clip.level.choppa.cockpit.holderToLocal(this.clip);
this.mTail = new Mass(_local9.x, _local9.y, 28, false, this.objPhysics, -1);
this.mCockpit = new Mass(_local8.x, _local8.y, 28, false, this.objPhysics, -1);
this.mTail.isChoppa = true;
this.mCockpit.isChoppa = true;
this.slChassis = makeSpringLine(this.mTail, this.mCockpit);
var _local10 = this.slChassis.getPosition();
this.choppaRotationOffset = this.clip.level.choppa._rotation - _local10.rDeg;
this.prevChoppaRotation = this.clip.level.choppa._rotation;
this.clip.level.chainA._visible = false;
this.clip.level.chainB._visible = false;
this.clip.level.magnet._visible = false;
addSurfaces(this.clip.level, "s", this.objPhysics, 0.7, 0.9);
addSurfaces(this.clip.level.flag, "s", this.objPhysics, 0.7, 0.9);
initObjectsFromStage(this);
this.clip.screenCentre._visible = false;
this.clip.winPanel._visible = false;
this.clip.crashPanel._visible = false;
this.clip.perfectPanel._visible = false;
this.clip.fastPanel._visible = false;
this.clip.level.flag.hit._visible = false;
this.clip.winPanel._alpha = 0;
this.clip.crashPanel._alpha = 0;
this.clip.perfectPanel._alpha = 0;
this.clip.fastPanel._alpha = 0;
this.clip.level.choppa.slamdunk._visible = false;
par = _root.getNeatTime(_root.arrLevels[_root.curLevelID].par);
_root.parTime = ((("<b>Beat " + par.minutes) + "m") + par.seconds) + "secs</b>";
this.interfaceClip.perfect.lamp.gotoAndStop("on");
this.interfaceClip.fast.lamp.gotoAndStop("on");
this.interfaceClip.fast.txt.htmlText = _root.parTime;
this.updateTimer(this.frame);
var _local3 = 0;
while (_local3 < this.pathSegs) {
this.path[_local3] = {x1:-5000, y1:-5000, x2:-5000, y2:-5000};
_local3++;
}
this.screenCentreX = this.clip.screenCentre._x;
this.screenCentreY = this.clip.screenCentre._y;
this.objPhysics.baseClip.onEnterFrame = undefined;
this.clip.onEnterFrame = function () {
this.objGame.evtEnterFrame();
};
Key.addListener(this);
};
ChoppaGame.prototype.evtEnterFrame = function () {
this.frame++;
if (Key.isDown(Keys.Escape) && (!_root.objTrans.transitioning)) {
_root.objSounds.play("rollover-tick");
Key.removeListener(this);
_root.objTrans.goto("picklevel");
_root.frame.nextTarget = "levelselect_in";
_root.frame.gotoAndPlay("game_out");
}
if (Key.isDown(Keys.R) && (!_root.objTrans.transitioning)) {
_root.objSounds.play("rollover-tick");
Key.removeListener(this);
stopAllLoopingSounds();
_root.objTrans.goto("restart");
}
switch (this.state) {
case "paused" :
this.frame--;
this.pausedFrames++;
if (this.pausedFrames == 20) {
this.state = "flight";
}
this.objectsEnterFrame();
this.paint();
break;
case "flight" :
this.updateTimer(this.frame);
this.mCockpit.extForceX = 0;
this.mCockpit.extForceY = 0;
this.mTail.extForceX = 0;
this.mTail.extForceY = 0;
var _local12 = Math.cos(Maths.degToRad(this.clip.level.choppa._rotation - 90));
var _local11 = Math.sin(Maths.degToRad(this.clip.level.choppa._rotation - 90));
var _local9 = this.objPhysics.gravityX;
var _local8 = this.objPhysics.gravityY;
if (this.gravityCentreX != undefined) {
_local9 = this.gravityCentreX - this.clip.level.choppa._x;
_local8 = this.gravityCentreY - this.clip.level.choppa._y;
}
var _local10 = Maths.vectorLength(_local9, _local8);
if (_local10 == 0) {
_local10 = 1;
}
_local9 = _local9 / _local10;
_local8 = _local8 / _local10;
thrustX = _local9 * (-this.idleLift);
thrustY = _local8 * (-this.idleLift);
if (Key.isDown(Keys.CursorUp) || (Key.isDown(Keys.W))) {
thrustY = thrustY - this.throttleLift;
}
if (Key.isDown(Keys.CursorDown) || (Key.isDown(Keys.S))) {
thrustY = thrustY + (this.throttleLiftLow / 2);
}
if (Key.isDown(Keys.CursorLeft) || (Key.isDown(Keys.A))) {
thrustX = thrustX - this.throttleLiftLow;
}
if (Key.isDown(Keys.CursorRight) || (Key.isDown(Keys.D))) {
thrustX = thrustX + this.throttleLiftLow;
}
thrustX = thrustX / 3;
thrustY = thrustY / 3;
this.mCockpit.extForceX = this.mCockpit.extForceX + thrustX;
this.mCockpit.extForceY = this.mCockpit.extForceY + thrustY;
this.mTail.extForceX = this.mTail.extForceX + thrustX;
this.mTail.extForceY = this.mTail.extForceY + thrustY;
var _local6 = 0;
var _local16 = Maths.dotProduct(_local9, _local8, -_local11, _local12);
_local6 = _local6 + ((5 * _local16) + (0.5 * this.choppaRotationSpeed));
if (Key.isDown(Keys.CursorLeft) || (Key.isDown(Keys.A))) {
_local6 = _local6 + 1;
}
if (Key.isDown(Keys.CursorRight) || (Key.isDown(Keys.D))) {
_local6 = _local6 - 1;
}
if (Key.isDown(Keys.Z) || (Key.isDown(Keys.Y))) {
_local6 = _local6 + 3;
} else {
this.leftCount = 0;
}
if (Key.isDown(Keys.X)) {
_local6 = _local6 - 3;
} else {
this.rightCount = 0;
}
this.mCockpit.extForceX = this.mCockpit.extForceX + ((_local12 * _local6) * this.torque);
this.mCockpit.extForceY = this.mCockpit.extForceY + ((_local11 * _local6) * this.torque);
this.mTail.extForceX = this.mTail.extForceX - ((_local12 * _local6) * this.torque);
this.mTail.extForceY = this.mTail.extForceY - ((_local11 * _local6) * this.torque);
this.bladeFrames--;
if (this.bladeFrames <= 0) {
this.bladeFrames = 6;
if ((((((((Key.isDown(Keys.CursorUp) || (Key.isDown(Keys.W))) || (Key.isDown(Keys.CursorDown))) || (Key.isDown(Keys.S))) || (Key.isDown(Keys.CursorLeft))) || (Key.isDown(Keys.A))) || (Key.isDown(Keys.CursorRight))) || (Key.isDown(Keys.D))) || (Keys.mouseDown())) {
this.bladeFrames = 4;
}
_root.objSounds.play("blade");
}
if (this.winchState == "deployed") {
if (this.sWinchC.currentExtension() > this.winchStrength) {
this.toggleWinch();
}
}
this.objectsEnterFrame();
this.objPhysics.step();
this.paint();
this.choppaRotationSpeed = (this.clip.level.choppa._rotation + 1000) - (this.prevChoppaRotation + 1000);
if (this.choppaRotationSpeed > 20) {
this.choppaRotationSpeed = 20;
}
if (this.choppaRotationSpeed < -20) {
this.choppaRotationSpeed = -20;
}
this.choppaSpeed = Maths.vectorLength(this.clip.level.choppa._x - this.prevChoppaX, this.clip.level.choppa._y - this.prevChoppaY);
if ((this.choppaSpeed > 18) && (!this.saidSpeedy)) {
this.speedyFrames++;
if (this.speedyFrames == 10) {
_root.objSounds.play("slowdown");
this.saidSpeedy = true;
}
} else {
this.speedyFrames = 0;
}
var _local7 = 0;
if (this.mCockpit.hasHitSurface) {
var _local14 = Maths.vectorLength(this.mCockpit.collisionNormal.x, this.mCockpit.collisionNormal.y);
if (_local14 > _local7) {
_local7 = _local14;
}
}
if (this.mTail.hasHitSurface) {
var _local14 = Maths.vectorLength(this.mTail.collisionNormal.x, this.mTail.collisionNormal.y);
if (_local14 > _local7) {
_local7 = _local14;
}
}
if (this.perfect && (_local7 > 0.1)) {
this.interfaceClip.perfect.lamp.gotoAndStop("off");
_root.objSounds.play("imperfect");
this.perfect = false;
}
if (this.frame == _root.arrLevels[_root.curLevelID].par) {
_root.objSounds.play("nonfast");
this.interfaceClip.fast.lamp.gotoAndStop("off");
}
if (_local7 > this.robustness) {
if (_root.curLevelID == 19) {
pauseObjects(this);
}
_root.objSounds.play("fail");
if (_root.music.playing) {
_root.music.stop();
_root.music.setLoop("fail");
_root.music.start();
}
this.state = "crashed";
this.clip.crashPanel.fadeIn(0.8);
this.clip.crashPanel.btn.objGame = this;
this.clip.crashPanel.btn.onRelease = function () {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("picklevel");
Key.removeListener(this);
this.onRelease = undefined;
this.onRollOver = undefined;
};
this.clip.crashPanel.btn.onRollOver = function () {
_root.objSounds.play("rollover-tock");
};
return(undefined);
}
if ((this.frame % 3) == 0) {
this.path.splice(0, 1);
this.path.push({x1:this.clip.level.choppa._x, y1:this.clip.level.choppa._y, x2:this.prevChoppaX, y2:this.prevChoppaY});
}
var _local5 = this.clip.level.linePath;
_local5.clear();
var _local4 = 0;
while (_local4 < this.pathSegs) {
var _local3 = this.path[_local4];
_local5.lineStyle(2, 16777215, Math.min(100, 5 * _local4));
_local5.moveTo(_local3.x1, _local3.y1);
_local5.lineTo(_local3.x2, _local3.y2);
_local4++;
}
break;
case "crashed" :
Mouse.show();
this.clip.level.choppa.stop();
this.objectsEnterFrame();
this.objPhysics.step();
this.paint();
if (Key.isDown(Keys.Enter)) {
this.clip.crashPanel.btn.onRelease();
}
break;
case "completed" :
if (Key.isDown(Keys.Enter)) {
this.clip.winPanel.btn.onRelease();
}
Mouse.show();
break;
default :
trace("Undefined state: " + this.state);
}
var _local13 = (this.mCockpit.vx + this.mTail.vx) / 2;
var _local17 = (this.mCockpit.vy + this.mTail.vy) / 2;
this.clip.screenCentre._x = this.screenCentreX - (10 * _local13);
this.clip.screenCentre._y = (this.screenCentreY - (10 * _local17)) + this.clip.screenCentre.winchOffset._y;
if (this.state == "flight") {
if ((_local13 < -0.3) && (this.chopperDir != "left")) {
this.chopperDir = "left";
this.clip.level.choppa.gotoAndPlay(this.chopperColour + "_left");
}
if ((_local13 > 0.3) && (this.chopperDir != "right")) {
this.chopperDir = "right";
this.clip.level.choppa.gotoAndPlay(this.chopperColour + "_right");
}
}
var _local15 = this.clip.level.choppa.holderToLocal(this.clip.screenCentre);
this.clip.level._x = this.clip.level._x - (_local15.x / 6);
this.clip.level._y = this.clip.level._y - (_local15.y / 6);
this.prevChoppaRotation = this.clip.level.choppa._rotation;
this.prevChoppaX = this.clip.level.choppa._x;
this.prevChoppaY = this.clip.level.choppa._y;
};
ChoppaGame.prototype.objectsEnterFrame = function () {
var _local6 = this.clip.level.choppa.winch.holderToLocal(this.clip.level.physics);
this.mWinchA.x = _local6.x;
this.mWinchA.y = _local6.y;
var _local4 = 0;
while (_local4 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local4];
if (_local3.soundFrames > 0) {
_local3.soundFrames--;
if (_local3.soundFrames <= 0) {
_local3.soundFrames = undefined;
}
}
if (((_local3.collisionSound && (_local3.hasHitSurface)) && (_local3.soundFrames == undefined)) && ((_local3.collisionNormal.x > 1) || (_local3.collisionNormal.y > 1))) {
var _local5 = Maths.vectorLength(_local3.collisionNormal.x, _local3.collisionNormal.y);
_root.objSounds.play(_local3.collisionSound, Math.min(100, _local5 * 5));
_local3.soundFrames = 10;
}
_local4++;
}
stageObjectsEnterFrame(this);
};
ChoppaGame.prototype.alignGravityMark = function (clip) {
var _local3 = this.clip.level.choppa._x - this.clip.level.b0._x;
var _local2 = this.clip.level.choppa._y - this.clip.level.b0._y;
var _local4 = Math.atan2(_local2, _local3);
var _local5 = Maths.radToDeg(_local4) + Maths.randomNum(-30, 30);
clip._rotation = _local5;
};
ChoppaGame.prototype.paint = function () {
this.clip.level.drawing.clear();
var _local6 = this.slChassis.getPosition();
this.clip.level.choppa._x = _local6.x;
this.clip.level.choppa._y = _local6.y;
this.clip.level.choppa._rotation = _local6.rDeg + this.choppaRotationOffset;
this.clip.level.choppa.slamdunk._rotation = -this.clip.level.choppa._rotation;
stageObjectsPaint(this);
if (this.winchState == "deployed") {
_local6 = this.clip.level.choppa.winch.holderToLocal(this.clip.level.drawing);
this.clip.level.chainA._visible = true;
this.clip.level.chainB._visible = true;
this.clip.level.magnet._visible = true;
var _local4;
var _local3;
var _local2;
var _local5;
this.clip.level.chainA._x = this.mWinchA.x;
this.clip.level.chainA._y = this.mWinchA.y;
_local4 = this.mWinchB.x - this.mWinchA.x;
_local3 = this.mWinchB.y - this.mWinchA.y;
_local2 = Maths.vectorLength(_local4, _local3);
_local5 = Math.atan2(_local3, _local4);
this.clip.level.chainA._xscale = _local2;
this.clip.level.chainA._rotation = Maths.radToDeg(_local5);
this.clip.level.chainB._x = this.mWinchB.x;
this.clip.level.chainB._y = this.mWinchB.y;
_local4 = this.mWinchC.x - this.mWinchB.x;
_local3 = this.mWinchC.y - this.mWinchB.y;
_local2 = Maths.vectorLength(_local4, _local3);
_local5 = Math.atan2(_local3, _local4);
this.clip.level.chainB._xscale = _local2;
this.clip.level.chainB._rotation = Maths.radToDeg(_local5);
_local4 = this.sWinchC.mass2.x - this.mWinchC.x;
_local3 = this.sWinchC.mass2.y - this.mWinchC.y;
_local2 = Maths.vectorLength(_local4, _local3);
_local5 = Math.atan2(_local3, _local4);
if (this.mWinchD != this.sWinchC.mass2) {
_local2 = _local2 - this.sWinchC.mass2.radius;
}
this.clip.level.magnet._rotation = Maths.radToDeg(_local5);
this.clip.level.magnet._x = this.mWinchC.x + ((_local2 - 22) * Math.cos(_local5));
this.clip.level.magnet._y = this.mWinchC.y + ((_local2 - 22) * Math.sin(_local5));
this.clip.level.magnet.link._visible = ((_local2 > 24) ? true : false);
this.clip.level.magnet.longLink._visible = ((_local2 > 50) ? true : false);
if (this.sWinchC.mass2.removed) {
this.toggleWinch();
}
}
};
ChoppaGame.prototype.createExplosion = function (x, y, force, forceRange) {
_root.objSounds.play("boom");
var _local12 = this.clip.level.drawing.getNextHighestDepth();
this.clip.level.drawing.attachMovie("explosion", "explosion" + _local12, _local12);
var _local13 = this.clip.level.drawing["explosion" + _local12];
_local13._x = x;
_local13._y = y;
var _local7 = 0;
while (_local7 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local7];
if (_local3.fixed) {
} else {
var _local6 = x - _local3.x;
var _local5 = y - _local3.y;
var _local4 = Maths.vectorLength(_local6, _local5);
_local6 = _local6 / _local4;
_local5 = _local5 / _local4;
if (_local4 < forceRange) {
_local3.vx = _local3.vx - (force * _local6);
_local3.vy = _local3.vy - (force * _local5);
}
}
_local7++;
}
};
ChoppaGame.prototype.onKeyUp = function () {
switch (Key.getCode()) {
case 13 :
case 32 :
switch (this.state) {
case "flight" :
this.toggleWinch();
break;
case "completed" :
case "crashed" :
}
}
};
ChoppaGame.prototype.toggleWinch = function () {
if (this.state != "flight") {
return(undefined);
}
switch (this.winchState) {
case "idle" :
this.usedWinch = true;
this.winchState = "deployed";
_root.objSounds.play("chain-drop");
this.clip.screenCentre.winchOffset.slideTo(0, -60, 2.5, "easeInOutSine");
var _local5 = this.clip.level.choppa.winch.holderToLocal(this.clip.level.physics);
var _local4 = this.clip.level.choppa.pulley.holderToLocal(this.clip.level.physics);
this.mWinchA = new Mass(_local5.x, _local5.y, 5, true, this.objPhysics, -1);
this.mWinchB = new Mass(_local4.x, _local4.y, 5, false, this.objPhysics, -1);
this.mWinchC = new Mass(_local5.x, _local5.y, 5, false, this.objPhysics, -1);
this.mWinchD = new Mass(_local4.x, _local4.y, 5, false, this.objPhysics, -1);
this.sWinchA = new Spring(this.mWinchA, this.mWinchB, this.objPhysics, 0.5, 0.7);
this.sWinchB = new Spring(this.mWinchB, this.mWinchC, this.objPhysics, 0.5, 0.7);
this.sWinchC = new Spring(this.mWinchC, this.mWinchD, this.objPhysics, 0.5, 0.7);
this.mWinchD.objGame = this;
this.mWinchD.collisionCallback = function (otherMass) {
if (otherMass.isNotWinchable) {
return(undefined);
}
if (otherMass.isBomb) {
if (otherMass.isThrown) {
_root.achieved(11);
}
}
otherMass.shadowClip.filters = this.objGame.clip.level.choppa.filters;
_root.objSounds.play("magnet");
this.objGame.sWinchC.removeSpring();
this.objGame.sWinchC = new Spring(this.objGame.mWinchC, otherMass, this.objGame.objPhysics, 0.5, 0.7);
var _local4 = otherMass.radius + 20;
if (this.objGame.sWinchC.naturalLength < _local4) {
this.objGame.sWinchC.naturalLength = _local4;
}
this.removeMass();
};
break;
case "deployed" :
this.winchState = "idle";
this.clip.level.chainA._visible = false;
this.clip.level.chainB._visible = false;
this.clip.level.magnet._visible = false;
_root.objSounds.play("chain-retract");
this.clip.screenCentre.winchOffset.slideTo(0, 0, 1, "easeInOutSine");
this.sWinchC.mass2.shadowClip.filters = [];
var _local3 = this.sWinchC.mass2;
if (_local3.isBomb) {
_local3.isThrown = true;
}
_local3.clip.droppedAtX = _local3.clip._x;
_local3.clip.droppedAtY = _local3.clip._y;
this.mWinchD.removeMass();
this.mWinchC.removeMass();
this.mWinchB.removeMass();
this.mWinchA.removeMass();
}
};
ChoppaGame.prototype.levelComplete = function (goalItem) {
var _local5 = 0;
pauseObjects(this);
_root.popup.gotoAndPlay("in");
var _local10 = this.clip.level.flag.suckPoint.holderToLocal(this.clip.level);
goalItem.slideTo(_local10.x, _local10.y, 0.5, "easeInQuad");
goalItem.fadeOut(0.2, "easeOutQuart", 0.3);
_root.objSounds.play("deliverytube");
trace(((("Completed level " + _root.curLevelID) + " in ") + this.frame) + " frames");
var _local9 = false;
if (this.frame < _root.arrLevels[_root.curLevelID].par) {
_local9 = true;
}
if (_root.music.playing) {
_root.music.stop();
_root.music.setLoop("win");
_root.music.start();
}
passedLevel(_root.curLevelID, this.perfect, _local9, this.frame);
var _local8 = 0;
var _local6 = 0;
var _local7 = 0;
var _local3 = 0;
while (_local3 < _root.arrLevels.length) {
if (_root.arrLevels[_local3].passed) {
_local8++;
}
if (_root.arrLevels[_local3].perfect) {
_local6++;
}
if (_root.arrLevels[_local3].fast) {
_local7++;
}
_local3++;
}
if (_local6 >= 1) {
_local5 = _local5 + _root.achieved(1);
}
if (_local6 >= 15) {
_local5 = _local5 + _root.achieved(4);
}
if (_local6 >= 20) {
_local5 = _local5 + _root.achieved(6);
}
if (_local7 >= 1) {
_local5 = _local5 + _root.achieved(2);
}
if (_local7 >= 15) {
_local5 = _local5 + _root.achieved(5);
}
if (_local7 >= 20) {
_local5 = _local5 + _root.achieved(7);
}
if (_local8 >= 20) {
_local5 = _local5 + _root.achieved(13);
}
this.state = "completed";
pauseObjects(this);
this.clip.winPanel.fadeIn(0.8);
this.clip.winPanel.btn.objGame = this;
this.clip.winPanel.btn.onRelease = function () {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("picklevel");
_root.popup.gotoAndPlay("out");
Key.removeListener(this);
this.onRelease = undefined;
this.onRollOver = undefined;
};
this.clip.winPanel.btn.onRollOver = function () {
_root.objSounds.play("rollover-tock");
};
if (this.perfect) {
trace(" Perfect!");
this.clip.perfectPanel.fadeIn(1.5);
}
if (_local9) {
trace(" Fast!");
this.clip.fastPanel.fadeIn(1.5);
}
if (this.perfect && (_local9)) {
_local5 = _local5 + _root.achieved(3);
}
var _local11 = Maths.distance(goalItem._x, goalItem._y, goalItem.prevX, goalItem.prevY);
if (_local11 > 15) {
_local5 = _local5 + achieved(8);
}
var _local12 = Maths.distance(goalItem._x, goalItem._y, goalItem.droppedAtX, goalItem.droppedAtY);
if ((goalItem.droppedAtX != undefined) && (_local12 > 350)) {
_local5 = _local5 + achieved(9);
}
trace((("Final slamdunk status: " + goalItem.slamdunkLeft) + " ") + goalItem.slamdunkRight);
if ((goalItem.slamdunkLeft == 3) || (goalItem.slamdunkRight == 3)) {
_local5 = _local5 + achieved(10);
}
if (_local5 == 0) {
_root.objSounds.play("win");
}
};
ChoppaGame.prototype.isTouchingMass = function (hitZone, property) {
var _local4 = 0;
while (_local4 < this.objPhysics.masses.length) {
var _local3 = this.objPhysics.masses[_local4];
if (_local3[property]) {
var _local2 = {x:_local3.x, y:_local3.y};
this.objPhysics.baseClip.localToGlobal(_local2);
if (hitZone.hitTest(_local2.x, _local2.y, true)) {
return(true);
}
}
_local4++;
}
return(false);
};
ChoppaGame.prototype.updateTimer = function (frame) {
var _local3 = this.interfaceClip.timer;
var _local4 = _root.getNeatTime(frame);
_local3.mTens.htmlText = ("<b>" + Math.floor(_local4.minutes / 10)) + "</b>";
_local3.mOnes.htmlText = ("<b>" + (_local4.minutes % 10)) + "</b>";
_local3.sTens.htmlText = "<b>" + Math.floor(_local4.seconds / 10);
_local3.sOnes.htmlText = ("<b>" + (_local4.seconds % 10)) + "</b>";
};
ChoppaGame.prototype.evt = function () {
};
initSounds();
_root.chopperColour = "red";
_root.seenChangeChopperScreen = 3;
frame._visible = false;
var music = new Music();
music.muted = false;
frame.togMusic.gotoAndStop("on");
frame.togSounds.gotoAndStop("on");
music.start();
startIntroPhysics(intro);
intro.onEnterFrame = function () {
if (Key.isDown(Keys.Enter) || (Key.isDown(Keys.Spacebar))) {
moveToMenu();
}
};
System.security.allowDomain("mochibot.com");
__com_mochibot__swfid = "6aeea6f0";
loadMovieNum ("http://mochibot.com/my/core.swf", 1);
mochi.as2.MochiServices.connect("77187883399ba134");
Frame 31
stop();
setupLevelIndicators(levels);
_root.objSounds.removeAllSources();
stopAllLoopingSounds();
frame._visible = true;
if (frame.nextTarget == undefined) {
frame.gotoAndPlay("levelselect_in");
}
popup.gotoAndStop("idle");
Frame 41
stop();
Frame 51
stop();
setupAchievements();
Frame 61
if (_root.allLevelsComplete) {
mochi.as2.MochiScores.showLeaderboard({boardID:"b1519c46ef5bf7f6", score:_root.totalMilliseconds});
} else {
mochi.as2.MochiScores.showLeaderboard({boardID:"b1519c46ef5bf7f6"});
}
Frame 62
stop();
_root.objTrans.goto("picklevel");
Frame 71
setupSelectChopperScreen();
_root.seenChangeChopperScreen = 0;
Frame 81
stop();
var objGame = new ChoppaGame(game);
music.setLoop("game");
popup.gotoAndStop("idle");
Frame 91
play();
Frame 92
_root.objTrans.curFrame = "game";
gotoAndStop ("game");
Symbol 36 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 11
var bmpSnap = (new flash.display.BitmapData(640, 480, false, 0));
_root.frame._visible = false;
bmpSnap.draw(_root);
_root.frame._visible = true;
snap.holder.attachBitmap(bmpSnap, 0, true, false);
_root.objSounds.play("transition");
if ((_root.objTrans.goingTo != "restart") && (_root.objTrans.curFrame == "game")) {
_root.music.setLoop("menu");
_root.frame.gotoAndPlay("game_out");
}
Symbol 36 MovieClip Frame 12
stop();
Symbol 36 MovieClip Frame 20
var bmpDisplacer = (new flash.display.BitmapData(640, 480, false, 8421504));
this.snap.onEnterFrame = function () {
bmpDisplacer.draw(displacer);
var _local2 = new flash.filters.DisplacementMapFilter(bmpDisplacer, new flash.geom.Point(0, 0), 1, 2, 100, 20, "wrap");
this.filters = [_local2];
};
Symbol 36 MovieClip Frame 41
snap.onEnterFrame = undefined;
snap.filters = [];
bmpDisplacer.dispose();
bmpSnap.dispose();
stop();
Symbol 39 MovieClip Frame 1
stop();
Symbol 39 MovieClip Frame 25
this.transFunc();
Symbol 1297 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 1298 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.3r1 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 1299 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 1300 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 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 1301 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 1302 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.0");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local3 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servicesURL != undefined) {
_servicesURL = urlOptions().servicesURL;
}
allowDomains(_servicesURL);
_clip = clip.createEmptyMovieClip(_local3, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip((((_servicesURL + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
if (_root.mochiad_options) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static var _servicesURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
}
Symbol 1303 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if ((options.clip == null) || (options.clip == undefined)) {
options.clip = mochi.as2.MochiServices.clip;
}
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 1304 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 44 MovieClip [explosion] Frame 9
this.removeMovieClip();
Symbol 163 MovieClip Frame 1
stop();
Symbol 204 MovieClip Frame 1
stop();
Symbol 204 MovieClip Frame 25
_root.objSounds.play("achievement");
Symbol 204 MovieClip Frame 115
gotoAndStop ("idle");
Symbol 206 Button
on (release) {
_root.objSounds.play("rollover-tick");
moveToMenu();
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 209 Button
on (release) {
getURL ("http://www.crackingideas.com", "_blank");
}
Symbol 213 MovieClip Frame 1
System.security.allowDomain("crackingideas.com");
System.security.allowDomain("www.crackingideas.com");
popupAd.loadMovie(_root.baseURL + "popup.swf");
Symbol 214 MovieClip Frame 1
stop();
Symbol 214 MovieClip Frame 30
stop();
Symbol 238 MovieClip Frame 1
stop();
Symbol 240 Button
on (release) {
if (_root.music.muted) {
_root.music.muted = false;
_root.music.start();
togMusic.gotoAndStop("on");
_root.objSounds.play("switch2");
} else {
_root.music.muted = true;
_root.music.stop();
togMusic.gotoAndStop("off");
_root.objSounds.play("switch1");
}
}
Symbol 241 Button
on (release) {
if (_root.objSounds.muted) {
_root.objSounds.setMute(false);
togSounds.gotoAndStop("on");
_root.objSounds.play("switch1");
if (!_root.music.muted) {
_root.music.start();
}
} else {
togSounds.gotoAndStop("off");
_root.objSounds.play("switch2");
_root.objSounds.setMute(true);
}
}
Symbol 257 MovieClip Frame 1
stop();
Symbol 280 Button
on (release) {
_root.objSounds.play("rollover-tick");
Key.removeListener(_root.objGame);
_root.objTrans.goto("restart");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 284 Button
on (release) {
_root.objSounds.play("rollover-tick");
Key.removeListener(_root.objGame);
_root.objTrans.goto("picklevel");
_root.frame.nextTarget = "levelselect_in";
_root.frame.gotoAndPlay("game_out");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 287 Button
on (release) {
_root.objTrans.goto("selectchopper");
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("achievements");
_root.frame.nextTarget = "chopperselect_in";
_root.frame.gotoAndPlay("levelselect_out");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 290 Button
on (release) {
_root.objTrans.goto("wipeprogress");
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("achievements");
_root.frame.gotoAndPlay("levelselect_out");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 295 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("achievements");
_root.frame.gotoAndPlay("levelselect_out");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 300 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.transToGame();
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 305 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("highscores");
_root.frame.gotoAndPlay("levelselect_out");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 310 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("picklevel");
_root.frame.nextTarget = "levelselect_in";
_root.frame.gotoAndPlay("chopperselect_out");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 311 MovieClip Frame 1
stop();
this.nextTarget = undefined;
Symbol 311 MovieClip Frame 11
this.nextTarget = undefined;
fast.txt.htmlText = _root.parTime;
Symbol 311 MovieClip Frame 31
stop();
Symbol 311 MovieClip Frame 58
if (this.nextTarget != undefined) {
gotoAndPlay(this.nextTarget);
} else {
gotoAndStop ("idle");
}
Symbol 311 MovieClip Frame 59
this.nextTarget = undefined;
Symbol 311 MovieClip Frame 73
stop();
Symbol 311 MovieClip Frame 96
if (this.nextTarget != undefined) {
gotoAndPlay(this.nextTarget);
} else {
gotoAndStop ("idle");
}
Symbol 311 MovieClip Frame 97
this.nextTarget = undefined;
Symbol 311 MovieClip Frame 108
stop();
Symbol 311 MovieClip Frame 128
if (this.nextTarget != undefined) {
gotoAndPlay(this.nextTarget);
} else {
gotoAndStop ("idle");
}
Symbol 314 MovieClip Frame 1
gotoAndStop ("hide");
Symbol 314 MovieClip Frame 65
gotoAndStop ("hide");
Symbol 332 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 336 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 346 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 347 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 357 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 358 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 368 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 369 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 379 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 380 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 393 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 394 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 399 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 400 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 410 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 411 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 421 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 422 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 432 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 433 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 443 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 444 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 452 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 453 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 458 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 459 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 469 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 470 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 480 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 481 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 486 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 487 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 492 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 493 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 498 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 499 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 504 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 505 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 510 Button
on (release) {
_root.objSounds.play("rollover-tick");
gotoAndStop ("selected");
}
on (rollOver) {
_root.rollOverLevel(this.id);
_root.objSounds.play("rollover-tock");
}
on (rollOut, dragOut) {
_root.rollOutLevel(this.id);
}
Symbol 511 MovieClip Frame 21
_root.deselectLevels(this.id);
Symbol 541 MovieClip Frame 11
stop();
Symbol 541 MovieClip Frame 91
_root.seenChangeChopperScreen--;
Symbol 541 MovieClip Frame 108
_root.changeChopperHintFlash.gotoAndPlay("show");
Symbol 541 MovieClip Frame 198
gotoAndStop ("hide");
Symbol 546 Button
on (release) {
_root.arrLevels = undefined;
_root.arrAchievements = undefined;
var objSO = SharedObject.getLocal("wallaceandgromitipo");
objSO.data.arrLevels = undefined;
objSO.data.arrAchievements = undefined;
objSO.flush();
_root.workingOnLevel = undefined;
_root.objTrans.goto("intro");
}
Symbol 550 Button
on (release) {
_root.objTrans.goto("picklevel");
}
Symbol 561 MovieClip Frame 1
stop();
Symbol 563 Button
on (release) {
_root.objSounds.play("rollover-tick");
_root.objTrans.goto("picklevel");
}
Symbol 776 Button
on (release) {
_root.objSounds.play("rollover-tick");
selectChopper("red");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 777 Button
on (release) {
_root.objSounds.play("rollover-tick");
selectChopper("cream");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 778 Button
on (release) {
_root.objSounds.play("rollover-tick");
selectChopper("orange");
}
on (rollOver) {
_root.objSounds.play("rollover-tock");
}
Symbol 939 MovieClip Frame 2
stop();
Symbol 939 MovieClip Frame 12
stop();
Symbol 939 MovieClip Frame 22
stop();
Symbol 939 MovieClip Frame 32
stop();
Symbol 939 MovieClip Frame 42
stop();
Symbol 939 MovieClip Frame 52
stop();
Symbol 959 MovieClip Frame 5
stop();
Symbol 960 MovieClip Frame 1
stop();
Symbol 964 MovieClip Frame 1
stop();
Symbol 964 MovieClip Frame 11
_root.objSounds.play("door-open");
Symbol 964 MovieClip Frame 36
stop();
Symbol 992 MovieClip Frame 1
gotoAndStop(_root.Maths.randomInt(2, this._totalframes));
Symbol 1041 MovieClip Frame 1
_root.objSounds.play("glass-smash");
Symbol 1041 MovieClip Frame 11
stop();
Symbol 1042 MovieClip Frame 1
stop();
Symbol 1055 MovieClip Frame 1
stop();
Symbol 1090 MovieClip Frame 51
_root.objSounds.play("sewerflood");
Symbol 1090 MovieClip Frame 221
_root.objSounds.play("sewerflood");
Symbol 1096 MovieClip Frame 1
stop();
Symbol 1122 MovieClip Frame 1
stop();
Symbol 1122 MovieClip Frame 71
_root.objSounds.play("bomb-armed");
Symbol 1122 MovieClip Frame 101
_root.objSounds.play("bomb-tick", 100, true);
Symbol 1122 MovieClip Frame 610
stop();
this.explode();
_root.objSounds.stop("bomb-tick");
Symbol 1129 MovieClip Frame 1
stop();
this.reset();
Symbol 1129 MovieClip Frame 11
_root.objSounds.play("sewerflood");
Symbol 1129 MovieClip Frame 371
_root.objSounds.play("sewerflood");
Symbol 1146 MovieClip Frame 1
stop();
Symbol 1146 MovieClip Frame 11
_root.objSounds.play("door-open");
Symbol 1146 MovieClip Frame 31
stop();
Symbol 1146 MovieClip Frame 41
_root.objSounds.play("door-close");
Symbol 1173 MovieClip Frame 1
stop();
Symbol 1176 MovieClip Frame 1
stop();
Symbol 1176 MovieClip Frame 71
_root.objSounds.play("bomb-armed");
Symbol 1176 MovieClip Frame 101
_root.objSounds.play("bomb-tick", 100, true);
Symbol 1176 MovieClip Frame 610
stop();
this.explode();
_root.objSounds.stop("bomb-tick");
Symbol 1207 MovieClip Frame 1
stop();
this.fuseRunning = false;
Symbol 1207 MovieClip Frame 11
_root.objSounds.play("fuse", 100, true);
this.fuseRunning = true;
Symbol 1207 MovieClip Frame 610
stop();
_root.objSounds.stop("fuse");
this.explode();
Symbol 1216 MovieClip Frame 1
this._rotation = _root.Maths.randomInt(1, 360);
Symbol 1216 MovieClip Frame 7
stop();
Symbol 1236 MovieClip Frame 1
this.dr = 0;
this.onEnterFrame = function () {
this.wheel._rotation = this.wheel._rotation + this.dr;
};
Symbol 1247 MovieClip Frame 20
stop();
Symbol 1249 MovieClip Frame 1
stop();
this.hit._visible = false;
Symbol 1249 MovieClip Frame 90
this.state = "off";
this.gotoAndStop("off");
this.circuitDeactivated();
Symbol 1259 MovieClip Frame 1
stop();
Instance of Symbol 960 MovieClip "b3" in Symbol 1263 MovieClip Frame 3
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[19];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door3.gotoAndPlay("open");
};
}
Instance of Symbol 960 MovieClip "b0" in Symbol 1263 MovieClip Frame 3
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[16];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door0.gotoAndPlay("open");
};
}
Instance of Symbol 960 MovieClip "b1" in Symbol 1263 MovieClip Frame 3
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[17];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door1.gotoAndPlay("open");
};
}
Instance of Symbol 960 MovieClip "b2" in Symbol 1263 MovieClip Frame 3
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[18];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door2.gotoAndPlay("open");
};
}
Instance of Symbol 960 MovieClip "b0" in Symbol 1263 MovieClip Frame 4
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door0.gotoAndPlay("open");
};
}
Instance of Symbol 960 MovieClip "b1" in Symbol 1263 MovieClip Frame 4
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[1];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door1.gotoAndPlay("open");
};
}
Instance of Symbol 1011 MovieClip "b3" in Symbol 1263 MovieClip Frame 5
onClipEvent (load) {
this.stopped = true;
this.fanStrength = 0.7;
}
Instance of Symbol 1015 MovieClip "b2" in Symbol 1263 MovieClip Frame 5
onClipEvent (load) {
this.fanStrength = 0.7;
}
Instance of Symbol 960 MovieClip "b0" in Symbol 1263 MovieClip Frame 5
onClipEvent (load) {
this.gotoAndStop("on");
this.state = "on";
this.evtTriggered = function () {
this._parent.b1.gotoAndStop("off");
this._parent.b1.state = "off";
this._parent.b1.hit._visible = false;
this._parent.b2.stopped = false;
this._parent.b3.stopped = true;
};
}
Instance of Symbol 960 MovieClip "b1" in Symbol 1263 MovieClip Frame 5
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.b0.gotoAndStop("off");
this._parent.b0.state = "off";
this._parent.b0.hit._visible = false;
this._parent.b2.stopped = true;
this._parent.b3.stopped = false;
};
}
Instance of Symbol 1017 MovieClip "b5" in Symbol 1263 MovieClip Frame 5
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (!this.active) {
return(undefined);
}
if (objMass.isChoppa) {
_root.objSounds.play("attention");
this.active = false;
}
};
}
Instance of Symbol 1017 MovieClip "b2" in Symbol 1263 MovieClip Frame 6
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (!this.active) {
return(undefined);
}
if (objMass.isChoppa) {
_root.objSounds.play("caution");
this.active = false;
}
};
}
Instance of Symbol 1042 MovieClip "b2" in Symbol 1263 MovieClip Frame 7
onClipEvent (load) {
this.strength = 2;
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtBroken = function () {
if (this._parent._parent.objGame.usedWinch == false) {
_root.achieved(12);
}
this.surface.removeSurface();
};
}
Instance of Symbol 1017 MovieClip "b3" in Symbol 1263 MovieClip Frame 7
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (!this.active) {
return(undefined);
}
if (objMass.isChoppa) {
_root.objSounds.play("attention");
this.active = false;
}
};
}
Instance of Symbol 1053 MovieClip "b4" in Symbol 1263 MovieClip Frame 8
onClipEvent (load) {
this.fanStrength = 0.7;
}
Instance of Symbol 1053 MovieClip "b3" in Symbol 1263 MovieClip Frame 8
onClipEvent (load) {
this.fanStrength = 0.9;
}
Instance of Symbol 960 MovieClip "b0" in Symbol 1263 MovieClip Frame 8
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door0.fadeOut(0.5);
_root.objSounds.play("door-open");
};
}
Instance of Symbol 960 MovieClip "b1" in Symbol 1263 MovieClip Frame 8
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[1];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door1.fadeOut(0.5);
_root.objSounds.play("door-open");
};
}
Instance of Symbol 960 MovieClip "b0" in Symbol 1263 MovieClip Frame 10
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door0.gotoAndPlay("open");
};
}
Instance of Symbol 1083 MovieClip "b3" in Symbol 1263 MovieClip Frame 10
onClipEvent (load) {
this.angleChanged = function (dr) {
this._parent.gear1._rotation = this._parent.gear1._rotation - (1 * dr);
this._parent.gear2._rotation = this._parent.gear2._rotation + (0.5 * dr);
this._parent.gear3._rotation = this._parent.gear3._rotation - (0.5 * dr);
this._parent.gear4._rotation = this._parent.gear4._rotation + (1 * dr);
this._parent.b2.w0._rotation = this._parent.b2.w0._rotation + (2 * dr);
this._parent.b2.w1._rotation = this._parent.b2.w1._rotation + (2 * dr);
this._parent.b2.w2._rotation = this._parent.b2.w2._rotation + (2 * dr);
this._parent.b2.w3._rotation = this._parent.b2.w3._rotation + (2 * dr);
this._parent.b2.w4._rotation = this._parent.b2.w4._rotation + (2 * dr);
this._parent.b2.w5._rotation = this._parent.b2.w5._rotation + (2 * dr);
this._parent.b2.w6._rotation = this._parent.b2.w6._rotation + (2 * dr);
this._parent.b2.w7._rotation = this._parent.b2.w7._rotation + (2 * dr);
this._parent.b2.w8._rotation = this._parent.b2.w8._rotation + (2 * dr);
this._parent.b2.w9._rotation = this._parent.b2.w9._rotation + (2 * dr);
this._parent.b2.dr = 0.05 * dr;
};
}
Instance of Symbol 1096 MovieClip "b0" in Symbol 1263 MovieClip Frame 12
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door0.gotoAndPlay("open");
};
}
Instance of Symbol 1017 MovieClip "b3" in Symbol 1263 MovieClip Frame 12
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (!this.active) {
return(undefined);
}
if (objMass.isChoppa) {
_root.objSounds.play("attention");
this.active = false;
}
};
}
Instance of Symbol 1122 MovieClip "b1" in Symbol 1263 MovieClip Frame 13
onClipEvent (load) {
this._parent.doorExplosionHit._visible = false;
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtExploded = function () {
_root.objSounds.stop("bomb-tick");
this.stop();
var _local3 = this.holderToGlobal();
if (this._parent.doorExplosionHit.hitTest(_local3.x, _local3.y, true)) {
this.surface.removeSurface();
this._parent.door0.fadeOut(0.2);
this._parent.b0.objMass.vx = this._parent.b0.objMass.vx * 0.02;
this._parent.b0.objMass.vy = this._parent.b0.objMass.vy * 0.02;
} else {
this._root.objSounds.play("restart");
}
};
}
Instance of Symbol 1017 MovieClip "b2" in Symbol 1263 MovieClip Frame 13
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (!this.active) {
return(undefined);
}
if (objMass.isChoppa && (this._parent.b1.objMass.springs.length > 0)) {
this.active = false;
_root.objSounds.play("caution");
}
};
}
Instance of Symbol 1129 MovieClip "b2" in Symbol 1263 MovieClip Frame 14
onClipEvent (load) {
this.reset = function () {
this._parent.b1.gotoAndStop("off");
this._parent.b1.state = "off";
this._parent.b1.hit._visible = false;
};
}
Instance of Symbol 960 MovieClip "b1" in Symbol 1263 MovieClip Frame 14
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.b2.gotoAndPlay("flood");
};
}
Instance of Symbol 960 MovieClip "b0" in Symbol 1263 MovieClip Frame 15
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.gotoAndStop("on");
this.state = "on";
this.evtTriggered = function () {
this._parent.b1.gotoAndStop("off");
this._parent.b1.state = "off";
this._parent.b1.hit._visible = false;
this.surface.x1 = this.surface.x1 - 500;
this.surface.x2 = this.surface.x2 - 500;
this._parent.door0.gotoAndPlay("close");
this._parent.b3.activated = false;
this._parent.b3.lines.fadeOut(1);
this._parent.b3.gfx.rotor1.stop();
this._parent.b3.gfx.rotor2.stop();
};
}
Instance of Symbol 960 MovieClip "b1" in Symbol 1263 MovieClip Frame 15
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtTriggered = function () {
_root.objSounds.play("power-on");
this._parent.b0.gotoAndStop("off");
this._parent.b0.state = "off";
this._parent.b0.hit._visible = false;
this.surface.x1 = this.surface.x1 + 500;
this.surface.x2 = this.surface.x2 + 500;
this._parent.door0.gotoAndPlay("open");
this._parent.b3.activated = true;
this._parent.b3.lines.fadeIn(1);
this._parent.b3.gfx.rotor1.play();
this._parent.b3.gfx.rotor2.play();
};
}
Instance of Symbol 1159 MovieClip "b3" in Symbol 1263 MovieClip Frame 15
onClipEvent (load) {
this.strength = 500;
}
Instance of Symbol 1017 MovieClip "b2" in Symbol 1263 MovieClip Frame 16
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (!this.active) {
return(undefined);
}
if (objMass.isChoppa) {
_root.objSounds.play("caution");
this.active = false;
}
};
}
Instance of Symbol 960 MovieClip "b3" in Symbol 1263 MovieClip Frame 17
onClipEvent (load) {
this.evtTriggered = function () {
this._parent.b2.fireCannon();
};
}
Instance of Symbol 1176 MovieClip "b1" in Symbol 1263 MovieClip Frame 17
onClipEvent (load) {
this._parent.doorExplosionHit._visible = false;
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtExploded = function () {
_root.objSounds.stop("bomb-tick");
this.stop();
this._parent.b2.aimCannon();
var _local3 = this.holderToGlobal();
if (this._parent.doorExplosionHit.hitTest(_local3.x, _local3.y, true)) {
this.surface.removeSurface();
this._parent.door0.fadeOut(0.2);
this._parent.b0.objMass.vx = this._parent.b0.objMass.vx * 0.02;
this._parent.b0.objMass.vy = this._parent.b0.objMass.vy * 0.02;
}
};
}
Instance of Symbol 1017 MovieClip "b4" in Symbol 1263 MovieClip Frame 17
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (!this.active) {
return(undefined);
}
if (objMass.isChoppa) {
_root.objSounds.play("attention");
this.active = false;
}
};
}
Instance of Symbol 960 MovieClip "b4" in Symbol 1263 MovieClip Frame 18
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door0.gotoAndPlay("open");
};
}
Instance of Symbol 1017 MovieClip "b5" in Symbol 1263 MovieClip Frame 18
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (!this.active) {
return(undefined);
}
if (objMass.isChoppa) {
_root.objSounds.play("caution");
this.active = false;
}
};
}
Instance of Symbol 1207 MovieClip "b2" in Symbol 1263 MovieClip Frame 19
onClipEvent (load) {
this._parent.doorExplosionHit._visible = false;
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtExploded = function () {
var _local2 = this.holderToGlobal();
if (this._parent.doorExplosionHit.hitTest(_local2.x, _local2.y, true)) {
this.surface.removeSurface();
this._parent.door0.fadeOut(0.2);
this._parent.b0.objMass.vx = this._parent.b0.objMass.vx * 0.02;
this._parent.b0.objMass.vy = this._parent.b0.objMass.vy * 0.02;
} else {
this._root.objSounds.play("restart");
}
};
}
Instance of Symbol 1230 MovieClip "b5" in Symbol 1263 MovieClip Frame 19
onClipEvent (load) {
this._visible = false;
this.massTouching = function (objMass) {
if (!this.active) {
return(undefined);
}
if (objMass.isBomb && (!objMass.clip.fuseRunning)) {
this.active = false;
_root.objSounds.play("restart");
}
};
}
Instance of Symbol 960 MovieClip "b0" in Symbol 1263 MovieClip Frame 20
onClipEvent (load) {
this.surface = this._parent._parent.objGame.objPhysics.surfaces[0];
this.evtTriggered = function () {
this.surface.removeSurface();
this._parent.door0.fadeOut(0.5);
};
}
Instance of Symbol 1249 MovieClip "b1" in Symbol 1263 MovieClip Frame 20
onClipEvent (load) {
this.evtTriggered = function () {
this.gotoAndPlay("timer");
var _local11 = this.objGame.isTouchingMass(this._parent.b9.hit, "isLightbulb");
var _local10 = this.objGame.isTouchingMass(this._parent.b10.hit, "isLightbulb");
if (_local11 && (_local10)) {
var _local9 = this.objGame.isTouchingMass(this._parent.b11.hitL, "isBatteryPositive");
var _local3 = this.objGame.isTouchingMass(this._parent.b11.hitR, "isBatteryNegative");
var _local8 = this.objGame.isTouchingMass(this._parent.b11.hitR, "isBatteryPositive");
var _local5 = this.objGame.isTouchingMass(this._parent.b11.hitL, "isBatteryNegative");
var _local7 = this.objGame.isTouchingMass(this._parent.b6.hitL, "isBatteryPositive");
var _local4 = this.objGame.isTouchingMass(this._parent.b6.hitL, "isBatteryNegative");
var _local6 = this.objGame.isTouchingMass(this._parent.b6.hitR, "isBatteryPositive");
var _local2 = this.objGame.isTouchingMass(this._parent.b6.hitR, "isBatteryNegative");
if (((_local9 && (_local3)) && (_local7)) && (_local2)) {
this.circuitActivated(0.2);
}
if (((_local5 && (_local8)) && (_local4)) && (_local6)) {
this.circuitActivated(-0.2);
}
}
};
this.circuitActivated = function (dr) {
_root.objSounds.play("power-on");
this._parent.b3.dr = dr;
this._parent.b7.gotoAndStop("on");
this._parent.b8.gotoAndStop("on");
this.onEnterFrame = function () {
var _local2 = 50 * this._parent.b3.dr;
this._parent.motor.dr = 0.8 * _local2;
this._parent.b3.w0._rotation = this._parent.b3.w0._rotation + _local2;
this._parent.b3.w1._rotation = this._parent.b3.w1._rotation + _local2;
this._parent.b3.w2._rotation = this._parent.b3.w2._rotation + _local2;
this._parent.b3.w3._rotation = this._parent.b3.w3._rotation + _local2;
this._parent.b3.w4._rotation = this._parent.b3.w4._rotation + _local2;
this._parent.b3.w5._rotation = this._parent.b3.w5._rotation + _local2;
this._parent.b3.w6._rotation = this._parent.b3.w6._rotation + _local2;
this._parent.b3.w7._rotation = this._parent.b3.w7._rotation + _local2;
this._parent.b3.w8._rotation = this._parent.b3.w8._rotation + _local2;
this._parent.b3.w9._rotation = this._parent.b3.w9._rotation + _local2;
};
};
this.circuitDeactivated = function () {
this._parent.b3.dr = 0;
this._parent.b7.gotoAndStop("off");
this._parent.b8.gotoAndStop("off");
this._parent.motor.dr = 0;
this.onEnterFrame = undefined;
};
}