Frame 1
_root.typeFlag = "head";
_root.domain = "http://www.feedthehead.net";
_root.tabEnabled = false;
_root.tabChildren = false;
if (initFlag == undefined) {
initFlag = true;
this._lockroot = true;
reload = _parent.isReloading == true;
loadingMeter.reload = reload;
soundClip = createEmptyMovieClip("soundClip", -99);
soundClip.loadMovie("sounds.swf");
KeyListener.init();
}
function addResizeListener(obj) {
resizeListeners.push(obj);
}
function resize() {
return(resizeHandler.onResize());
}
resizeHandler = {};
var oWidth = 950;
var oHeight = 600;
_root.xMin = 0;
_root.yMin = 0;
_root.xMax = oWidth;
_root.yMax = oHeight;
resizeHandler.onResize = function () {
var _local3 = ViewMaster.getFrame();
_root.scale = 1;
var _local5 = _local3.x2 - _local3.x1;
var _local6 = _local3.y2 - _local3.y1;
var _local10 = Stage.width / _local5;
var _local7 = Stage.height / _local6;
_root.scale = Math.min(_local7, _local10);
if (_root.scale > 1) {
_root.scale = 1;
}
var _local9 = Stage.width - oWidth;
var _local8 = Stage.height - oHeight;
var _local12 = (_local3.x1 + _local3.x2) / 2;
_root.xReg = ((-_local9) / 2) - (_local3.x1 * _root.scale);
_root.yReg = ((-_local8) / 2) - (_local3.y1 * _root.scale);
_root.shiftX = (Stage.width / 2) - ((_root.scale * _local5) / 2);
_root.shiftY = (Stage.height / 2) - ((_root.scale * _local6) / 2);
_root.xMin = (-((Stage.width / _root.scale) - oWidth)) / 2;
_root.yMin = _local3.y1 + ((-shiftY) / _root.scale);
_root.xMax = _root.xMin + (Stage.width / _root.scale);
_root.yMax = oHeight;
var _local4 = resizeListeners.length;
var _local2 = _local4 - 1;
while (_local2 >= 0) {
if (resizeListeners[_local2].resize == undefined) {
resizeListeners.splice(_local2, 1);
} else {
resizeListeners[_local2].resize();
}
_local2--;
}
return({xMin:_root.xMin, yMin:_root.yMin, xMax:_root.xMax, yMax:_root.yMax, xReg:_root.xReg, yReg:_root.yReg, shiftX:_root.shiftX, shiftY:_root.shiftY, scale:_root.scale});
};
ViewMaster.resizeHandler = resizeHandler;
ViewMaster.init(createEmptyMovieClip("view", -98));
var resizeListeners = [];
Stage.scaleMode = "noScale";
_parent.resize();
function fadeInTitle() {
_parent.fadeInTitle();
}
function fadeOutTitle() {
_parent.fadeOutTitle();
}
Frame 2
if (loadingMeter.isReady()) {
fadeInTitle();
} else {
gotoAndPlay (1);
var myBytes = getBytesLoaded();
var soundBytes = soundClip.getBytesLoaded();
var totalBytes = (getBytesTotal() + soundClip.getBytesTotal());
loadingMeter.setLoad((myBytes + soundBytes) / totalBytes);
}
Frame 4
Frame 5
head._visible = false;
_global.noseActive = false;
_global.hatchActive = false;
_global.handActive = false;
_global.earlobeActive = false;
_global.coughActive = false;
_global.windowActive = false;
_global.cryActive = false;
_global.tuftActive = false;
_global.feedActive = true;
function newDepth(noStack) {
dpth = dpth + 20;
if (!noStack) {
stackClips(dpth);
}
return(dpth);
}
function attachClip(linkageId, params) {
var _local1 = newDepth();
return(attachMovie(linkageId, linkageId + _local1, _local1, params));
}
function attachForeGroundDraggable(linkageId, params) {
foreGroundDraggables.depthMeter++;
var _local1 = foreGroundDraggables.depthMeter;
return(foreGroundDraggables.attachMovie(linkageId, linkageId + _local1, _local1, params));
}
function newClip(params) {
return(createEmptyMovieClip("f" + newDepth(), dpth, params));
}
function stackClips(minDepth) {
if (minDepth == undefined) {
minDepth = newDepth(true);
}
walkingLegsShell.setMask();
birdDepth = minDepth + 16;
faderDepth = minDepth + 15;
foreGroundDraggables.swapDepths(minDepth + 14);
_root.foreDepth = minDepth + 13;
shield.swapDepths(minDepth + 12);
fishDepth = minDepth + 11;
fishShell.swapDepths(fishDepth);
loadingMeter.swapDepths(minDepth + 10);
legRollOver.swapDepths(minDepth + 9);
legsMask.swapDepths(minDepth + 8);
walkingLegsShell.swapDepths(minDepth + 7);
ballTracker.swapDepths(minDepth + 6);
fader.swapDepths(minDepth + 5);
hintMaster.swapDepths(minDepth + 4);
head.swapDepths(minDepth + 3);
noseLayer.swapDepths(minDepth + 2);
trunk.swapDepths(minDepth + 1);
foreDepthCount = 0;
walkingLegsShell.setMask(legsMask);
}
function getGlobalCoords(obj, pt) {
if (pt == undefined) {
pt = {x:0, y:0};
}
obj.localToGlobal(pt);
_root.globalToLocal(pt);
return(pt);
}
function getLocalCoords(obj, pt) {
if (pt == undefined) {
pt = {x:0, y:0};
}
_root.localToGlobal(pt);
obj.globalToLocal(pt);
return(pt);
}
_root.noseLayer = _root.createEmptyMovieClip("noseLayer", _root.getNextHighestDepth());
_root.foreGroundDraggables = _root.createEmptyMovieClip("fgd", _root.getNextHighestDepth());
foreGroundDraggables.depthMeter = 0;
var dpth = 0;
_root.foreDepth;
_root.getCoords = function (obj) {
var _local2 = {x:0, y:0};
obj.localToGlobal(_local2);
_root.globalToLocal(_local2);
return(_local2);
};
function checkResize() {
if (lastHeight != Stage.height) {
resizeHandler.onResize();
lastHeight = Stage.height;
}
}
foodDepth = -97;
SoundManager.init(soundClip);
head.init();
stackClips(0);
processCoordinator = new ProcessCoordinator(head, hintMaster);
head._coordinator = processCoordinator;
onEnterFrame = function () {
processCoordinator.init();
processCoordinator.run();
head._visible = true;
loadingMeter.kill();
onEnterFrame = function () {
processCoordinator.run();
_root.trunk.step();
};
};
var lastHeight = Stage.height;
resizeHandler.onResize();
stop();
Symbol 4 MovieClip [beachBallShape2] Frame 1
#initclip 198
Object.registerClass("beachBallShape2", BeachBallShape);
#endinitclip
Symbol 5 MovieClip [beachBallShape1] Frame 1
#initclip 176
Object.registerClass("beachBallShape1", BeachBallShape);
#endinitclip
Symbol 6 MovieClip [beachBallShape0] Frame 1
#initclip 177
Object.registerClass("beachBallShape0", BeachBallShape);
#endinitclip
Symbol 7 MovieClip [beachBallToss] Frame 1
#initclip 178
Object.registerClass("beachBallToss", BeachBallToss);
#endinitclip
Symbol 9 MovieClip Frame 1
stop();
Symbol 17 MovieClip [newBeardStrand2] Frame 1
#initclip 179
Object.registerClass("newBeardStrand2", BeardStrand);
#endinitclip
onFirstFrame();
Symbol 17 MovieClip [newBeardStrand2] Frame 9
onGrown();
stop();
Symbol 20 MovieClip [newBeardStrand] Frame 1
#initclip 180
Object.registerClass("newBeardStrand", BeardStrand);
#endinitclip
onFirstFrame();
Symbol 20 MovieClip [newBeardStrand] Frame 9
onGrown();
stop();
Symbol 23 MovieClip [newBeardStrand3] Frame 1
#initclip 181
Object.registerClass("newBeardStrand3", BeardStrand);
#endinitclip
onFirstFrame();
Symbol 23 MovieClip [newBeardStrand3] Frame 9
onGrown();
stop();
Symbol 24 MovieClip [earTuft] Frame 1
#initclip 182
Object.registerClass("earTuft", Tuft);
#endinitclip
Symbol 25 MovieClip [ear] Frame 1
#initclip 183
Object.registerClass("ear", ReversibleClip);
#endinitclip
stop();
Symbol 25 MovieClip [ear] Frame 10
stop();
Symbol 28 MovieClip [earShadow ] Frame 1
#initclip 184
Object.registerClass("earShadow ", ReversibleClip);
#endinitclip
stop();
Symbol 28 MovieClip [earShadow ] Frame 10
stop();
Symbol 42 MovieClip [sendToAFriend] Frame 1
#initclip 185
Object.registerClass("sendToAFriend", SendToFriend);
#endinitclip
stop();
Symbol 50 MovieClip [eyeShapeSmallHead1] Frame 1
#initclip 186
Object.registerClass("eyeShapeSmallHead1", EyeShapeWithBlink);
#endinitclip
stop();
Symbol 53 MovieClip [autoShape] Frame 1
#initclip 187
Object.registerClass("autoShape", AutoShape);
#endinitclip
Symbol 55 MovieClip [autoShapePointMarker] Frame 1
#initclip 188
Object.registerClass("autoShapePointMarker", PointMarker);
#endinitclip
Symbol 57 MovieClip [autoShapeCurveMarker] Frame 1
#initclip 189
Object.registerClass("autoShapeCurveMarker", CurveMarker);
#endinitclip
Symbol 70 MovieClip [smallHead0Nose] Frame 1
#initclip 190
Object.registerClass("smallHead0Nose", ReversibleClip);
#endinitclip
Symbol 71 MovieClip Frame 1
stop();
Symbol 71 MovieClip Frame 2
stop();
Symbol 80 MovieClip [eyeShapeSmallHead0] Frame 1
#initclip 191
Object.registerClass("eyeShapeSmallHead0", EyeShapeWithBlink);
#endinitclip
Symbol 82 MovieClip [smallHead0AnimForm] Frame 1
#initclip 192
Object.registerClass("smallHead0AnimForm", AnimForm);
#endinitclip
Instance of Symbol 81 MovieClip "top" in Symbol 82 MovieClip [smallHead0AnimForm] Frame 1
/* no clip actions */
Symbol 83 MovieClip [smallHead0] Frame 1
#initclip 193
Object.registerClass("smallHead0", SmallHeadRed);
#endinitclip
Symbol 90 MovieClip [smallHead0Shell] Frame 1
#initclip 194
Object.registerClass("smallHead0Shell", SmallHeadShell);
#endinitclip
Symbol 115 MovieClip [head0Cracks] Frame 1
#initclip 195
Object.registerClass("head0Cracks", ReversibleClip);
#endinitclip
Symbol 121 MovieClip [loadingMeter] Frame 1
#initclip 196
Object.registerClass("loadingMeter", LoadingMeter);
#endinitclip
Symbol 129 MovieClip Frame 1
stop();
Symbol 133 MovieClip [robotLeg] Frame 1
#initclip 164
Object.registerClass("robotLeg", RobotLeg);
#endinitclip
Symbol 136 MovieClip [bearLeg] Frame 1
#initclip 165
Object.registerClass("bearLeg", BearLeg);
#endinitclip
Symbol 142 MovieClip [circle] Frame 1
#initclip 166
Object.registerClass("circle", CircleShape);
#endinitclip
Symbol 144 MovieClip [elephantLeg] Frame 1
#initclip 167
Object.registerClass("elephantLeg", Leg);
#endinitclip
Symbol 153 MovieClip [duckFoot] Frame 1
#initclip 168
Object.registerClass("duckFoot", DuckLeg);
#endinitclip
Symbol 154 MovieClip [tentacle] Frame 1
#initclip 169
Object.registerClass("tentacle", Tentacle);
#endinitclip
Symbol 161 MovieClip [horseLeg] Frame 1
#initclip 170
Object.registerClass("horseLeg", HorseLeg);
#endinitclip
Symbol 174 MovieClip [ladyLeg] Frame 1
#initclip 171
Object.registerClass("ladyLeg", LadyLeg);
#endinitclip
Symbol 175 MovieClip [simpleBall] Frame 1
#initclip 172
Object.registerClass("simpleBall", SimpleBall);
#endinitclip
Symbol 176 MovieClip [legs] Frame 1
#initclip 173
Object.registerClass("legs", Legs);
#endinitclip
stop();
Symbol 195 MovieClip [walkingLegs] Frame 1
#initclip 174
Object.registerClass("walkingLegs", WalkingLegs);
#endinitclip
stop();
Symbol 207 MovieClip [tentFilm] Frame 1
#initclip 175
Object.registerClass("tentFilm", TentFilm);
#endinitclip
stop();
Symbol 208 MovieClip [tentFilmLoader] Frame 1
function getBalls() {
return(tent.getBalls());
}
function getBallColors() {
return(tent.getBallColors());
}
function removeBall(o) {
tent.removeBall(o);
}
function getData() {
return(tent.srcBallExists);
}
function setContentData(dataObj) {
return(tent.setContentData(dataObj));
}
function begin() {
tent.begin();
}
fader = tent.fader;
fader._visible = true;
Symbol 237 MovieClip [introBubble] Frame 1
#initclip 197
Object.registerClass("introBubble", ReversibleClip);
#endinitclip
Symbol 237 MovieClip [introBubble] Frame 31
if (_animDir == 1) {
SoundManager.playSound("thoomp");
}
Symbol 237 MovieClip [introBubble] Frame 43
if (_animDir == 1) {
SoundManager.playSound("thoomp");
}
Symbol 237 MovieClip [introBubble] Frame 55
if (_animDir == 1) {
SoundManager.playSound("thoomp");
}
Symbol 832 MovieClip [__Packages.KeyListener] Frame 0
class KeyListener
{
static var pc, lastChar;
function KeyListener () {
}
static function init() {
keyListener.onKeyDown = function () {
var _local1 = Key.getCode();
KeyListener.doCode(_local1);
};
Key.addListener(keyListener);
}
static function doCode(keyCode) {
var _local2 = String.fromCharCode(keyCode).toLowerCase();
if (active) {
switch (_local2) {
case "h" :
pc.hatchProcess.turnOnHand();
break;
case "b" :
pc.reportEvent("birdDream");
break;
case "s" :
pc.reportEvent("smallHead");
break;
case "w" :
pc.walkProcess.setActive(true, true);
break;
case "z" :
pc.initFishTank();
break;
case "x" :
pc.removeFishTank(true);
break;
case " " :
_global.testMode = true;
break;
case "j" :
pc.walkProcess.onObstacleJump();
}
if (!(lastChar === "n")) {
} else {
pc.noseProcess.forceNosePull(Number(_local2));
}
}
if (!((lastChar + _local2) === "ps")) {
} else {
active = true;
}
lastChar = _local2;
}
static var keyListener = {};
static var active = false;
}
Symbol 833 MovieClip [__Packages.ViewMaster] Frame 0
class ViewMaster
{
static var _timerClip, _currFrameType, currFrame;
function ViewMaster () {
}
static function init(viewClip, transLength) {
_timerClip = viewClip;
_currFrameType = "regular";
currFrame = frames.regular;
}
static function getFrame() {
return(currFrame);
}
static function setFrame(frameType, transLength, ifFrame) {
if (transLength == undefined) {
transLength = 30;
}
if (frameType == _currFrameType) {
return(undefined);
}
if ((ifFrame != undefined) && (ifFrame != _currFrameType)) {
return(undefined);
}
var oldFrame = currFrame;
var frame = frames[frameType];
_currFrameType = frameType;
var time = 0;
_timerClip.onEnterFrame = function () {
time++;
var _local2 = Curves.scurve(time / transLength);
ViewMaster.currFrame = {x1:(oldFrame.x1 * (1 - _local2)) + (frame.x1 * _local2), x2:(oldFrame.x2 * (1 - _local2)) + (frame.x2 * _local2), y1:(oldFrame.y1 * (1 - _local2)) + (frame.y1 * _local2), y2:(oldFrame.y2 * (1 - _local2)) + (frame.y2 * _local2)};
ViewMaster.onResize();
if (time == transLength) {
this.onEnterFrame = undefined;
}
};
}
static function onResize() {
_root._parent.resize();
}
static var frames = {regular:{x1:0, x2:950, y1:0, y2:600}, walking:{x1:0, x2:950, y1:-50, y2:600}, hatch:{x1:0, x2:950, y1:-150, y2:600}, smallHead0:{x1:0, x2:950, y1:-240, y2:500}, smallHead1:{x1:0, x2:950, y1:-340, y2:400}, smallHead2:{x1:150, x2:800, y1:-390, y2:300}, smallHead3:{x1:200, x2:750, y1:-560, y2:70}, smallHead4:{x1:200, x2:750, y1:-560, y2:70}, smallHead5:{x1:200, x2:750, y1:-560, y2:70}, obstacles:{x1:-200, x2:1150, y1:-100, y2:700}};
static var xShift = 0;
static var yShift = 0;
}
Symbol 180 MovieClip [__Packages.Curves] Frame 0
class Curves
{
function Curves () {
}
static function scurve(num) {
return(((-Math.cos(num * Math.PI)) + 1) / 2);
}
static function easeOut(num) {
return(Math.sin((num * Math.PI) / 2));
}
static function easeIn(num) {
return(1 - Math.sin(((1 - num) * Math.PI) / 2));
}
}
Symbol 187 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager
{
static var _soundMc;
function SoundManager () {
}
static function init(soundMc) {
_soundMc = soundMc;
}
static function playSound(soundName, volume, loopNum, fadein, fadeout) {
sndIndex++;
var _local3 = _soundMc.createEmptyMovieClip("snd" + sndIndex, sndIndex);
var _local2 = new Sound(_local3);
_local2.clip = _local3;
_local2.onSoundComplete = function () {
this.clip.removeMovieClip();
};
_local2.attachSound(soundName);
if (volume != undefined) {
_local2.setVolume(volume);
} else {
_local2.setVolume(50);
}
_local2.start(0, loopNum);
return(_local2);
}
static function killSound(sndObj) {
sndObj.stop();
sndObj.clip.removeMovieClip();
}
static function fadeInSound(snd, numFrames) {
var _local4 = {count:0};
var _local1 = 0;
var _local2 = snd.getVolume();
snd.setVolume(0);
var _local5 = intervals.length;
intervals.push(setInterval(doFade, 33.3333333333333, snd, _local1, _local2, numFrames, _local4, intervals, _local5));
}
static function fadeOutSound(snd, numFrames) {
var _local3 = {count:0};
var _local1 = snd.getVolume();
var _local2 = 0;
var _local4 = intervals.length;
intervals.push(setInterval(doFade, 33.3333333333333, snd, _local1, _local2, numFrames, _local3, intervals, _local4, true));
}
static function doFade(snd, startVol, endVol, totalFrames, frameObj, intervalArr, intervalIndex, killSound) {
frameObj.count++;
var _local1 = frameObj.count / totalFrames;
var _local2 = (startVol * (1 - _local1)) + (endVol * _local1);
snd.setVolume(_local2);
if (frameObj.count == totalFrames) {
clearInterval(intervalArr[intervalIndex]);
if (killSound) {
snd.stop();
}
}
}
static var intervals = [];
static var sndIndex = 0;
}
Symbol 834 MovieClip [__Packages.BeachBallShape] Frame 0
class BeachBallShape extends MovieClip
{
var spots, spot1, spot2, spot3, _parent;
function BeachBallShape () {
super();
spots = [spot1, spot2, spot3];
var o = this;
_parent.onKick = function (frac) {
SoundManager.playSound("beachBall" + (random(2) + 1), 67);
o.randomSpin(frac);
};
_parent.onGroundHit = function (bounce, frac) {
if (bounce) {
SoundManager.playSound("beachBall" + (random(2) + 1), Math.sqrt(Math.abs(this.vy) / 15) * 67);
o.randomSpin(frac);
} else {
o.pitchV = 0;
o.yawV = 0;
o.tiltV = 0;
}
};
_parent.onCollision = function () {
o.randomSpin(0.5);
};
}
function randomSpin(frac) {
pitch = pitch - (pitchV * frac);
yaw = yaw - (yawV * frac);
tilt = tilt - (tiltV * frac);
var _local3 = Math.sqrt(Math.sqrt((_parent.vx * _parent.vx) + (_parent.vy * _parent.vy))) / 30;
if (_local3 > 1) {
_local3 = 1;
}
var _local2 = [random(100), random(100), random(100)];
var _local5 = (_local2[0] + _local2[1]) + _local2[2];
pitchV = (((_local2[0] / _local5) * 2) * (random(2) - 0.5)) * _local3;
yawV = (((_local2[1] / _local5) * 2) * (random(2) - 0.5)) * _local3;
tiltV = (((_local2[2] / _local5) * 2) * (random(2) - 0.5)) * _local3;
pitch = pitch + (pitchV * frac);
yaw = yaw + (yawV * frac);
tilt = tilt + (tiltV * frac);
}
function onDrag() {
pitchV = 0;
yawV = 0;
tiltV = 0;
}
function onEnterFrame(force) {
if ((((!force) && (pitchV == 0)) && (yawV == 0)) && (tiltV == 0)) {
return(undefined);
}
if (_parent.drag) {
onDrag();
}
var _local13 = 25;
var _local12 = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];
var _local3 = 0;
while (_local3 < _local12.length) {
var _local7 = _local12[_local3];
var _local4 = getCoords(yaw, tilt, pitch, _local7[0], _local7[1], _local7[2]);
var _local2 = spots[_local3];
var _local8 = ((_local4[2] > 0) ? 1 : -1);
var _local6 = _local4[0] * _local8;
var _local5 = _local4[1] * _local8;
_local2._x = _local6 * _local13;
_local2._y = _local5 * _local13;
var _local10 = Math.atan2(_local5, _local6);
var _local11 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local9 = Math.atan2(_local11, _local4[2] * _local8);
_local2._rotation = (_local10 / Math.PI) * 180;
_local2.form._xscale = (100 * Math.cos(_local9)) * spotScale;
_local2.form._yscale = 100 * spotScale;
_local3++;
}
pitch = pitch + pitchV;
yaw = yaw + yawV;
tilt = tilt + tiltV;
}
function getState() {
return({pitch:pitch, yaw:yaw, tilt:tilt, pitchV:pitchV, yawV:yawV, tiltV:tiltV});
}
function setState(dataObj) {
if (dataObj == undefined) {
pitch = (random(100) / 100) * Math.PI;
yaw = (random(100) / 100) * Math.PI;
tilt = (random(100) / 100) * Math.PI;
} else {
pitch = dataObj.pitch;
yaw = dataObj.yaw;
tilt = dataObj.tilt;
pitchV = dataObj.pitchV;
yawV = dataObj.yawV;
tiltV = dataObj.tiltV;
}
onEnterFrame(true);
}
function getCoords(yaw, roll, pitch, xi, yi, zi) {
var _local4 = Math.sin(-yaw);
var _local5 = Math.cos(-yaw);
var _local8 = Math.sin(-pitch);
var _local9 = Math.cos(-pitch);
var _local6 = Math.sin(-roll);
var _local7 = Math.cos(-roll);
var _local3 = (xi * _local5) + (yi * _local4);
var _local2 = (yi * _local5) - (xi * _local4);
var _local1 = (zi * _local9) - (_local3 * _local8);
return([(_local3 * _local9) + (zi * _local8), (_local2 * _local7) + (_local1 * _local6), (_local1 * _local7) - (_local2 * _local6)]);
}
var pitch = 0;
var yaw = 0;
var tilt = 0;
var pitchV = 0.011;
var yawV = 0.021;
var tiltV = 0.031;
var spotScale = 0.6;
}
Symbol 185 MovieClip [__Packages.SuperClip] Frame 0
class SuperClip extends MovieClip
{
var _rotation, __get___radians, attachMovie, createEmptyMovieClip, onRollOver, onRollOut, onDragOut, fadeEvent, _alpha;
function SuperClip () {
super();
}
function setAbsoluteRotation(deg) {
var _local3 = 0;
var _local2 = this;
while (_local2._parent != undefined) {
_local3 = _local3 + _local2._parent._rotation;
_local2 = _local2._parent;
}
_rotation = deg - _local3;
}
function getAbsoluteRotation() {
var _local3 = _rotation;
var _local2 = this;
while (_local2._parent != undefined) {
_local3 = _local3 + _local2._parent._rotation;
_local2 = _local2._parent;
}
return(_local3);
}
function set _radians(num) {
_rotation = (num / Math.PI) * 180;
//return(__get___radians());
}
function getBetween(mc1, mc2) {
return(new Between({x:mc1._x, y:mc1._y}, {x:mc2._x, y:mc2._y}));
}
function attachClip(linkageName, params) {
return(attachMovie(linkageName, linkageName + (dpth++), dpth, params));
}
function newClip(params) {
return(createEmptyMovieClip("mc" + (dpth++), dpth, params));
}
function pyt(a, b) {
return(sqrt((a * a) + (b * b)));
}
function setUpRollFlag() {
onRollOver = function () {
this.isRolledOver = true;
this.rollIn();
};
onRollOut = (onDragOut = function () {
this.isRolledOver = false;
this.rollOut();
});
}
function rollIn() {
}
function rollOut() {
}
function fadeIn(maxCount, callBack) {
doFade(0, maxCount, 1, callBack);
}
function fadeOut(maxCount, callBack) {
doFade(maxCount, maxCount, -1, callBack);
}
function doFade(counter, maxCount, dir, callBack) {
fadeEvent.cancel();
counter = counter + dir;
var _local4 = Curves.easeOut(counter / maxCount);
_alpha = _local4 * 100;
if (((dir == 1) && (counter < maxCount)) || ((dir == -1) && (counter > 0))) {
fadeEvent = new DelayedEvent(this, 1, "doFade", [counter, maxCount, dir, callBack]);
} else {
callBack();
}
}
var PI = Math.PI;
var cos = Math.cos;
var sin = Math.sin;
var atan2 = Math.atan2;
var sqrt = Math.sqrt;
var abs = Math.abs;
var dpth = 0;
var isRolledOver = false;
var doTrace = false;
}
Symbol 184 MovieClip [__Packages.Between] Frame 0
class Between
{
var _obj1, _obj2;
function Between (obj1, obj2) {
_obj1 = obj1;
_obj2 = obj2;
}
function getDistance(globalFlag) {
var _local4 = _obj2.x - _obj1.x;
var _local3 = _obj2.y - _obj1.y;
return(Math.sqrt((_local4 * _local4) + (_local3 * _local3)) / (globalFlag ? (_root.scale) : 1));
}
function getAngle() {
var _local3 = _obj2.x - _obj1.x;
var _local2 = _obj2.y - _obj1.y;
return(Math.atan2(_local2, _local3));
}
function getDx(globalFlag) {
return((_obj2.x - _obj1.x) / (globalFlag ? (_root.scale) : 1));
}
function getDy(globalFlag) {
return((_obj2.y - _obj1.y) / (globalFlag ? (_root.scale) : 1));
}
}
Symbol 178 MovieClip [__Packages.DelayedEvent] Frame 0
class DelayedEvent extends MovieClip
{
static var evtBin;
var myEvent;
function DelayedEvent (hr, endParam, rf, params) {
super();
var homeRef = hr;
var resultFunc = rf;
if (evtBin == undefined) {
evtBin = _root.createEmptyMovieClip("evtBin", 99999);
}
myEvent = evtBin.createEmptyMovieClip("evt" + (evtIndx++), evtIndx);
if (!isNaN(endParam)) {
var maxTime = endParam;
var currTime = 0;
myEvent.onEnterFrame = function () {
currTime++;
if (currTime >= maxTime) {
if (typeof(rf) == "string") {
homeRef[resultFunc](params[0], params[1], params[2], params[3], params[4], params[5], params[6]);
} else {
resultFunc(params[0], params[1], params[2], params[3], params[4], params[5], params[6]);
}
this.removeMovieClip();
}
};
} else {
myEvent.onEnterFrame = function () {
if (endParam()) {
this.onEnterFrame = undefined;
if (typeof(rf) == "string") {
homeRef[resultFunc](params[0], params[1], params[2], params[3], params[4], params[5], params[6]);
} else {
resultFunc(params[0], params[1], params[2], params[3], params[4], params[5], params[6]);
}
this.removeMovieClip();
}
};
}
}
function cancel() {
myEvent.removeMovieClip();
}
static var evtIndx = 0;
}
Symbol 835 MovieClip [__Packages.BeachBallToss] Frame 0
class BeachBallToss extends SuperClip
{
var ballClip, attachClip, _transform, _callBack, _parent, _parentProcess;
function BeachBallToss () {
super();
}
function init() {
}
function initContentData(dataObj, callBack) {
var _local2 = "beachBallShape" + dataObj.indx;
ballClip = attachClip(_local2);
ballClip._width = (ballClip._height = dataObj.radius * 2);
ballClip._visible = false;
_transform = new flash.geom.Transform(ballClip);
_callBack = callBack;
}
function onOpen() {
ballClip._visible = true;
var _local4 = 50;
var _local3 = 10;
var _local2 = 16;
toss({x:_local4, y:_local3, vx:-12, vy:-6}, 0, _local2);
}
function toss(ballObj, t, maxT) {
var _local5 = t + 1;
ballObj.vx = ballObj.vx * 0.96;
ballObj.vy = ballObj.vy * 0.96;
ballObj.vy = ballObj.vy + 0.5;
ballObj.x = ballObj.x + ballObj.vx;
ballObj.y = ballObj.y + ballObj.vy;
ballClip._x = ballObj.x;
ballClip._y = ballObj.y;
var _local4 = t / (maxT / 2);
if (_local4 > 1) {
_local4 = 1;
}
_transform.colorTransform = new flash.geom.ColorTransform(_local4, _local4, _local4, 1, 0, 0, 0, 0);
if (_local5 == maxT) {
var _local6 = _root.getGlobalCoords(ballClip);
_callBack("ballEjected", {x:_local6.x, y:_local6.y, vx:ballObj.vx, vy:ballObj.vy, shapeData:ballClip.getState()});
ballClip.removeMovieClip();
_parent.onContentComplete();
} else {
new DelayedEvent(this, 1, "toss", [ballObj, _local5, maxT]);
}
}
function cleanUp() {
}
function setParentProcess(obj) {
_parentProcess = obj;
}
function onFrame() {
}
function onWindowRollOut() {
}
}
Symbol 836 MovieClip [__Packages.BeardStrand] Frame 0
class BeardStrand extends MovieClip
{
var marker, _parent, stop, indx, isGrowing, _xscale, _yscale, play;
function BeardStrand () {
super();
marker._visible = false;
_parent.addStrand(this);
}
function reset() {
stop();
indx = -1;
isGrowing = false;
}
function onFirstFrame() {
indx++;
if (indx == 1) {
reset();
_parent.onQuit();
} else {
_xscale = (_yscale = 100 * (1 + (indx / 4)));
}
}
function onGrown() {
whole = true;
}
function grow() {
reset();
onFirstFrame();
play();
isGrowing = true;
}
function sway() {
}
function destroy() {
play();
whole = false;
}
var whole = false;
var growth = 0;
}
Symbol 837 MovieClip [__Packages.Tuft] Frame 0
class Tuft extends MovieClip
{
var ms, strands, keyStrands, isGrowing, hitTest, _xmouse, _ymouse, manager;
function Tuft () {
super();
ms = false;
strands = [];
keyStrands = [];
}
function addStrand(obj) {
strands.push(obj);
obj.marker.removeMovieClip();
obj.reset();
}
function onMouseDown() {
ms = true;
}
function onMouseUp() {
ms = false;
}
function onEnterFrame() {
checkForSnip();
}
function checkForSnip(forceSnip) {
if (!isGrowing) {
return(undefined);
}
var _local5 = false;
if (forceSnip || (hitTest(_root._xmouse, _root._ymouse, false))) {
var _local7 = _xmouse;
var _local6 = _ymouse;
var _local3 = 0;
while (_local3 < strands.length) {
if (strands[_local3].whole) {
if (forceSnip || (strands[_local3].hitTest(_root._xmouse, _root._ymouse, false))) {
if (forceSnip || (strands[_local3].hitTest(_root._xmouse, _root._ymouse, true))) {
_local5 = true;
strands[_local3].destroy();
}
}
}
_local3++;
}
}
if (_local5) {
snipIndex++;
if (snipIndex == 5) {
snipIndex = 0;
}
SoundManager.playSound("snip" + snipIndex);
}
}
function grow() {
isGrowing = true;
manager.onTuftGrow();
var _local2 = 0;
while (_local2 < strands.length) {
strands[_local2].grow();
_local2++;
}
}
function onQuit() {
var _local3 = true;
var _local2 = 0;
while (_local2 < strands.length) {
if (strands[_local2].isGrowing) {
_local3 = false;
}
_local2++;
}
if (_local3) {
isGrowing = false;
manager.onTuftComplete();
}
}
var snipIndex = 0;
}
Symbol 810 MovieClip [__Packages.ReversibleClip] Frame 0
class ReversibleClip extends SuperClip
{
var useHandCursor, stop, _cf, _currentframe, _currPath, _totalframes, paths, gotoAndStop;
function ReversibleClip () {
super();
useHandCursor = false;
stop();
_cf = _currentframe;
}
function onEnterFrame() {
if (_animDir != 0) {
var _local5 = _cf;
var _local2 = _local5 + _animDir;
var _local3;
var _local4;
if (_currPath != undefined) {
_local3 = _currPath.endFrame;
_local4 = _currPath.startFrame;
} else {
_local3 = _totalframes;
_local4 = 1;
}
if (_local2 < _local4) {
_local2 = _local4;
if (_animDir < 0) {
_animDir = 0;
}
} else if (_local2 > _local3) {
_local2 = _local3;
if (_animDir > 0) {
_animDir = 0;
}
}
if (_local2 != _local5) {
gotoFrame(_local2);
if (_local2 == _local4) {
_lockPath = false;
_beginFunc();
} else if (_local2 == _local3) {
_lockPath = false;
_endFunc();
}
}
}
}
function setMarker(varName) {
this[varName] = _animDir > 0;
}
function _beginFunc() {
}
function _endFunc() {
}
function onFrame(num) {
}
function definePaths(pathNameArr) {
paths = {};
var _local8 = 0;
while (_local8 < pathNameArr.length) {
var _local2 = pathNameArr[_local8];
gotoAndStop(_local2);
var _local3 = _currentframe;
paths[_local2] = {name:_local2, startFrame:_local3};
_local8++;
}
for (_local8 in paths) {
paths[_local8].endFrame = _totalframes;
for (var _local5 in paths) {
if ((paths[_local5].startFrame < paths[_local8].endFrame) && (paths[_local5].startFrame > paths[_local8].startFrame)) {
paths[_local8].endFrame = paths[_local5].startFrame - 1;
}
}
}
gotoAndStop(1);
}
function forward(numSteps, endFunc, pathName, lockPath, resetPath) {
if (_lockPath) {
return(undefined);
}
if (lockPath) {
_lockPath = true;
}
_endFunc = endFunc;
if (numSteps == undefined) {
numSteps = 1;
}
_animDir = numSteps;
switchPaths(pathName, resetPath);
}
function switchPaths(pathName, resetPath) {
if ((resetPath != true) && (_currPath == paths[pathName])) {
return(undefined);
}
_currPath = paths[pathName];
if (_currPath.startFrame != undefined) {
setFrame(_currPath.startFrame);
} else {
setFrame(1);
}
}
function reverse(numSteps, beginFunc, pathName) {
_beginFunc = beginFunc;
if (numSteps == undefined) {
numSteps = 1;
}
_animDir = -numSteps;
switchPaths(pathName);
}
function gotoFrame(frameNum) {
setFrame(frameNum);
onFrame(frameNum);
}
function setFrame(frameNum) {
gotoAndStop(frameNum);
_cf = _currentframe;
}
function halt() {
_animDir = 0;
}
function getFrame() {
if (_currPath != undefined) {
return(_cf - _currPath.startFrame);
}
return(_cf);
}
function get currPathName() {
return(_currPath.name);
}
function gotoEndOfPath(pathName) {
switchPaths(pathName);
gotoFrame(_currPath.endFrame);
}
var _animDir = 0;
var doTrace = false;
var _lockPath = false;
}
Symbol 838 MovieClip [__Packages.SendToFriend] Frame 0
class SendToFriend extends MovieClip
{
var _alpha, _visible, inSubmission, sendToFriendButton, _xscale, _yscale, _y, _x, sendButton, friendEmailField, yourNameField, onEnterFrame, fromEmail, linkUrl, __get__locked, gotoAndStop, statusField;
function SendToFriend () {
super();
_alpha = 100;
_visible = false;
inSubmission = false;
var o = this;
sendToFriendButton.onPress = function () {
if (o._currentFrame == 1) {
o.open();
} else {
o.close();
}
};
}
function resize() {
_xscale = (_yscale = (1 / (_root._xscale / 100)) * 100);
_y = _root.yMin;
_x = _root.xMax - 116;
}
function initUI() {
sendButton.onPress = function () {
this._parent.submit();
};
friendEmailField.firstFocus = false;
yourNameField.firstFocus = false;
friendEmailField.onSetFocus = function () {
if (!this.firstFocus) {
this.firstFocus = true;
this.text = "";
}
};
yourNameField.onSetFocus = function () {
if (!this.firstFocus) {
this.firstFocus = true;
this.text = "";
}
};
}
function init(eml, lnk) {
resize();
_visible = true;
_alpha = 0;
var alph = 0;
onEnterFrame = function () {
alph = alph + 10;
if (alph >= 100) {
alph = 100;
this.onEnterFrame = undefined;
}
this._alpha = alph;
};
fromEmail = eml;
linkUrl = lnk;
}
function clear() {
friendEmailField.text = "";
yourNameField.text = "";
}
function fadeIn() {
}
function fadeOut() {
}
function set locked(boo) {
_alpha = (boo ? 50 : 100);
friendEmailField.type = (boo ? "dynamic" : "input");
yourNameField.type = (boo ? "dynamic" : "input");
//return(__get__locked());
}
function open() {
gotoAndStop(2);
initUI();
}
function close() {
gotoAndStop(1);
}
function submit() {
if (!inSubmission) {
if ((friendEmailField.text == "") || (friendEmailField.text == "Friend's Email Address")) {
statusField.text = "You must enter your friend's email address!";
return(undefined);
}
if ((yourNameField.text == "") || (yourNameField.text == "Your Name")) {
statusField.text = "You must enter your name!";
return(undefined);
}
inSubmission = true;
var _local2 = new LoadVars();
_local2.toEmail = friendEmailField.text;
_local2.fromName = yourNameField.text;
_local2.message = ((yourNameField.text + " has sent you this link:\r\r") + linkUrl) + "\r\rYour address has not been saved and you will receive no further emails.";
_local2.fromEmail = fromEmail;
_local2.subject = yourNameField.text + " has sent you a link.";
var o = this;
var _local3 = new LoadVars();
_local3.onLoad = function () {
this.error = Number(this.error);
if (this.error == 0) {
o.statusField.text = "Done! (Click to close.)";
o.clear();
o.onMouseDown = function () {
this.onMouseDown = undefined;
o.clear();
o.statusField.text = "";
o.gotoAndStop(1);
};
} else if (this.error == 1) {
o.statusField.text = "You must enter an email address!";
} else if (this.error == 2) {
o.statusField.text = "The email address you entered is invalid!";
} else if (this.error == 3) {
o.statusField.text = "You must enter your name!";
} else if (this.error == 4) {
o.statusField.text = "Server error.";
}
o.inSubmission = false;
o.locked = false;
};
_local2.sendAndLoad("sendToFriend.php", _local3, "POST");
statusField.text = "sending...";
locked = (true);
}
}
}
Symbol 839 MovieClip [__Packages.EyeShape] Frame 0
class EyeShape extends ReversibleClip
{
static var eyeData;
var _radius, base, lookRad, pupil, _rotation;
function EyeShape () {
super();
_radius = base._width / 2;
lookRad = _radius - (pupil._width / 3);
}
function get radius() {
return(_radius);
}
function getBounds() {
return({xMin:-_radius, yMin:-_radius, xMax:_radius, yMax:_radius});
}
function lookRun(x, y) {
x = x + lookShiftX;
y = y + lookShiftY;
if (momentumFactor > 0) {
x = x + ((vx - (x - lastX)) * momentumFactor);
y = y + ((vy - (y - lastY)) * momentumFactor);
vx = x - lastX;
vy = y - lastY;
}
lastX = x;
lastY = y;
var _local4 = new Between({x:-x, y:-y}, {x:0, y:0});
var _local5 = _local4.getAngle() + ((_rotation / 180) * Math.PI);
var _local6 = _local4.getDistance();
var _local2 = _local6 / 200;
if (_local2 > 1) {
_local2 = 1;
}
var _local3 = Math.sin((_local2 * Math.PI) / 2);
pupil._x = ((base._x + ((lookRad * Math.cos(_local5)) * _local3)) * dragFrac) + (pupil._x * (1 - dragFrac));
pupil._y = ((base._y + ((lookRad * Math.sin(_local5)) * _local3)) * dragFrac) + (pupil._y * (1 - dragFrac));
eyeData = {lastX:lastX, lastY:lastY};
}
function initLook() {
lookRun(eyeData.lastX, eyeData.lastY);
}
function setFixedCoordinates(x, y) {
fixedCoordinates = [x, y];
}
function releaseFixedCoordinates() {
fixedCoordinates = false;
}
var fixedRadius = true;
var dragFrac = 0.5;
var lookShiftX = 0;
var lookShiftY = 0;
var momentumFactor = 0;
var controlled = false;
var fixedCoordinates = false;
var lastX = 0;
var lastY = 0;
var vx = 0;
var vy = 0;
}
Symbol 840 MovieClip [__Packages.EyeShapeWithBlink] Frame 0
class EyeShapeWithBlink extends EyeShape
{
var definePaths, isBlinking, pupil, reverse, forward;
function EyeShapeWithBlink () {
super();
definePaths(["blink", "surprise"]);
}
function onEnterFrame() {
super.onEnterFrame();
if (((!isBlinking) && (!isSurprised)) && (!isControlled)) {
if ((random(3000) / 1000) < blinkFreq) {
doBlink(1, 1);
isBlinking = true;
}
}
}
function setFrame(frameNum) {
var _local4 = pupil._x;
var _local3 = pupil._y;
super.setFrame(frameNum);
pupil._x = _local4;
pupil._y = _local3;
}
function endSurprise() {
isSurprised = false;
reverse(1, null, "surprise");
}
function beginSurprise() {
isSurprised = true;
forward(1, null, "surprise");
}
function doBlink(counter, dir) {
if (isControlled) {
return(undefined);
}
var o = this;
var endBlink = function () {
o.isBlinking = false;
};
var _local2 = function () {
o.reverse(1, endBlink, "blink");
};
o.isBlinking = true;
forward(1, _local2, "blink");
}
function open() {
reverse(1, null, "blink");
}
function close() {
forward(1, null, "blink");
}
var blinkFreq = 0.03;
var dragFrac = 0.3;
var doTrace = false;
var isSurprised = false;
var isControlled = false;
}
Symbol 841 MovieClip [__Packages.AutoShape] Frame 0
class AutoShape extends MovieClip
{
var moveTo, beginFill, lineStyle, curveTo, lineTo, endFill, clear;
function AutoShape () {
super();
var _local3 = 0;
while (this["m" + _local3] != undefined) {
markers.push(this["m" + _local3]);
_local3++;
}
draw();
}
function setMarkers(arr) {
markers = arr;
}
function drawPoints(arr, lw, fillColor, lineColor, noWrap) {
var _local8 = arr.length;
var _local4 = 0;
while (_local4 < _local8) {
if (arr[_local4].type == "curve") {
arr[_local4].rote = (arr[_local4]._rotation / 180) * Math.PI;
}
_local4++;
}
moveTo(arr[0]._x, arr[0]._y);
if (fillColor != false) {
beginFill(((fillColor == undefined) ? 16777215 : (fillColor)));
}
if (lw > 0) {
lineStyle(lw, ((lineColor == undefined) ? 16777215 : (lineColor)));
}
_local4 = 0;
while (_local4 < _local8) {
var _local6 = _local4 + 1;
if (_local6 == _local8) {
if (noWrap) {
break;
}
_local6 = 0;
}
var _local3 = arr[_local4];
var _local2 = arr[_local6];
if ((_local3.type == "curve") && (_local2.type == "curve")) {
var _local7 = Tools.getIntersection(_local3._x, _local3._y, _local2._x, _local2._y, _local3.rote, _local2.rote);
curveTo(_local7.x, _local7.y, _local2._x, _local2._y);
} else {
lineTo(_local2._x, _local2._y);
}
_local4++;
}
endFill();
}
function draw(lw, fillColor, lineColor, noWrap) {
clear();
drawPoints(markers, lw, fillColor, lineColor, noWrap);
}
var markers = [];
}
Symbol 802 MovieClip [__Packages.Tools] Frame 0
class Tools
{
function Tools () {
}
static function getIntersection(x1, y1, x2, y2, dir1, dir2) {
var _local2 = Math.tan(dir1);
var _local3 = y1 - (_local2 * x1);
var _local1 = Math.tan(dir2);
var _local5 = y2 - (_local1 * x2);
var _local4 = ((_local3 - _local5) / _local1) / (1 - (_local2 / _local1));
var _local6 = (_local2 * _local4) + _local3;
return({x:_local4, y:_local6});
}
static function blendAngles(ang1, ang2, frac) {
var _local1 = getAngleDiff(ang2, ang1);
return(ang1 + (_local1 * frac));
}
static function getAngleDiff(ang1, ang2) {
while ((ang1 - ang2) > Math.PI) {
ang1 = ang1 - (Math.PI*2);
}
while ((ang2 - ang1) > Math.PI) {
ang1 = ang1 + (Math.PI*2);
}
return(ang1 - ang2);
}
}
Symbol 842 MovieClip [__Packages.PointMarker] Frame 0
class PointMarker extends MovieClip
{
var _visible;
function PointMarker () {
super();
_visible = false;
}
var type = "point";
}
Symbol 843 MovieClip [__Packages.CurveMarker] Frame 0
class CurveMarker extends MovieClip
{
var _visible;
function CurveMarker () {
super();
_visible = false;
}
var type = "curve";
}
Symbol 844 MovieClip [__Packages.AnimForm] Frame 0
class AnimForm extends ReversibleClip
{
var stop, _customStep, _customStepMax, _customStartFrame, frameLib, _customEndFrame, autoShapes, _cf, _customEndFunc, _totalframes, gotoAndStop, _animDir, _currPath;
function AnimForm () {
super();
stop();
}
function onEnterFrame() {
if (_customPath) {
_customStep++;
var _local5 = Curves.scurve(_customStep / _customStepMax);
var _local8 = frameLib[_customStartFrame];
var _local10 = frameLib[_customEndFrame];
for (var _local11 in _local8) {
var _local3 = _local8[_local11];
var _local7 = _local10[_local11];
var _local6 = this[_local11];
for (var _local9 in _local3) {
_local6[_local9] = (_local3[_local9] * (1 - _local5)) + (_local7[_local9] * _local5);
}
}
var _local4 = 0;
while (_local4 < autoShapes.length) {
autoShapes[_local4].draw();
_local4++;
}
if (_customStep == _customStepMax) {
_customPath = false;
_cf = _customEndFrame;
_customEndFunc();
}
} else {
super.onEnterFrame();
}
}
function getCurrentDataForShape(shapeName) {
return(frameLib[_cf][shapeName]);
}
function setActiveClips(arr) {
frameLib = [];
var _local5 = 1;
while (_local5 <= _totalframes) {
gotoAndStop(_local5);
var _local6 = {};
var _local3 = 0;
while (_local3 < arr.length) {
var _local2 = this[arr[_local3]];
_local6[arr[_local3]] = {_x:_local2._x, _y:_local2._y, _rotation:evalRotation(_local2._rotation, frameLib[_local5 - 1][arr[_local3]]._rotation), _xscale:_local2._xscale, _yscale:_local2._yscale};
_local3++;
}
frameLib[_local5] = _local6;
_local5++;
}
gotoAndStop(1);
}
function evalRotation(rot2, rot1) {
if (rot1 == undefined) {
return(rot2);
}
if ((rot2 - rot1) > 180) {
rot2 = rot2 - 360;
}
if ((rot2 - rot1) < -180) {
rot2 = rot2 + 360;
}
return(rot2);
}
function setAutoShapes(arr) {
autoShapes = arr;
}
function getFrameData() {
return(frameLib[_cf]);
}
function setFrame(frameNum) {
var _local4 = frameLib[frameNum];
for (var _local6 in _local4) {
var _local2 = _local4[_local6];
var _local3 = this[_local6];
for (var _local5 in _local2) {
_local3[_local5] = _local2[_local5];
}
}
for (var _local6 in autoShapes) {
autoShapes[_local6].draw();
}
_cf = frameNum;
}
function customPath(initFrame, endFrame, steps, endFunc) {
_animDir = 0;
_currPath = undefined;
_customPath = true;
_customStep = 0;
_customStepMax = steps;
_customStartFrame = initFrame;
_customEndFrame = endFrame;
_customEndFunc = endFunc;
}
var _customPath = false;
}
Symbol 845 MovieClip [__Packages.BasicHead] Frame 0
class BasicHead extends MovieClip
{
var animForm, top, jaw, eye, earShadow, ear, nose, hitForm, hitShapes, ox, _x, oy, _y, neckMarkers, _coordinator;
function BasicHead () {
super();
if (animForm == undefined) {
animForm = this;
}
top = animForm.top;
if (top == undefined) {
top = this;
}
if (topFrame != 1) {
top.gotoAndStop(topFrame);
}
jaw = animForm.jaw;
eye = top.eye;
earShadow = top.earShadow;
ear = top.ear;
nose = top.nose;
hitForm = animForm;
hitShapes = getHitShapes();
animForm.gotoAndStop(topFrame);
for (var _local3 in hitShapes) {
HitManager.addHitForm(hitShapes[_local3]);
}
setBasePos();
}
function setBasePos() {
ox = _x;
oy = _y;
}
function onEnterFrame() {
if (!isInit) {
init();
}
checkTug();
}
function init() {
isInit = true;
initAnimForms();
}
function initAnimForms() {
animForm.definePaths(["eat", "swallow", "ah1", "ah2", "sneeze", "fireYawn", "yawn"]);
animForm.setActiveClips(["top", "jaw", "m0", "m1", "m2", "m3", "m4", "m5", "p0", "p1", "p2", "p3", "p4", "p5"]);
initNeck();
animForm.mouthShape.setMarkers([animForm.p0, animForm.p1, animForm.p2, animForm.p3, animForm.p4, animForm.p5]);
animForm.setAutoShapes([animForm.mouthShape, animForm.neckShape]);
animForm.mouthShape.draw();
animForm.neckShape.draw();
var o = this;
animForm.onFrame = function () {
o._coordinator.reportEvent("move");
};
}
function initNeck() {
var _local2 = animForm;
neckMarkers = [_local2.m0, _local2.m1, _local2.m2, _local2.m3, _local2.m4, _local2.m5, _local2.m6, _local2.m7];
animForm.neckShape.setMarkers(neckMarkers);
}
function unlockNeck() {
neckLocked = false;
}
function lockNeck() {
neckLocked = true;
}
function updateNeck() {
if (neckLocked) {
return(undefined);
}
var _local2 = 1;
while (_local2 < 5) {
var _local3 = animForm.getCurrentDataForShape(neckMarkers[_local2]._name);
neckMarkers[_local2]._x = _local3._x - (tugX * ((_local2 == 4) ? 0.666666666666667 : 1));
neckMarkers[_local2]._y = _local3._y - (tugY * ((_local2 == 4) ? 0.666666666666667 : 1));
_local2++;
}
animForm.neckShape.draw();
}
function checkTug() {
var _local3 = tugX;
var _local2 = tugY;
if (!isTugging) {
tugX = tugX / 1.5;
tugY = tugY / 1.5;
}
if ((!neckLocked) && ((((isTugging || (Math.abs(_local3) > 0.5)) || (Math.abs(tugX) > 0.5)) || (Math.abs(_local2) > 0.5)) || (Math.abs(tugY) > 0.5))) {
_x = ox + tugX;
_y = (oy + tugY) + _yLift;
updateNeck();
}
}
function tug(x, y) {
tugX = x;
tugY = y;
isTugging = true;
_coordinator.setSurprise((Math.abs(tugX * 2) + 6) / 16);
}
function getHitShapes() {
return([top.mainShape, top.hatch.lid, jaw.mainShape, animForm.neckShape]);
}
function hitTest(x, y, boo) {
if (!hitForm.hitTest(x, y, false)) {
return(false);
}
if (hitForm.top.hitTest(x, y, boo)) {
return(true);
}
if (hitForm.jaw.hitTest(x, y, boo)) {
return(true);
}
if (hitForm.neckForm.hitTest(x, y, boo)) {
return(true);
}
}
var isTugging = false;
var tugX = 0;
var tugY = 0;
var _yLift = 0;
var topFrame = 1;
var isInit = false;
var neckLocked = false;
}
Symbol 813 MovieClip [__Packages.HitManager] Frame 0
class HitManager
{
function HitManager () {
}
static function addHitForm(obj) {
hitForms.push(obj);
var _local1 = hitForms.length - 1;
while (_local1 >= 0) {
if ((hitForms[_local1] == undefined) or (hitForms[_local1]._x == undefined)) {
hitForms.splice(_local1, 1);
}
_local1--;
}
}
static function removeHitForm(obj) {
var _local1 = hitForms.length - 1;
while (_local1 >= 0) {
if (hitForms[_local1] == obj) {
hitForms.splice(_local1, 1);
}
_local1--;
}
}
static var hitForms = [];
}
Symbol 846 MovieClip [__Packages.SmallHead] Frame 0
class SmallHead extends BasicHead
{
var attnMan, contentContainer, top, contentMask, hasChild, yawnClip, animForm, myParent, myGeneration, yawnSound, eye, isYawning, childHead, childHeadShell, _parent, isTugging, tugY;
function SmallHead () {
super();
attnMan = _root.processCoordinator.attentionManager;
contentContainer = top.contentContainer;
contentMask = top.contentMask;
contentMask._visible = false;
hasChild = false;
yawnClip = animForm;
}
function getHitShapes() {
return([]);
}
function config(p, generation) {
myParent = p;
myGeneration = generation;
yawnSound = "yawn" + (generation + 1);
attnMan.setActiveEye(eye, "smallHead" + generation);
var o = this;
var clicked = false;
top.clickZone.onPress = function () {
if (!o.headClickAllowed) {
return(undefined);
}
o.onClick();
if (o.myGeneration < o.maxHead) {
o.newHead();
} else if (!clicked) {
new DelayedEvent(o.myParent, 10, "initCollapse");
ViewMaster.setFrame("regular", 150);
}
clicked = true;
};
ViewMaster.setFrame("smallHead" + generation);
YawnTracker.addYawnTarget(myGeneration, this);
}
function initAnimForms() {
}
function updateNeck() {
}
function hatchAction() {
}
function introAction() {
}
function yawn(doNotNotify) {
SoundManager.playSound(yawnSound);
if (doNotNotify != true) {
YawnTracker.onYawn(myGeneration);
}
var o = this;
var yawnShut = function () {
new DelayedEvent(o.top.eye, 1, "open");
o.isYawning = false;
};
var _local2 = function () {
o.closeYawn(yawnShut);
};
openYawn(_local2);
top.eye.close();
isYawning = true;
}
function delayYawn(time) {
new DelayedEvent(this, time, "yawn", [true]);
}
function openYawn(callBack) {
yawnClip.forward(1, callBack, "yawn", true);
}
function closeYawn(callBack) {
yawnClip.reverse(1, callBack, "yawn", true);
}
function simpleYawn() {
animForm.play();
}
function initCollapse() {
contentMask._visible = true;
contentContainer.setMask(contentMask);
var _local2;
if (getHatchActionLength() > 0) {
_local2 = getHatchActionLength();
} else if (top.hatch == undefined) {
_local2 = 0;
} else {
_local2 = top.hatch._totalFrames - 1;
}
var _local3;
if (childHead.introActionOnCollapse) {
_local3 = childHead.getIntroActionLength(true);
childHead.introAction(true);
} else {
_local3 = childHeadShell.getTotalFrames(true) - 1;
}
doCollapse(0, _local2, _local3);
}
function doCollapse(counter, hf, tf) {
counter = counter + 2;
var _local3 = hf + tf;
if (counter > _local3) {
counter = _local3;
}
if (counter <= tf) {
childHeadShell.setOpen((_local3 - hf) - counter, true);
} else {
childHeadShell.setOpen(0, true);
setHatchFrame((_local3 - counter) + 1, true);
}
if (counter < _local3) {
new DelayedEvent(this, 1, "doCollapse", [counter, hf, tf]);
} else {
childHeadShell.removeMovieClip();
myParent.initCollapse();
}
}
function getIntroActionLength(collapseFlag) {
return(introActionLength);
}
function getHatchActionLength(collapseFlag) {
return(hatchActionLength);
}
function setHatchFrame(frameNum, collapseFlag) {
top.hatch.gotoAndStop(frameNum);
}
function newHead() {
if (hasChild) {
return(undefined);
}
hasChild = true;
childHeadShell = contentContainer.attachMovie(("smallHead" + (myGeneration + 1)) + "Shell", "lilhed", 0);
childHead = childHeadShell.headContainer.head;
new DelayedEvent(this, 1, "kickOffNewHead");
}
function kickOffNewHead() {
contentMask._visible = true;
contentContainer.setMask(contentMask);
childHead.config(this, myGeneration + 1);
var _local2;
if (getHatchActionLength() > 0) {
_local2 = getHatchActionLength();
hatchAction();
} else if (top.hatch == undefined) {
_local2 = 0;
} else {
_local2 = top.hatch._totalFrames - 1;
}
var _local3;
if (childHead.getIntroActionLength() != 0) {
_local3 = childHead.getIntroActionLength();
} else {
_local3 = childHeadShell.getTotalFrames() - 1;
}
new DelayedEvent(this, 1, "doOpen", [0, _local2, _local3]);
}
function doOpen(counter, hf, tf) {
counter++;
var _local4 = hf + tf;
if (counter <= hf) {
if (getHatchActionLength() == 0) {
setHatchFrame(counter + 1, false);
}
childHeadShell.setOpen(0);
} else {
if ((counter - hf) == 1) {
childHead.introAction();
}
childHeadShell.setOpen(counter - hf);
}
if (counter < _local4) {
new DelayedEvent(this, 1, "doOpen", [counter, hf, tf]);
} else {
contentContainer.setMask(null);
contentMask._visible = false;
}
}
function addYawnRotate(deg) {
_parent._parent._rotation = _parent._parent._rotation - deg;
}
function onEnterFrame() {
_parent._parent._rotation = 0;
yawnRotate = 0;
isTugging = true;
osc = osc + (((myGeneration / 5) + 1) / 60);
tugY = Math.sin(osc) * 3;
super.onEnterFrame();
if (isYawning) {
childHead.addYawnRotate(top._rotation);
}
}
function setOpen(count) {
animForm.gotoAndStop(count + 1);
}
var maxHead = 5;
var hatchActionLength = 0;
var introActionLength = 0;
var introActionOnCollapse = false;
var headClickAllowed = true;
var osc = 0;
var yawnRotate = 0;
}
Symbol 847 MovieClip [__Packages.YawnTracker] Frame 0
class YawnTracker
{
function YawnTracker () {
}
static function yawnOver() {
isCascading = false;
}
static function addYawnTarget(indx, obj) {
yawnTargets[indx] = obj;
if (yawnTargets.length == 5) {
new DelayedEvent(_root.processCoordinator.hintMaster, 600, "showHint", ["earLobe2"]);
new DelayedEvent(_root.processCoordinator.hintMaster, 660, "hideHint", ["earLobe2"]);
}
}
static function onYawn(indx) {
if (isCascading) {
return(undefined);
}
isCascading = true;
var _local4 = [];
var _local5 = yawnTargets.length;
var _local2 = 0;
while (_local2 < _local5) {
if ((_local2 != indx) && (yawnTargets[_local2]._width != undefined)) {
_local4.push(_local2);
}
_local2++;
}
if (_local4.length == 4) {
_root.processCoordinator.hintMaster.killHint("earLobe2");
}
_local5 = _local4.length;
_local2 = 0;
while (_local2 < _local5) {
indx = _local4.splice(0, 1)[0];
yawnTargets[indx].delayYawn((_local2 + 1) * 40);
_local2++;
}
new DelayedEvent(YawnTracker, _local5 * 40, "yawnOver");
}
static var yawnTargets = [];
static var isCascading = false;
}
Symbol 848 MovieClip [__Packages.SmallHeadRed] Frame 0
class SmallHeadRed extends SmallHead
{
var top, animForm, neckMarkers;
function SmallHeadRed () {
super();
}
function config(p, generation) {
super.config(p, generation);
top.clickZone.onRollOver = function () {
};
top.clickZone.onDragOut = (top.clickZone.onRollOut = function () {
});
var o = this;
top.ear.onPress = function () {
o.yawn();
};
top.eye.useHandCursor = true;
top.nose.useHandCursor = true;
setNoseEvent(this, top.nose);
setEyeEvent(this, top.eye);
}
function setNoseEvent(o, obj) {
var isPressed = false;
var isComplete = false;
obj.onPress = function () {
if (o.isYawning) {
return(undefined);
}
isPressed = true;
obj.onMouseUp = function () {
isPressed = false;
if (isComplete) {
onComplete();
}
};
o.isYawning = true;
var onTotallyComplete = function () {
o.isYawning = false;
};
var onComplete = function () {
isComplete = true;
if (isPressed) {
return(undefined);
}
isComplete = false;
o.eye.endSurprise();
obj.reverse(3, onTotallyComplete);
SoundManager.playSound("balloonDeflate");
};
SoundManager.playSound("balloonInflate");
obj.forward(1, onComplete);
o.eye.beginSurprise();
};
}
function setEyeEvent(o, obj) {
var isPressed = false;
var isComplete = false;
obj.onPress = function () {
if (o.isYawning) {
return(undefined);
}
isPressed = true;
obj.onMouseUp = function () {
isPressed = false;
if (isComplete) {
onComplete();
}
};
o.isYawning = true;
var tongueSound;
var onTotallyComplete = function () {
o.isYawning = false;
};
var onComplete = function () {
isComplete = true;
if (isPressed) {
return(undefined);
}
isComplete = false;
o.animForm.reverse(1, onTotallyComplete, "hey", true, true);
new DelayedEvent(o.eye, 12, "open");
SoundManager.fadeOutSound(tongueSound, 3);
};
tongueSound = SoundManager.playSound("tongueWet");
tongueSound.stop();
new DelayedEvent(tongueSound, 6, "start");
o.animForm.forward(1, onComplete, "hey", true, true);
o.eye.close();
};
}
function setHatchFrame(frameNum, collapseFlag) {
if (collapseFlag) {
return(undefined);
}
super.setHatchFrame(frameNum, collapseFlag);
}
function initAnimForms() {
animForm.definePaths(["yawn", "hey"]);
animForm.setActiveClips(["eyeTongue", "top", "jaw", "m0", "m1", "m2", "m3", "m4", "m5", "m6", "m7", "m8", "m9", "m10"]);
initNeck();
animForm.setAutoShapes([animForm.neckShape]);
animForm.neckShape.draw();
}
function initNeck() {
var _local2 = animForm;
neckMarkers = [_local2.m0, _local2.m1, _local2.m2, _local2.m3, _local2.m4, _local2.m5, _local2.m6, _local2.m7, _local2.m8, _local2.m9, _local2.m10];
animForm.neckShape.setMarkers(neckMarkers);
}
function setOpen(count) {
}
}
Symbol 849 MovieClip [__Packages.SmallHeadShell] Frame 0
class SmallHeadShell extends MovieClip
{
var _visible, stop, _totalframes, gotoAndStop, headContainer;
function SmallHeadShell () {
super();
_visible = false;
stop();
}
function setEmerge(frac) {
var _local2 = _totalframes;
setOpen(Math.floor(_local2 * frac) + 1);
}
function setOpen(counter) {
_visible = true;
gotoAndStop(counter + 1);
headContainer.head.setOpen(counter);
}
function getTotalFrames(collapseFlag) {
return(_totalframes);
}
var init = false;
}
Symbol 850 MovieClip [__Packages.LoadingMeter] Frame 0
class LoadingMeter extends MovieClip
{
var ox, _x, oy, _y, edgeArr, loadingMsg, __get__reload, _fading, _fadeCount, _alpha, _visible, _xscale, _yscale, fadeCallBack, loadCallBack, gotoAndStop, disc;
function LoadingMeter () {
super();
onEnterFrame = frameAction;
ox = _x;
oy = _y;
edgeArr = HeadShape.edgeArr;
}
function setLoad(frac) {
_loadFrac = frac;
}
function set reload(boo) {
loadingMsg._visible = !boo;
//return(__get__reload());
}
function onEnterFrame() {
}
function frameAction() {
if (_fading) {
_fadeCount++;
if (_fadeCount < 10) {
_alpha = 100 - ((_fadeCount / 10) * 100);
} else {
onEnterFrame = undefined;
_visible = false;
_xscale = (_yscale = 1);
_x = (_y = -100);
fadeCallBack();
}
} else {
_vizFrac = _vizFrac + (_global.testMode ? 0.1 : 0.01);
if (_vizFrac > _loadFrac) {
_vizFrac = _loadFrac;
}
_vizFrac = Math.round(_vizFrac * 1000) / 1000;
draw(_vizFrac);
if (_vizFrac >= 1) {
loadCallBack();
}
}
}
function reset(completionCallBack) {
_fading = false;
_alpha = 100;
_visible = true;
_vizFrac = 0;
_loadFrac = 1;
_xscale = (_yscale = 100);
_x = ox;
_y = oy;
gotoAndStop(1);
loadingMsg._visible = false;
loadCallBack = completionCallBack;
onEnterFrame = frameAction;
}
function draw(frac) {
_alpha = 100;
var _local3 = Math.round(frac * 100);
gotoAndStop(_local3 + 1);
var _local2 = edgeArr[_local3];
if (_local2 == undefined) {
_local2 = [0, 0];
}
var _local5 = _local2[0];
var _local4 = _local2[1];
disc._y = 525 - ((525 * _local3) / 100);
disc._x = (_local5 + _local4) / 2;
disc._width = _local4 - _local5;
disc._height = disc._width * (0.05 + (0.1 * (1 - (_local3 / 100))));
}
function isReady() {
return((_vizFrac >= 1) && (_loadFrac >= 1));
}
function kill(callBack) {
fadeCallBack = callBack;
_fading = true;
_fadeCount = 0;
}
var _loadFrac = 0;
var _vizFrac = 0;
}
Symbol 808 MovieClip [__Packages.HeadShape] Frame 0
class HeadShape
{
function HeadShape () {
}
static var edgeArr = [[116.88, 358.44], [116.88, 358.44], [116.88, 358.44], [115.56, 358.44], [114.68, 358.44], [114.68, 358.44], [113.8, 358.44], [112.92, 358.44], [111.6, 358.44], [110.72, 358.44], [108.96, 358.44], [105.88, 358.44], [102.8, 358.44], [98.84, 359.32], [84.76, 359.32], [55.72, 360.2], [44.72, 360.2], [40.76, 361.08], [36.8, 362.4], [35.92, 362.4], [35.92, 363.28], [35.92, 364.16], [36.8, 365.48], [38.56, 367.24], [39.88, 368.12], [39.88, 370.32], [39.88, 373.4], [37.68, 374.28], [34.6, 377.36], [31.52, 380.44], [27.56, 382.2], [26.68, 386.16], [28.88, 389.24], [29.76, 392.32], [27.56, 395.4], [29.76, 398.48], [31.52, 401.12], [34.6, 403.32], [36.8, 407.28], [37.68, 410.36], [36.8, 412.12], [34.6, 414.32], [24.92, 417.4], [5.56, 419.16], [1.6, 421.36], [0.72, 422.24], [0.72, 424.44], [0.72, 426.2], [1.6, 427.08], [2.92, 428.4], [4.68, 429.28], [6.88, 430.16], [8.64, 430.16], [10.84, 431.48], [14.8, 431.48], [16.56, 431.48], [19.64, 431.48], [21.84, 431.48], [24.92, 431.48], [26.68, 431.48], [28.88, 430.16], [29.76, 430.16], [31.52, 430.16], [30.64, 430.16], [26.68, 429.28], [21.84, 429.28], [18.76, 428.4], [17.88, 428.4], [17.88, 427.08], [19.64, 426.2], [20.96, 425.32], [22.72, 424.44], [23.6, 423.12], [26.68, 421.36], [28.88, 419.16], [30.64, 418.28], [32.84, 416.52], [34.6, 414.32], [37.68, 411.24], [39.88, 409.48], [40.76, 406.4], [43.84, 404.2], [45.6, 400.24], [48.68, 398.48], [51.76, 395.4], [53.52, 392.32], [56.6, 388.36], [61.88, 383.08], [63.64, 379.12], [67.6, 374.28], [72.88, 368.12], [75.52, 362.4], [81.68, 356.24], [86.96, 349.2], [92.68, 342.16], [99.72, 332.48], [106.76, 323.24], [116.88, 311.36], [131.84, 295.08], [151.64, 272.2]];
static var edgeArrNoNose = [[116.88, 358.44], [116.88, 358.44], [116.88, 358.44], [115.56, 358.44], [114.68, 358.44], [114.68, 358.44], [113.8, 358.44], [112.92, 358.44], [111.6, 358.44], [110.72, 358.44], [108.96, 358.44], [105.88, 358.44], [102.8, 358.44], [97.52, 359.32], [84.76, 359.32], [55.72, 360.2], [44.72, 360.2], [40.76, 361.08], [36.8, 362.4], [35.92, 362.4], [35.92, 363.28], [35.92, 364.16], [36.8, 365.48], [38.56, 367.24], [39.88, 368.12], [39.88, 370.32], [39.88, 373.4], [37.68, 374.28], [34.6, 377.36], [31.52, 380.44], [27.56, 382.2], [26.68, 386.16], [28.88, 389.24], [29.76, 392.32], [27.56, 395.4], [28.88, 398.48], [31.52, 401.12], [34.6, 403.32], [36.8, 407.28], [37.68, 410.36], [36.8, 412.12], [35.92, 414.32], [32.84, 417.4], [31.52, 419.16], [29.76, 421.36], [28.88, 422.24], [27.56, 424.44], [26.68, 426.2], [25.8, 427.08], [25.8, 428.4], [25.8, 429.28], [25.8, 430.16], [25.8, 430.16], [26.68, 431.48], [27.56, 431.48], [29.76, 431.48], [30.64, 431.48], [32.84, 431.48], [34.6, 431.48], [35.92, 431.48], [35.92, 430.16], [35.92, 430.16], [33.72, 430.16], [30.64, 430.16], [26.68, 429.28], [21.84, 429.28], [18.76, 428.4], [17.88, 428.4], [17.88, 427.08], [19.64, 426.2], [20.96, 425.32], [22.72, 424.44], [24.92, 423.12], [25.8, 421.36], [28.88, 419.16], [30.64, 418.28], [32.84, 416.52], [34.6, 414.32], [37.68, 411.24], [38.56, 409.48], [40.76, 406.4], [43.84, 404.2], [45.6, 400.24], [48.68, 398.48], [51.76, 395.4], [53.52, 392.32], [57.92, 388.36], [61.88, 383.08], [64.96, 379.12], [67.6, 374.28], [71.56, 368.12], [75.52, 362.4], [81.68, 356.24], [86.96, 349.2], [92.68, 342.16], [99.72, 332.48], [106.76, 323.24], [116.88, 311.36], [132.72, 295.08], [155.6, 272.2]];
}
Symbol 851 MovieClip [__Packages.Crest] Frame 0
class Crest extends ReversibleClip
{
var gotoAndStop, _totalframes;
function Crest () {
super();
var _local3 = 0;
while (_local3 < 6) {
var _local4 = this["plume" + _local3];
_local4.gotoAndPlay(frameNums[_local3]);
_local3++;
}
gotoAndStop(_totalframes);
}
var frameNums = [1, 9, 11, 3, 15, 7];
}
Symbol 852 MovieClip [__Packages.SmallHeadEagle] Frame 0
class SmallHeadEagle extends SmallHead
{
var top, animForm;
function SmallHeadEagle () {
super();
SoundManager.playSound("crack");
}
function config(p, generation) {
super.config(p, generation);
top.clickZone.onRollOver = function () {
};
setYawnEvent(this, top.nose);
setYawnEvent(this, top.eye);
}
function setYawnEvent(o, obj) {
obj.onPress = function () {
if (o.isYawning) {
return(undefined);
}
o.isYawning = true;
var endSquawk = function () {
o.isYawning = false;
o.eye.endSurprise();
};
var _local1 = function () {
new DelayedEvent(o.eye, 30, "releaseFixedCoordinates");
o.animForm.reverse(1, endSquawk, "yawn", true, true);
};
o.animForm.forward(3, _local1, "yawn", true, true);
o.eye.setFixedCoordinates(-17, 20);
o.eye.beginSurprise();
SoundManager.playSound("squawk", 200);
};
}
function initAnimForms() {
animForm.definePaths(["rise", "yawn"]);
}
}
Symbol 853 MovieClip [__Packages.SmallHeadShellEagle] Frame 0
class SmallHeadShellEagle extends SmallHeadShell
{
var _visible, gotoAndStop, headContainer;
function SmallHeadShellEagle () {
super();
}
function setOpen(frame, collapseFlag) {
_visible = true;
gotoAndStop((collapseFlag ? ((frameCount * 2) - frame) : (frame + 1)));
headContainer.head.setOpen(frame);
}
function getTotalFrames(collapseFlag) {
return(frameCount);
}
var frameCount = 25;
}
Symbol 854 MovieClip [__Packages.EyeShapeEyeBallKid] Frame 0
class EyeShapeEyeBallKid extends EyeShapeWithBlink
{
var outerPupil, pupil, isSurprised, forward, setFixedCoordinates, reverse, releaseFixedCoordinates;
function EyeShapeEyeBallKid () {
super();
outerPupil._visible = false;
}
function onEnterFrame() {
super.onEnterFrame();
var _local12 = 10;
var _local9 = 34.5;
var _local8 = pupil._x - _local12;
var _local7 = pupil._y;
var _local13 = Math.atan2(_local7, _local8);
var _local10 = Math.sqrt((_local8 * _local8) + (_local7 * _local7));
var _local11 = _local10 / _local9;
var _local6 = (_local11 * Math.PI) / 2;
var _local14 = Math.cos(_local6);
pupil._rotation = (_local13 / Math.PI) * 180;
var _local5 = (_local14 / 2) + 0.5;
pupil.form._xscale = 100 * _local5;
if (surprise > 0) {
pupil._visible = false;
outerPupil._visible = true;
outerPupil._x = pupil._x;
outerPupil._y = pupil._y;
outerPupil._rotation = pupil._rotation;
outerPupil.form._xscale = 100 * _local5;
var _local3 = 0;
while (_local3 < 8) {
var _local4 = outerPupil.form["disc" + _local3];
_local4._x = (((5 * _local3) * surprise) / _local5) * Math.sin(_local6);
_local3++;
}
} else {
outerPupil._visible = false;
pupil._visible = true;
}
}
function setSurprise(num) {
isSurprised = num > 0;
surprise = num;
}
function onPress() {
if (isSurprised) {
return(undefined);
}
forward(1, null, "surprise");
setFixedCoordinates(-110, 40);
doSurprise(0);
SoundManager.playSound("boing");
}
function doSurprise(count) {
count++;
var _local2 = 10;
var _local4 = Curves.easeOut(count / _local2);
setSurprise(_local4);
if (count < (_local2 * 2)) {
new DelayedEvent(this, 1, "doSurprise", [count]);
if (count == (_local2 + 4)) {
reverse(1, null, "surprise");
}
} else {
setSurprise(0);
releaseFixedCoordinates();
}
}
var lookShiftX = -100;
var lookShiftY = 30;
var surprise = 0;
}
Symbol 855 MovieClip [__Packages.SmallHeadEyeBallKid] Frame 0
class SmallHeadEyeBallKid extends SmallHead
{
var myParent, top, animForm;
function SmallHeadEyeBallKid () {
super();
SoundManager.playSound("rustle");
}
function config(p, generation) {
super.config(p, generation);
var _local5 = myParent.top.hatch.crest;
var _local3 = 0;
while (_local3 < 6) {
var _local4 = "plume" + _local3;
top.crest[_local4].gotoAndPlay(_local5[_local4]._currentFrame);
_local3++;
}
}
function initAnimForms() {
animForm.definePaths(["yawn"]);
}
function setOpen(count) {
}
}
Symbol 856 MovieClip [__Packages.MoonEyeShape] Frame 0
class MoonEyeShape extends EyeShape
{
var lookRad, _radius, spotsArr, spot0, spot1, spot2, spot3, spotDataArr, pupil, lastX, lastY;
function MoonEyeShape () {
super();
lookRad = _radius / 3;
spotsArr = [spot0, spot1, spot2, spot3];
spotDataArr = [];
var _local8 = spotsArr.length;
var _local3 = 0;
while (_local3 < _local8) {
var _local4 = spotsArr[_local3];
spotDataArr[_local3] = {x:_local4._x / 1.5, y:_local4._y / 1.5, scale:_local4._xscale};
_local3++;
}
pupil = {_x:0, _y:0};
}
function setSpotScales(s0, s1, s2, s3) {
spotScales[0] = s0;
spotScales[1] = s1;
spotScales[2] = s2;
spotScales[3] = s3;
}
function lookRun(x, y) {
super.lookRun(x, y);
var _local20 = spotsArr.length;
var _local21 = pupil._x;
var _local19 = pupil._y;
var _local4 = 0;
while (_local4 < _local20) {
var _local3 = spotsArr[_local4];
var _local12 = spotDataArr[_local4];
var _local16 = _local12.x;
var _local14 = _local12.y;
var _local10 = _local16 + _local21;
var _local9 = _local14 + _local19;
var _local5 = Math.atan2(_local9, _local10);
var _local18 = Math.sqrt((_local10 * _local10) + (_local9 * _local9));
var _local17 = _local18 / _radius;
var _local6 = (_local17 * Math.PI) / 2;
var _local11 = Math.sin(_local6) * _radius;
var _local7 = Math.cos(_local6);
if (_local7 < 0) {
_local3._visible = false;
} else {
_local3._visible = true;
}
var _local8 = spotScales[_local4];
var _local15 = (100 * _local7) * _local8;
var _local13 = 100 * _local8;
_local3.form._xscale = _local15;
_local3.form._yscale = _local13;
_local3.form.bgForm._x = ((-16 * Math.sin(_local6)) * 1) / (_local7 * _local8);
_local3._rotation = (_local5 / Math.PI) * 180;
_local3._x = _local11 * Math.cos(_local5);
_local3._y = _local11 * Math.sin(_local5);
_local4++;
}
}
function getLookState() {
return([lastX, lastY]);
}
var momentumFactor = 0.7;
var spotScales = [1, 1, 1, 1];
var dragFrac = 0.1;
}
Symbol 857 MovieClip [__Packages.SmallHeadMoon] Frame 0
class SmallHeadMoon extends SmallHead
{
var form, eye, clickZone, orbitMaster, swapDepths, watchPlanet, contentContainer, _parent, initEyeState;
function SmallHeadMoon () {
super();
SoundManager.playSound("crickets");
form.swapDepths(2);
eye.swapDepths(3);
clickZone.swapDepths(4);
orbitMaster = new OrbitMaster(this, 1000);
swapDepths(1000);
}
function onEnterFrame() {
orbitMaster.step();
if (watchPlanet._width == undefined) {
watchPlanet = orbitMaster.getRandomPlanet();
}
if (watchPlanet != false) {
eye.setFixedCoordinates(watchPlanet._x * 10, watchPlanet._y * 5);
} else {
eye.releaseFixedCoordinates();
}
if (!eyeInit) {
eye.setSpotScales(1, 1, 1, 0);
eyeInit = true;
}
if (eye.spot3._visible) {
contentContainer.swapDepths(5);
} else {
contentContainer.swapDepths(1);
}
super.onEnterFrame();
}
function config(p, g) {
super.config(p, g);
var o = this;
var _local3 = false;
form.onPress = function () {
o.addOrbit();
};
form.onRollOver = function () {
o.isRolledOver = true;
o.rollCount = 0;
};
form.onRollOut = (form.onDragOut = function () {
o.orbitMaster.shutDown();
o.isRolledOver = false;
});
}
function addOrbit() {
planetCount++;
var _local2 = _parent.attachMovie("smallPlanet", "sp" + planetCount, planetCount);
orbitMaster.addOrbit(_local2);
}
function introAction() {
eye.controlled = true;
new DelayedEvent(this, introActionLength, "endIntro");
}
function endIntro() {
eye.controlled = false;
}
function getHatchActionLength(collapseBoo) {
return((collapseBoo ? 0 : (hatchActionLength)));
}
function hatchAction() {
initEyeState = eye.getLookState();
eye.controlled = true;
doTilt(0);
}
function openYawn(callBack, counter) {
if (counter == undefined) {
counter = 0;
}
counter++;
var _local3 = Curves.easeOut(counter / counterMax);
eye.setSpotScales(1 * (1 - _local3), 1 * (1 - _local3), 1 + (_local3 / 2), topSpotScale);
if (counter == counterMax) {
callBack();
} else {
new DelayedEvent(this, 1, "openYawn", [callBack, counter]);
}
}
function closeYawn(callBack, counter) {
if (counter == undefined) {
counter = counterMax;
}
eye.setSpotScales(1, 1, 1, 1);
counter--;
var _local3 = Curves.easeOut(counter / counterMax);
eye.setSpotScales(1 * (1 - _local3), 1 * (1 - _local3), 1 + (_local3 / 2), topSpotScale);
if (counter == 0) {
callBack();
} else {
new DelayedEvent(this, 1, "closeYawn", [callBack, counter]);
}
}
function doTilt(counter) {
counter++;
if (counter <= hatchActionLength) {
var _local2 = Curves.scurve(counter / hatchActionLength);
topSpotScale = _local2;
eye.setSpotScales(1, 1, 1, topSpotScale);
eye.lookRun((initEyeState[0] * (1 - _local2)) + (targetEyeState[0] * _local2), (initEyeState[1] * (1 - _local2)) + (targetEyeState[1] * _local2));
new DelayedEvent(this, 1, "doTilt", [counter]);
} else if (counter < (hatchActionLength * 2)) {
new DelayedEvent(this, 1, "doTilt", [counter]);
} else {
eye.controlled = false;
}
}
var topSpotScale = 0;
var eyeInit = false;
var isRolledOver = false;
var isOrbiting = false;
var planetCount = 0;
var introActionLength = 30;
var hatchActionLength = 10;
var targetEyeState = [-60, 80];
var counterMax = 20;
}
Symbol 858 MovieClip [__Packages.OrbitMaster] Frame 0
class OrbitMaster
{
var orbits, midDepth, windSound;
function OrbitMaster (parentMc, mdDepth) {
orbits = [];
midDepth = mdDepth;
}
function getRandomPlanet() {
return(((orbits.length == 0) ? false : (orbits[random(orbits.length)]._planetMc)));
}
function getRandomGray() {
var _local3 = hexDigits.length;
var _local2 = hexDigits[random(_local3 - 4) + 4] + hexDigits[random(_local3)];
var _local4 = (_local2 + _local2) + _local2;
return("0x" + _local4);
}
function addOrbit(planetMc) {
if (orbits.length == 0) {
windSound = SoundManager.playSound("wind", 50, 9999);
SoundManager.fadeInSound(windSound, 30);
}
indx++;
if (indx == 100) {
indx = 0;
}
var _local8 = getRandomGray();
new Color(planetMc).setRGB(_local8);
var _local5 = 40 + random(40);
var _local7 = 6 + (random(12) / 2);
var _local3 = (Math.random() * Math.PI) / 12;
var _local4 = ((Math.random() * Math.PI) / 8) - 0.196349540849362;
var _local6 = (Math.random() + 0.5) / 90;
planetMc._width = (planetMc._height = _local7);
orbits.push(new Orbit(this, indx, planetMc, _local5, _local3, _local4, _local6));
}
function setDepth(planetMc, indx, dir) {
planetMc.swapDepths(((indx + 1) * dir) + midDepth);
}
function step() {
var _local3 = orbits.length;
var _local2 = 0;
while (_local2 < _local3) {
orbits[_local2].step();
_local2++;
}
}
function onComplete(orbit) {
var _local3 = orbits.length;
var _local2 = 0;
while (_local2 < _local3) {
if (orbits[_local2] == orbit) {
orbits.splice(_local2, 1);
}
_local2++;
}
if (_local3 == 1) {
SoundManager.fadeOutSound(windSound, 30);
}
}
function shutDown() {
SoundManager.fadeOutSound(windSound, 30);
var _local3 = orbits.length;
var _local2 = 0;
while (_local2 < _local3) {
orbits[_local2].forceFade();
_local2++;
}
}
var indx = 0;
var hexDigits = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
}
Symbol 859 MovieClip [__Packages.Orbit] Frame 0
class Orbit
{
var _counter, _manager, _indx, _planetMc, _orbitR, _tilt, _rotate, _speed, _orbitCount, fadeCounter, fadeOut;
function Orbit (manager, indx, planetMc, orbitR, tilt, rotate, speed) {
_counter = 0;
_manager = manager;
_indx = indx;
_planetMc = planetMc;
_orbitR = orbitR;
_tilt = tilt;
_rotate = rotate;
_speed = speed;
_orbitCount = 0;
drawStep(0);
}
function step() {
_counter = _counter + _speed;
_orbitR = _orbitR + 0.1;
_tilt = _tilt + 0.001;
if ((fadeCounter == 0) && (fadeOut == true)) {
onComplete();
} else {
if (_counter > 1) {
_counter = _counter - 1;
_orbitCount++;
}
if (((!fadeOut) && (_orbitCount == 2)) && (_counter > 0.6)) {
fadeOut = true;
fadeCounter = 1;
}
if (fadeOut) {
fadeCounter = fadeCounter - (_speed * 2);
if (fadeCounter < 0) {
fadeCounter = 0;
}
}
drawStep(_counter);
}
}
function forceFade() {
if (fadeOut) {
return(undefined);
}
fadeOut = true;
fadeCounter = 1;
}
function drawStep(frac) {
if (fadeOut) {
_planetMc._alpha = 100 * Curves.scurve(fadeCounter);
}
var _local3 = Math.sin((frac * Math.PI) * 2) * _orbitR;
var _local2 = ((-Math.cos((frac * Math.PI) * 2)) * Math.sin(_tilt)) * _orbitR;
var _local5 = (_local3 * Math.cos(_rotate)) + (_local2 * Math.sin(_rotate));
var _local4 = (_local2 * Math.cos(_rotate)) - (_local3 * Math.sin(_rotate));
_planetMc._x = _local5;
_planetMc._y = _local4;
var _local6 = ((Math.cos((_counter * Math.PI) * 2) > 0) ? -1 : 1);
_manager.setDepth(_planetMc, _indx, _local6);
}
function onComplete() {
_planetMc.removeMovieClip();
_manager.onComplete(this);
}
}
Symbol 860 MovieClip [__Packages.SmallHeadWorm] Frame 0
class SmallHeadWorm extends SmallHead
{
var lookRad, segmentObjArr, top, contentContainer, bubbleContainer, tongue, headClickAllowed, hasChild, yawnSound, attnMan, initState, _xmouse, _ymouse, newHead, myParent, rootForm, clear, lineStyle, currPt, rootMask, rootHead, lastDrawPt;
function SmallHeadWorm () {
super();
lookRad = 0;
segmentObjArr = [{x:50, y:-40, rotation:(Math.PI/4), span:19}, {x:90, y:-20, rotation:-0.785398163397448, span:19}, {x:30, y:-10, rotation:(Math.PI/4), span:19}];
top._visible = false;
contentContainer = bubbleContainer;
tongue = top.hatch.tongue;
top.clickZone = top;
headClickAllowed = false;
}
function introAction(collapseFlag) {
isIntroed = true;
if (collapseFlag != true) {
followMouse = false;
}
}
function setOpen(count) {
baseGrowth = count / 30;
if (!followMouse) {
runLook(firstLookState[0], firstLookState[1], 1);
}
if (count == introActionLength) {
followMouse = true;
}
}
function onClick() {
if (hasChild) {
return(undefined);
}
SoundManager.playSound(yawnSound);
}
function onEnterFrame() {
if (isIntroed) {
if (followMouse) {
if (rampUp < 30) {
rampUp++;
}
var _local2 = attnMan.getAttentionCoords(this);
runLook(_local2.x, _local2.y, Curves.scurve(rampUp / 30));
headClickAllowed = attnMan.attentionType != "mouse";
if (random(500) == 1) {
if (tongue._currentFrame == 1) {
tongue.play();
}
}
}
runForm();
}
}
function hatchAction() {
followMouse = false;
initState = [_xmouse, _ymouse];
doHatchAction(0);
top.hatch.forward(1);
}
function getHatchActionLength(collapseFlag) {
if (collapseFlag) {
return(0);
}
return(hatchActionLength);
}
function yawn() {
SoundManager.playSound(yawnSound);
hatchAction();
newHead();
}
function doHatchAction(counter) {
counter++;
var _local4 = counter / hatchActionLength;
if (_local4 > 1) {
_local4 = 1;
}
var _local2 = Curves.scurve(_local4);
if (counter <= hatchActionLength) {
runLook((targetState[0] * _local2) + (initState[0] * (1 - _local2)), (targetState[1] * _local2) + (initState[1] * (1 - _local2)), 1);
new DelayedEvent(this, 1, "doHatchAction", [counter]);
} else if (counter < (hatchActionLength * 2)) {
runLook(targetState[0], targetState[1], 1);
new DelayedEvent(this, 1, "doHatchAction", [counter]);
} else {
rampUp = 0;
followMouse = true;
top.hatch.reverse(1);
}
}
function setHatchFrame(frameNum, collapseFlag) {
}
function runLook(x, y, drag) {
var _local6 = -10;
var _local5 = -50;
var _local4 = x - _local6;
var _local3 = y - _local5;
var _local7 = Math.atan2(_local3, _local4);
var _local10 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
var _local2 = _local7 - lookRad;
while (_local2 > Math.PI) {
_local2 = _local2 - (Math.PI*2);
}
while (_local2 < -3.14159265358979) {
_local2 = _local2 + (Math.PI*2);
}
lookRad = lookRad + ((_local2 / 4) * drag);
var _local8 = Math.sqrt(_local10 / 400);
craneDist = (((_local8 * 75) - 35) * (drag / 2)) + (craneDist * (1 - (drag / 2)));
if (craneDist > 40) {
craneDist = 40;
}
if (!initFlag) {
craneDist = 100;
initFlag = true;
}
headX = (headX / 2) + ((_local6 + (craneDist * Math.cos(lookRad))) / 2);
headY = (headY / 2) + ((_local5 + (craneDist * Math.sin(lookRad))) / 2);
}
function runForm() {
var _local9 = myParent.eye.spot3;
var _local27 = _root.getGlobalCoords(_local9);
var _local11 = _root.getLocalCoords(this, _local27);
var _local6 = Curves.easeOut(baseGrowth);
var _local14 = headX - (5 * Math.cos(lookRad));
var _local13 = headY - (5 * Math.sin(lookRad));
var _local18 = _local11.x;
var _local17 = _local11.y;
doKinematics(_local14, _local13, _local18, _local17 - 2, lookRad, segmentObjArr);
var _local19 = segmentObjArr[0];
var _local15 = segmentObjArr[1];
var _local12 = segmentObjArr[2];
var _local23 = mergePoints({x:_local14, y:_local13}, _local19);
var _local22 = mergePoints(_local19, _local15);
var _local21 = mergePoints(_local15, _local12);
var _local20 = mergePoints(_local12, {x:_local18, y:_local17 + 28});
var _local8 = [{target:rootForm, pt:_local20}, {target:rootForm, cvPt:_local12, pt:_local21}, {target:this, cvPt:_local15, pt:_local22}, {target:this, cvPt:_local19, pt:_local23}, {target:this, cvPt:{x:_local14, y:_local13}, pt:{x:headX, y:headY}}];
rootForm.clear();
rootForm.lineStyle(7, 14726092, 100);
clear();
lineStyle(7, 14726092, 100);
currPt = {x:_local18, y:_local17 + 28};
var _local5 = [0, 0.25, 0.44, 0.63, 0.82, 1];
var _local10 = _local8.length;
var _local25 = 0;
var _local3 = 0;
while (_local3 < _local10) {
if (_local6 > _local5[_local3]) {
var _local4 = (_local6 - _local5[_local3]) / (_local5[_local3 + 1] - _local5[_local3]);
if (_local4 > 1) {
_local4 = 1;
}
drawSeg(_local8[_local3], _local4);
}
_local3++;
}
rootMask._x = _local11.x;
rootMask._y = _local11.y;
rootMask._rotation = _local9._rotation;
rootMask.disc._xscale = _local9._xscale;
rootMask.disc._yscale = _local9._yscale;
rootMask.disc.form._xscale = _local9.form._xscale;
rootMask.disc.form._yscale = _local9.form._yscale;
var _local7;
if (_local6 < _local5[2]) {
_local7 = rootHead;
top._visible = false;
} else {
_local7 = top;
rootHead._visible = false;
}
_local7._visible = true;
if (_local6 == 1) {
_local7._x = headX;
_local7._y = headY;
_local7.hatch._rotation = ((lookRad / Math.PI) * 180) + 180;
} else {
_local7._x = lastDrawPt.x;
_local7._y = lastDrawPt.y;
_local7.hatch._rotation = ((lastDrawPt.angle / Math.PI) * 180) + 180;
}
var _local16 = lookRad - (Math.PI/2);
var _local24 = ((Math.sin(_local16) > 0) ? 1 : -1);
top.hatch.eyeBall._y = 1 - ((5 * Math.cos(_local16)) * _local24);
top.hatch.eyeBall._yscale = 7 * Math.sin(_local16);
}
function drawSeg(segData, size) {
var _local5 = segData.target;
_local5.moveTo(currPt.x, currPt.y);
if (segData.cvPt == undefined) {
if (size == 1) {
_local5.lineTo(segData.pt.x, segData.pt.y);
} else {
var _local7 = currPt.x + ((segData.pt.x - currPt.x) * size);
var _local6 = currPt.y + ((segData.pt.y - currPt.y) * size);
_local5.lineTo(_local7, _local6);
lastDrawPt = {x:_local7, y:_local6, angle:Math.atan2(_local6 - currPt.y, _local7 - currPt.x)};
}
} else if (size == 1) {
_local5.curveTo(segData.cvPt.x, segData.cvPt.y, segData.pt.x, segData.pt.y);
} else {
var _local13 = new Between(currPt, segData.pt);
var _local17 = new Between(currPt, segData.cvPt);
var _local16 = _local13.getDistance();
var _local18 = _local13.getAngle();
var _local15 = _local17.getAngle();
var _local4 = _local18 - _local15;
if (_local4 > Math.PI) {
_local4 = _local4 - (Math.PI*2);
}
if (_local4 < -3.14159265358979) {
_local4 = _local4 + (Math.PI*2);
}
var _local8 = size * _local16;
var _local11 = _local15 + (_local4 * size);
var _local10 = _local8 * Math.cos(_local11);
var _local9 = _local8 * Math.sin(_local11);
var _local14 = (currPt.x + (((segData.cvPt.x - currPt.x) * size) * size)) + ((_local10 / 2) * (1 - size));
var _local12 = (currPt.y + (((segData.cvPt.y - currPt.y) * size) * size)) + ((_local9 / 2) * (1 - size));
var _local7 = currPt.x + _local10;
var _local6 = currPt.y + _local9;
_local5.curveTo(_local14, _local12, _local7, _local6);
lastDrawPt = {x:_local7, y:_local6, angle:Math.atan2(_local6 - _local12, _local7 - _local14)};
}
currPt = segData.pt;
}
function mergePoints(ptA, ptB) {
return({x:(ptA.x + ptB.x) / 2, y:(ptA.y + ptB.y) / 2});
}
function doKinematics(x, y, rootX, rootY, tipAngle, segArr) {
var _local3 = reach(segArr[0], x, y);
_local3 = reach(segArr[1], _local3.tx, _local3.ty);
_local3 = reach(segArr[2], _local3.tx, _local3.ty);
var _local4 = segArr[segArr.length - 1];
_local4.x = rootX;
_local4.y = rootY;
position(segArr[2], segArr[1]);
position(segArr[1], segArr[0]);
}
function reach(seg, x, y) {
var _local4 = x - seg.x;
var _local3 = y - seg.y;
var _local1 = Math.atan2(_local3, _local4);
seg.rotation = _local1;
var _local6 = x - (Math.cos(_local1) * seg.span);
var _local5 = y - (Math.sin(_local1) * seg.span);
return({tx:_local6, ty:_local5});
}
function position(segA, segB) {
var _local2 = segA.rotation;
segB.x = (segB.x / 2) + ((segA.x + (Math.cos(_local2) * segA.span)) / 2);
segB.y = (segB.y / 2) + ((segA.y + (Math.sin(_local2) * segA.span)) / 2);
}
var craneDist = 0;
var initFlag = false;
var introActionLength = 30;
var introActionOnCollapse = true;
var baseGrowth = 0;
var headX = 0;
var headY = 0;
var rampUp = 0;
var isIntroed = false;
var hatchActionLength = 16;
var targetState = [-70, -100];
var firstLookState = [-115, -168];
var followMouse = true;
}
Symbol 861 MovieClip [__Packages.SmallHeadCloud] Frame 0
class SmallHeadCloud extends SmallHead
{
var ball, _currentframe, ballCoords, newBall, setOpen, myParent, play;
function SmallHeadCloud () {
super();
_root.processCoordinator.attentionManager.setTarget(ball, 120);
}
function onEnterFrame() {
if ((_currentframe == 30) && (ballCoords == undefined)) {
ballCoords = {x:ball._x, y:ball._y + (getTotalTugY() / 2)};
}
if (ballCoords != undefined) {
ball._y = ballCoords.y - (getTotalTugY() / 2);
}
if (ballHasBeenPlucked) {
var _local3 = _root.getLocalCoords(ball, {x:newBall._x, y:newBall._y});
ball.form._x = _local3.x;
ball.form._y = _local3.y;
ball.form._width = newBall._width;
ball.form._height = newBall._height;
}
}
function getIntroActionLength(collapseFlag) {
if (collapseFlag) {
return(16);
}
return(introActionLength);
}
function introAction(collapseFlag) {
if (collapseFlag) {
setOpen = undefined;
}
}
function getTotalTugY() {
var _local3 = 0;
var _local2 = myParent;
while (_local2.tugY != undefined) {
_local3 = _local3 + _local2.tugY;
_local2 = _local2.myParent;
}
return(_local3);
}
function onClick() {
if (ballHasBeenPlucked) {
return(undefined);
}
play();
SoundManager.playSound("whoosh");
ballHasBeenPlucked = true;
newBall = _root.attachClip("draggable");
newBall.initShapeData("glowingBall");
newBall.hitSound = "click";
newBall.radius = 10;
var _local4 = _root.getGlobalCoords(this, {x:ball._x, y:ball._y});
newBall.setPos(_local4.x, _local4.y);
newBall.onPress();
newBall.effect = "birdDream";
newBall.shape.gotoAndPlay(ball.form._currentFrame);
var step = 0;
var maxCount = 3;
var b = newBall;
newBall.shape.onEnterFrame = function () {
if (step < maxCount) {
step++;
var _local2 = Curves.scurve(step / maxCount);
b.radius = (10 * (1 - _local2)) + (20 * _local2);
}
if (step == maxCount) {
this.onEnterFrame = undefined;
}
};
_root.processCoordinator.addEdible(newBall);
}
var ballHasBeenPlucked = false;
var introActionLength = 39;
var introActionOnCollapse = true;
}
Symbol 862 MovieClip [__Packages.Ground] Frame 0
class Ground extends MovieClip
{
var bumpArr, clear, lineStyle, beginFill, moveTo, lineTo;
function Ground () {
super();
bumpArr = [];
var _local5 = xScope / bumpFreq;
var _local3 = 0;
while (_local3 < _local5) {
var _local4 = (_local3 * bumpFreq) + random(5);
if (_local4 >= _local5) {
_local4 = _local4 - _local5;
}
bumpArr[_local4] = ((random(100) / 100) * 10) + 5;
_local3++;
}
_local3 = 0;
while (_local3 < xScope) {
if (bumpArr[_local3] == undefined) {
bumpArr[_local3] = 0;
}
_local3++;
}
}
function run(xShift, bsScl) {
baseScale = bsScl;
var _local2 = Math.ceil(xShift) - 1;
while (_local2 >= 0) {
bumpArr.splice(0, 0, bumpArr.splice(bumpArr.length - 1)[0]);
_local2--;
}
draw();
}
function draw() {
clear();
lineStyle(1, 0);
beginFill(0);
var _local3 = bumpArr.length;
moveTo(0, 0);
lineTo(0, getY(bumpArr[0], 0, _local3));
var _local2 = 0;
while (_local2 < _local3) {
if (bumpArr[_local2] > 0) {
lineTo(_local2, getY(bumpArr[_local2], _local2, _local3));
}
_local2++;
}
lineTo(xScope, getY(bumpArr[_local3 - 1], _local3 - 1, _local3));
lineTo(0, 0);
}
function getY(bumpHeight, indx, lngth) {
var _local2 = 2 * Curves.scurve(0.5 * (1 - Math.abs((indx - (lngth / 2)) / (lngth / 2))));
return(((-bumpHeight) * _local2) * baseScale);
}
var baseScale = 0;
var xScope = 600;
var bumpFreq = 40;
}
Symbol 863 MovieClip [__Packages.WheelTree] Frame 0
class WheelTree extends MovieClip
{
var wheelRotation, wheel, parentProcess, isReleased, ox, _xmouse, oy, _ymouse, getBounds, removeMovieClip;
function WheelTree () {
super();
wheelRotation = 0;
isPresent = true;
wheel.onPress = function () {
this.onMouseMove = function () {
SoundManager.playSound("plink");
this.onMouseMove = undefined;
this.play();
this._parent.play();
this._parent.isPressed = true;
this._parent.isReleased = true;
this._parent.ox = this._parent._xmouse - this._x;
this._parent.oy = this._parent._ymouse - this._y;
this.onMouseUp = function () {
this._parent.isPressed = false;
};
};
};
}
function onWheelComplete() {
isComplete = true;
wheel._visible = false;
var _local3 = _root.getGlobalCoords(wheel);
parentProcess.produceWheel(_local3.x, _local3.y);
}
function onEnterFrame() {
if (!isComplete) {
if (isReleased) {
wheel._x = _xmouse - ox;
wheel._y = _ymouse - oy;
} else {
wheelRotation = wheelRotation + 2;
wheel.frontWheel.form._rotation = wheelRotation;
wheel.backWheel.form._rotation = wheelRotation;
}
}
var _local3 = getBounds(_root);
if (_local3.xMin > _root.xMax) {
isPresent = false;
removeMovieClip();
}
}
static var isPresent = false;
var isComplete = false;
}
Symbol 864 MovieClip [__Packages.Spot] Frame 0
class Spot extends SuperClip
{
var discArr, _parent, colorIndexMax, onPress, onRollOver, lastDisc, attachClip;
function Spot () {
super();
discArr = [];
_parent.addSpot(this);
colorIndexMax = colorArr.length;
}
function _onRollOver() {
bloop();
}
function _onPress() {
bloop();
}
function reset() {
onPress = _onPress;
onRollOver = _onRollOver;
colorIndex = -1;
discArr = [];
lastDisc = undefined;
}
function bloop(silentFlag) {
colorIndex++;
if (colorIndex >= colorIndexMax) {
onRollOver = undefined;
onPress = undefined;
return(undefined);
}
var _local4 = attachClip("circle");
new Color(_local4).setRGB(colorArr[colorIndex]);
discArr.push(_local4);
var arr = discArr;
var count = 0;
var o = this;
_local4._x = (_local4._y = 25);
_local4.onEnterFrame = function () {
count++;
var _local4 = Curves.easeOut(count / 8);
this._xscale = (this._yscale = 100 * _local4);
if (count == 8) {
this.onEnterFrame = undefined;
var _local3 = arr.length;
if (arr[_local3 - 1] == this) {
var _local2 = _local3 - 2;
while (_local2 >= 0) {
arr[_local2].removeMovieClip();
arr.splice(_local2, 1);
_local2--;
}
if (o.colorIndex >= (o.colorArr.length - 1)) {
o._parent.spotDone(o);
this.removeMovieClip();
}
}
}
};
_local4.onEnterFrame();
if (silentFlag != true) {
SoundManager.playSound("thoomp");
}
}
var colorArr = [3368601, 3381708, 6710937, 6723891, 13651];
var colorIndex = -1;
}
Symbol 865 MovieClip [__Packages.Spots] Frame 0
class Spots extends MovieClip
{
var spotArr, active, spotsDone, _parent;
function Spots () {
super();
spotArr = [];
}
function addSpot(obj) {
spotArr.push(obj);
}
function grow(cascading) {
active = true;
if (cascading != true) {
growIndex = 0;
}
spotsDone = 0;
spotArr[growIndex].reset();
spotArr[growIndex].bloop();
growIndex++;
if (growIndex < spotArr.length) {
new DelayedEvent(this, random(3) + 1, "grow", [true]);
}
}
function spotDone() {
spotsDone++;
if (spotsDone == spotArr.length) {
_root.processCoordinator.reportEvent("spotsDone");
}
}
function shutDown() {
if (active != true) {
return(undefined);
}
active = false;
var _local3 = spotArr.length;
var _local2 = 0;
while (_local2 < _local3) {
spotArr[_local2].colorIndex = spotArr[_local2].colorIndexMax - 2;
spotArr[_local2].bloop(true);
_local2++;
}
SoundManager.playSound("thoomp");
new DelayedEvent(_parent, 10, "removeMovieClip", [this]);
}
var growIndex = 0;
}
Symbol 866 MovieClip [__Packages.FlameBit] Frame 0
class FlameBit extends MovieClip
{
var shape_mc, createEmptyMovieClip, myColor, endFunc, pc, pf, pr, pl, pb, _currentframe, _totalframes;
function FlameBit () {
super();
shape_mc = createEmptyMovieClip("shape_mc", 0);
myColor = colorArray[random(3)];
if (curveSwitch) {
ratio = ratio * 2;
}
}
function setEndEvent(evtfunc) {
endFunc = evtfunc;
}
function onEnterFrame() {
var _local3 = (pc._rotation / 180) * Math.PI;
var _local5 = pf._y - pc._y;
var _local4 = _local5 * ratio;
var _local2 = _local4 * Math.cos(_local3);
var _local6 = _local4 * Math.sin(_local3);
pr._x = pc._x + _local2;
pl._x = pc._x - _local2;
pr._y = pc._y + _local2;
pl._y = pc._y - _local2;
shape_mc.clear();
shape_mc.beginFill(myColor);
if (curveSwitch) {
shape_mc.moveTo(pf._x, pf._y);
shape_mc.curveTo(pr._x, pr._y, pb._x, pb._y);
shape_mc.curveTo(pl._x, pl._y, pf._x, pf._y);
} else {
shape_mc.moveTo(pf._x, pf._y);
shape_mc.lineTo(pr._x, pr._y);
shape_mc.lineTo(pb._x, pb._y);
shape_mc.lineTo(pl._x, pl._y);
shape_mc.lineTo(pf._x, pf._y);
}
if (_currentframe <= 10) {
shape_mc._alpha = (_currentframe / 10) * 100;
}
if (_currentframe == _totalframes) {
endFunc(this);
}
}
var colorArray = [16750899, 16764006, 16737792, 10040064];
var ratio = 0.25;
var curveSwitch = false;
}
Symbol 867 MovieClip [__Packages.Fire] Frame 0
class Fire extends MovieClip
{
var workArray, attachMovie;
function Fire () {
super();
workArray = [];
}
function refreshWorkArray() {
var _local3 = [];
var _local2 = 0;
while (_local2 < numStrands) {
_local3[_local2] = _local2;
_local2++;
}
_local2 = 0;
while (_local2 < numStrands) {
workArray.push(_local3.splice(random(_local3.length), 1));
_local2++;
}
}
function onEnterFrame() {
if (workArray.length == 0) {
refreshWorkArray();
}
if (active) {
makeBit(workArray.pop()[0]);
makeBit(workArray.pop()[0]);
counter++;
if (counter == numStrands) {
counter = 0;
}
}
}
function makeBit(indx) {
dpthInc++;
var _local2 = random(40) + 80;
var _local3 = attachMovie("flameBit", "flameBit" + dpthInc, dpthInc, {_x:5 * (indx - (numStrands / 2)), _xscale:_local2, _yscale:_local2});
_local3.setEndEvent(bitDie);
}
function bitDie(bitRef) {
bitRef.removeMovieClip();
}
var numStrands = 8;
var counter = 0;
var dpthInc = 0;
var active = true;
}
Symbol 868 MovieClip [__Packages.RenderShapeTrunk] Frame 0
class RenderShapeTrunk extends MovieClip
{
var _elementArr, clear, beginFill, lineStyle, curveTo, lineTo, moveTo, endFill, attachMovie;
function RenderShapeTrunk () {
super();
}
function getState() {
return(_elementArr);
}
function setState(elementArr, drawNodes) {
_elementArr = elementArr;
render(6, 13651, elementArr, drawNodes);
}
function render(lw, colr, ptArr, drawNodes) {
clear();
beginFill(colr);
lineStyle(lw, 13651, 100, false, null, "round", "round");
var _local3 = 0;
while (_local3 < ptArr.length) {
var _local2 = ptArr[_local3];
if (_local2.type == "cv") {
curveTo(_local2.cx, _local2.cy, _local2.x, _local2.y);
if (drawNodes) {
placeNode(_local2, lw / 2);
}
} else if (_local2.type == "ln") {
lineTo(_local2.x, _local2.y);
if (drawNodes) {
placeNode(_local2, lw / 2);
}
} else if (_local2.type == "mv") {
moveTo(_local2.x, _local2.y);
if (drawNodes) {
placeNode(_local2, lw / 2);
}
} else if (_local2.type == "breakFill") {
endFill();
beginFill(colr);
}
_local3++;
}
}
function placeNode(element, r) {
var _local3 = element.x;
var _local2 = element.y;
this["foot" + nodeCount] = attachMovie("circle", "foot" + nodeCount, dpth++, {_x:_local3, _y:_local2, _width:r * 2, _height:r * 2, _visible:false});
nodeCount++;
}
var dpth = 0;
var nodeCount = 0;
}
Symbol 869 MovieClip [__Packages.RenderShapeTree] Frame 0
class RenderShapeTree extends MovieClip
{
var _elementArr, attachMovie, createEmptyMovieClip;
function RenderShapeTree () {
super();
}
function getState() {
return(_elementArr);
}
function setState(elementArr, drawNodes) {
while (this["foot" + nodeCount] != undefined) {
nodeCount++;
}
_elementArr = elementArr;
for (var _local15 in elementArr) {
for (var _local14 in elementArr[_local15]) {
for (var _local13 in elementArr[_local15][_local14]) {
var _local2 = elementArr[_local15][_local14][_local13];
if (_local2.endNode && (drawNodes)) {
var _local6 = _local2.x;
var _local5 = _local2.y;
this["foot" + nodeCount] = attachMovie("circle", "foot" + nodeCount, dpth++, {_x:_local6, _y:_local5, _width:5, _height:5, _visible:false});
nodeCount++;
} else {
var _local3 = createEmptyMovieClip("clip" + (dpth++), dpth);
_local3.lineStyle(_local2.lw, _local2.color);
_local3.moveTo(_local2.initPt.x, _local2.initPt.y);
_local3.curveTo(_local2.midPt.x, _local2.midPt.y, _local2.endPt.x, _local2.endPt.y);
_local3._rotation = _local2.rotation;
_local3._x = _local2.x;
_local3._y = _local2.y;
}
}
}
}
}
var dpth = 0;
var nodeCount = 0;
}
Symbol 814 MovieClip [__Packages.Draggable] Frame 0
class Draggable extends MovieClip
{
var colr, shape, _yscale, _y, getBounds, _parent, r, _height, floorY, px, _x, py, shapeLinkageName, _width, attachMovie, _visible, _alpha, removeMovieClip, ox, _xscale, _xmouse, oy, _ymouse, drag, onPickup, _forceDir, _forceRate, _numForceFrames, dragX, dragY, onFrame, hitSound;
function Draggable () {
super();
init();
}
function getHitForms() {
return((shapeCollision ? (HitManager.hitForms) : ([])));
}
function setColor(rgb) {
colr = rgb;
new Color(this).setRGB(rgb);
}
function get lowerBounds() {
if (shape != undefined) {
return((_yscale / 100) * (shape.getBounds(this).yMax - shape._y));
}
return(getBounds(_parent).yMax - _y);
}
function preInit() {
}
function init() {
preInit();
r = (shape.fixedRadius ? (shape.radius) : (_height / 2));
floorY = _root.yMax - lowerBounds;
px = _x;
py = _y;
}
function initShapeData(shapeName, dataObj) {
shapeLinkageName = shapeName;
attachShape(shapeName);
shape.setState(dataObj);
init();
}
function getShapeData() {
return(shape.getState());
}
function set radius(num) {
r = num;
_height = (_width = r * 2);
floorY = _root.yMax - r;
//return(radius);
}
function get radius() {
return(r);
}
function attachShape(linkageId) {
shape = attachMovie(linkageId, "shape", 0);
}
function hide() {
hidden = true;
_x = (_y = 99999);
_visible = false;
}
function show() {
hidden = false;
_x = px;
_y = py;
_visible = true;
}
function fadeAway(max, endEvt) {
doFade(0, max, endEvt);
}
function doFade(counter, max, endEvt) {
_alpha = 100 * Curves.scurve(1 - (counter / max));
if (counter == max) {
endEvt(this);
} else {
new DelayedEvent(this, 1, "doFade", [counter + 1, max, endEvt]);
}
}
function onRemove() {
}
function remove() {
onRemove();
removeMovieClip();
}
function onPress(skipEvent) {
if (!inputLock) {
ox = _xmouse * (_xscale / 100);
oy = _ymouse * (_yscale / 100);
drag = true;
if (skipEvent != true) {
onPickup();
}
_root.processCoordinator.setAttentionTarget(this);
}
}
function onLetGo(obj) {
}
function onMouseUp() {
if (drag) {
onLetGo(this);
}
drag = false;
}
function get x() {
return(_x);
}
function get y() {
return(_y);
}
function onEnterFrame(forceDrag) {
if (passiveMode || (hidden)) {
return(undefined);
}
var _local10 = getHitForms();
var _local4 = px;
var _local5 = py;
var _local16 = _local4;
var _local15 = _local5;
if (doesRoll) {
var _local25 = shape._rotation;
shape._rotation = 0;
}
var _local19 = getMyBounds();
var _local22 = _local19.xMin;
var _local21 = _local19.xMax;
var _local29 = _local19.yMin;
var _local28 = _local19.yMax;
if (doesRoll) {
shape._rotation = _local25;
}
if (_forceMotion) {
drag = false;
vx = (_forceRate * Math.cos(_forceDir)) - (driftSpeed * driftFactor);
vy = _forceRate * Math.sin(_forceDir);
_numForceFrames--;
if (_numForceFrames == 0) {
_forceMotion = false;
}
}
if (drag or forceDrag) {
vx = 0;
vy = 0;
if (drag) {
if (snapToMouse) {
ox = ox / 2;
oy = oy / 2;
}
dragX = _root._xmouse - ox;
dragY = _root._ymouse - oy;
}
if (dragY > floorY) {
dragY = floorY;
}
var _local18 = dragX;
var _local17 = dragY;
var _local9 = _local18 - _local4;
var _local8 = _local17 - _local5;
var _local11 = Math.atan2(_local8, _local9);
var _local7 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
var _local3 = checkHit(_local10, _local4, _local5);
var _local12 = 0;
while (((_local3.hit == false) && (_local7 > 0.001)) && (_local12 < 3)) {
_local12++;
var _local6 = (slowMode ? 4 : (dragSpeed));
if (_local6 > _local7) {
_local6 = _local7;
}
_local4 = _local4 + (Math.cos(_local11) * _local6);
_local5 = _local5 + (Math.sin(_local11) * _local6);
_local3 = checkHit(_local10, _local4, _local5);
_local9 = _local18 - _local4;
_local8 = _local17 - _local5;
_local7 = Math.sqrt((_local9 * _local9) + (_local8 * _local8));
}
var _local13 = 0;
while ((_local3.hit == true) && (_local13 < 20)) {
_local13++;
_local4 = _local4 - Math.cos(_local3.hitAngle);
_local5 = _local5 - Math.sin(_local3.hitAngle);
_local3 = checkHit(_local10, _local4, _local5);
}
vx = _local4 - _local16;
vy = _local5 - _local15;
} else if (!controlled) {
vy = vy + grav;
vx = vx * airDrag;
vy = vy * airDrag;
var _local20 = Math.sqrt((vx * vx) + (vy * vy));
if (_local20 > dragSpeed) {
var _local23 = dragSpeed / _local20;
vx = vx * _local23;
vy = vy * _local23;
}
_local5 = _local5 + vy;
_local4 = _local4 + (vx + (driftSpeed * driftFactor));
var _local26 = false;
if (_local5 > floorY) {
var _local14 = (_local5 - floorY) / vy;
_local5 = floorY;
if (vy > Math.abs(grav)) {
vy = vy * (-bounceFactor);
vy = vy + ((2 * grav) * _local14);
if (vy > 0) {
_local5 = floorY;
vy = 0;
} else {
_local5 = floorY + (vy * _local14);
}
_local4 = _local4 - (vx * _local14);
vx = vx * 0.5;
_local4 = _local4 + (vx * _local14);
_local26 = true;
onGroundHit(true, _local14);
} else {
vy = 0;
_local4 = _local4 - (vx * _local14);
vx = vx * 0.5;
_local4 = _local4 + (vx * _local14);
onGroundHit(false, _local14);
}
}
if (Math.abs(vx) < 0.1) {
vx = 0;
}
var _local3 = checkHit(_local10, _local4, _local5);
var _local27 = _local3.hitAngle;
var _local13 = 0;
while ((_local3.hit == true) && (_local13 < 5)) {
_local13++;
_local4 = _local4 - Math.cos(_local3.hitAngle);
_local5 = _local5 - Math.sin(_local3.hitAngle);
_local3 = checkHit(_local10, _local4, _local5, _local3.hitRange);
vx = _local4 - _local16;
vy = _local5 - _local15;
}
}
if ((_local4 + _local22) < _root.xMin) {
if (onScreen) {
var _local24 = _local4;
_local4 = _root.xMin - _local22;
vx = ((vx * (-bounceFactor)) + (_local4 - _local24)) - (driftSpeed * driftFactor);
}
} else {
onScreen = true;
}
if ((_local4 + _local21) > _root.xMax) {
var _local24 = _local4;
_local4 = _root.xMax - _local21;
vx = ((vx * (-bounceFactor)) + (_local4 - _local24)) - driftSpeed;
}
if (_local5 == floorY) {
if (doesRoll) {
rollV = (vx / ((r * Math.PI) * 2)) * 360;
}
if (Math.abs(vx) > 5) {
vy = (((-random(100)) / 100) * Math.abs(vx)) * 2;
}
} else if (doesRoll) {
rollV = rollV * 0.99;
}
if (doesRoll) {
shape._rotation = shape._rotation + rollV;
}
setPos(_local4, _local5);
onFrame();
}
function getMyBounds() {
var _local2;
if (shape != undefined) {
_local2 = shape.getBounds(this);
} else {
_local2 = getBounds(this);
}
for (var _local3 in _local2) {
_local2[_local3] = _local2[_local3] * (shape._yscale / 100);
_local2[_local3] = _local2[_local3] * (_yscale / 100);
}
return(_local2);
}
function dragTo(x, y) {
dragX = x;
dragY = y;
}
function setPos(x, y) {
px = x;
py = y;
_x = x;
_y = y;
updateAfterEvent();
}
function onGroundHit(hardHit) {
if ((hitSound != undefined) && (hardHit)) {
SoundManager.playSound(hitSound);
}
}
function checkHit(hitForms, x, y, hitRange) {
if (hitForms.length == 0) {
return({hit:false});
}
var _local8 = [];
var _local11 = _x;
var _local10 = _y;
_x = x;
_y = y;
for (var _local2 in hitForms) {
if (hitForms[_local2].hitTest(this)) {
_local8.push(hitForms[_local2]);
}
}
_x = _local11;
_y = _local10;
if (_local8.length == 0) {
return({hit:false});
}
var _local13;
var _local4 = [];
if (hitRange == undefined) {
hitRange = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
}
var _local9 = [];
var _local16 = hitRange[0];
var _local15 = hitRange[1];
while (hitRange.length > 0) {
var _local2 = hitRange.pop();
var _local3 = 0.523598775598299 * _local2;
if (checkAngle(_local8, x, y, _local3, r)) {
_local4.push({x:r * Math.cos(_local3), y:r * Math.sin(_local3)});
_local9.push(_local2);
}
}
if (_local4.length == 0) {
return({hit:false});
}
var _local7 = {x:0, y:0};
var _local5 = _local4.length;
var _local2 = 0;
while (_local2 < _local5) {
_local7.x = _local7.x + (_local4[_local2].x / _local5);
_local7.y = _local7.y + (_local4[_local2].y / _local5);
_local2++;
}
_local13 = Math.atan2(_local7.y, _local7.x);
return({hit:true, hitAngle:_local13, hitRange:_local9});
}
function checkBasicHit(hitForms) {
for (var _local3 in hitForms) {
if (hitForms[_local3].hitTest(this)) {
return(true);
}
}
return(false);
}
function checkSimpleHit(hitForms, x, y) {
var _local4 = r * 1.5;
var _local2 = 0;
while (_local2 < 8) {
var _local3 = (Math.PI/4) * _local2;
if (checkAngle(hitForms, x, y, _local3, _local4)) {
return(true);
}
_local2++;
}
return(false);
}
function checkAngle(hitForms, ix, iy, ang, thisR) {
var _local3 = ix + (thisR * Math.cos(ang));
var _local2 = iy + (thisR * Math.sin(ang));
for (var _local4 in hitForms) {
if (hitForms[_local4].hitTest(_local3, _local2, false)) {
if (hitForms[_local4].hitTest(_local3, _local2, true)) {
return(true);
}
}
}
return(false);
}
function forceMotion(dir, rate, numFrames) {
_forceMotion = true;
_numForceFrames = numFrames;
if (_numForceFrames == undefined) {
_numForceFrames = 1;
}
_forceRate = rate;
_forceDir = dir;
}
var grav = 1;
var vx = 0;
var vy = 0;
var slowMode = false;
var inputLock = false;
var controlled = false;
var bounceFactor = 0.3;
var doesRoll = false;
var rollV = 0;
var airDrag = 0.96;
var dragSpeed = 16;
var shapeCollision = false;
var onScreen = true;
static var driftSpeed = 0;
var driftFactor = 1;
var hidden = false;
var passiveMode = false;
var snapToMouse = false;
var _forceMotion = false;
}
Symbol 870 MovieClip [__Packages.Feather] Frame 0
class Feather extends Draggable
{
var sx, _x, shape, createEmptyMovieClip, contactAxes, _y, isFloating, currSide;
function Feather () {
super();
sx = _x;
}
function preInit() {
shape = createEmptyMovieClip("shape", 0);
contactAxes = [];
var _local2 = 0;
while (_local2 < widths.length) {
contactAxes[_local2] = {width:widths[_local2], pts:[{}, {}], parent:contactAxes[_local2 - 1]};
evalAxis(_local2, baseAngle);
_local2++;
}
draw();
}
function onEnterFrame() {
super.onEnterFrame();
run();
}
function checkBrush() {
var _local6 = 0;
var _local7;
var _local5 = [_root.head.top.noseContainer];
var _local4 = contactAxes.length - 1;
while (_local4 >= 0) {
var _local9 = contactAxes[_local4].width;
var _local10 = contactAxes[_local4].angle;
var _local3 = 0;
while (_local3 < 2) {
for (var _local8 in _local5) {
if (_local5[_local8].hitTest(_x + contactAxes[_local4].pts[_local3].x, _y + contactAxes[_local4].pts[_local3].y, true)) {
_local6 = _local6 + ((_local3 - 0.5) * 2);
_local7 = true;
}
}
_local3++;
}
_local4--;
}
if (_local7) {
var _local12 = ((_local6 == 0) ? 1 : (Math.abs(_local6) / _local6));
return({hitResult:true, side:_local12});
}
return({hitResult:false});
}
function sweep(startAngle, sweepRange, smooth) {
var _local10 = bendAngle;
var _local4 = 1;
var _local3 = 0.5;
var _local7 = bendAngle;
while (_local4 < 9) {
bendAngle = startAngle + (sweepRange * _local3);
setAngle(bendAngle);
var _local2 = checkBrush();
_local4++;
var _local6 = ((_local2.hitResult == false) ? -1 : 1);
if (_local2.hitResult == false) {
_local7 = bendAngle;
}
var _local5 = 1 / Math.pow(2, _local4);
_local3 = _local3 + (_local5 * _local6);
}
bendAngle = _local7;
if (smooth) {
bendAngle = (bendAngle + _local10) / 2;
}
setAngle(bendAngle);
}
function run() {
var _local4 = _x - sx;
var _local5 = checkBrush();
var _local7 = _local5.hitResult;
if (_local7) {
var _local6 = (((bendAngle == 0) || (isFloating)) ? (_local5.side) : (currSide));
currSide = _local6;
var _local3 = bendAngle;
var _local8 = (maxBendAngle * _local6) - _local3;
isFloating = false;
sweep(_local3, _local8, true);
_root.processCoordinator.sneezeProcess.tickle(Math.abs(_local4) / 2);
} else {
isFloating = true;
baseAngle = ((baseAngle - (((_local4 / dragSpeed) * Math.PI) / 8)) / 2) - 0.392699081698724;
sweep(0, bendAngle, true);
}
if (Math.abs(bendAngle) < 0.001) {
bendAngle = 0;
}
draw();
sx = _x;
}
function setAngle(ang) {
var _local2 = 0;
while (_local2 < contactAxes.length) {
evalAxis(_local2, baseAngle + ((_local2 + 1) * ang));
_local2++;
}
}
function draw() {
shape.clear();
shape.beginFill(16776960);
shape.lineStyle(2, 16776960);
shape.moveTo(contactAxes[0].pts[0].x, contactAxes[0].pts[0].y);
var _local3 = contactAxes.length;
var _local2 = 2;
while (_local2 < _local3) {
curveToPt(shape, contactAxes[_local2 - 1].pts[0], contactAxes[_local2].pts[0]);
_local2++;
}
curveToPt(shape, contactAxes[_local3 - 1].pts[0], contactAxes[_local3 - 1].pts[1]);
_local2 = _local3 - 1;
while (_local2 >= 1) {
curveToPt(shape, contactAxes[_local2].pts[1], contactAxes[_local2 - 1].pts[1]);
_local2--;
}
lineToPt(shape, contactAxes[0].pts[1]);
lineToPt(shape, contactAxes[0].pts[0]);
shape.endFill();
}
function lineToPt(mc, pt) {
mc.lineTo(pt.x, pt.y);
}
function curveToPt(mc, pt1, pt2) {
mc.curveTo(pt1.x, pt1.y, (pt1.x + pt2.x) / 2, (pt1.y + pt2.y) / 2);
}
function evalAxis(indx, pointAng) {
var _local2 = contactAxes[indx];
_local2.angle = pointAng;
var _local6 = _local2.width;
var _local4 = 0;
var _local3 = 0;
if (_local2.parent != undefined) {
_local4 = _local2.parent.x + (12 * Math.cos(pointAng));
_local3 = _local2.parent.y + (12 * Math.sin(pointAng));
}
var _local5 = pointAng + (Math.PI/2);
_local2.x = _local4;
_local2.y = _local3;
_local2.pts[0].x = _local4 + (Math.cos(_local5) * _local6);
_local2.pts[0].y = _local3 + (Math.sin(_local5) * _local6);
_local2.pts[1].x = _local4 - (Math.cos(_local5) * _local6);
_local2.pts[1].y = _local3 - (Math.sin(_local5) * _local6);
}
var widths = [0, 0, 5, 10, 12, 13, 12, 10, 5];
var baseAngle = -0.785398163397448;
var maxBendAngle = 0.523598775598299;
var dragSpeed = 16;
var bendAngle = 0;
}
Symbol 871 MovieClip [__Packages.Window] Frame 0
class Window extends ReversibleClip
{
var dynamicMask, staticMask, useHandCursor, definePaths, rollClip, currState, _parentProcess, _contentName, _clipName, _maskType, leftShape, leftHingeBottom, leftHingeTop, leftTop, leftBottom, rightShape, rightHingeBottom, rightHingeTop, rightTop, rightBottom, contentMask, _currentframe, gotoFrame, contentClip, attachClip, _active, __get__active, _forced, reverse, gotoEndOfPath, forward, _animDir;
function Window () {
super();
dynamicMask._visible = false;
staticMask._visible = false;
useHandCursor = true;
new DelayedEvent(this, 1, "initDraw");
active = (false);
definePaths(["fade", "open"]);
rollClip.onRollOver = function () {
};
currState = "waiting";
}
function setParentProcess(parentProcess) {
_parentProcess = parentProcess;
}
function setContent(nm, clipName, mskType) {
_contentName = nm;
_clipName = clipName;
_maskType = mskType;
}
function initDraw() {
leftShape.setMarkers([leftHingeBottom, leftHingeTop, leftTop, leftBottom]);
rightShape.setMarkers([rightHingeBottom, rightHingeTop, rightTop, rightBottom]);
contentMask.setMarkers([rightHingeBottom, rightBottom, rightTop, rightHingeTop, leftHingeTop, leftTop, leftBottom, leftHingeBottom]);
onFrame();
}
function init() {
if (_currentframe == 1) {
gotoFrame(2);
}
contentClip.cleanUp();
contentClip.removeMovieClip();
dynamicMask._visible = false;
staticMask._visible = false;
contentClip = attachClip(_clipName);
contentMask = this[_maskType + "Mask"];
contentMask._visible = true;
contentClip.setMask(contentMask);
new DelayedEvent(this, 1, "initDraw");
}
function set active(boo) {
_active = boo;
useHandCursor = boo;
if (boo) {
} else {
_onRollOut();
}
//return(__get__active());
}
function onMouseMove() {
if (_active) {
if (rollClip.hitTest(_root._xmouse, _root._ymouse, true)) {
if (!rolledOver) {
rolledOver = true;
_onRollOver();
}
} else if (rolledOver) {
rolledOver = false;
if (!_forced) {
_onRollOut();
}
}
}
}
function onMouseDown() {
if (rolledOver) {
_onPress();
}
}
function onFadeIn() {
currState = "ready";
if ((knockCount == 3) || (_forced)) {
openWindow();
} else if (!rolledOver) {
reverse(1, mx.utils.Delegate.create(this, onFadeOut), "fade");
}
}
function onFadeOut() {
currState = "waiting";
knockCount = 0;
}
function onWindowOpen() {
currState = "open";
contentClip.onOpen();
_forced = false;
}
function onWindowShut() {
currState = "ready";
contentClip.removeMovieClip();
if (!rolledOver) {
gotoEndOfPath("fade");
reverse(1, mx.utils.Delegate.create(this, onFadeOut), "fade");
}
}
function onContentComplete() {
contentClip.cleanUp();
closeWindow();
}
function _onRollOver() {
if ((currState == "waiting") || (currState == "fading")) {
forward(1, mx.utils.Delegate.create(this, onFadeIn), "fade");
}
}
function _onRollOut() {
if ((currState == "ready") || (currState == "fading")) {
reverse(1, mx.utils.Delegate.create(this, onFadeOut), "fade");
}
}
function _onPress() {
if ((currState == "ready") || (currState == "fading")) {
knockCount++;
_parentProcess.reportEvent("windowKnock");
showKnock();
if (knockCount == 3) {
openWindow();
}
}
}
function openWindow() {
currState = "opening";
knockCount = 0;
init();
forward(1, mx.utils.Delegate.create(this, onWindowOpen), "open");
_parentProcess.reportEvent("windowOpening");
}
function closeWindow() {
currState = "opening";
reverse(1, mx.utils.Delegate.create(this, onWindowShut), "open");
}
function activateMask() {
maskActive = _animDir == 1;
if (!maskActive) {
contentMask.clear();
}
}
function forceOpen() {
_forced = true;
if (currState == "waiting") {
forward(1, mx.utils.Delegate.create(this, onFadeIn), "fade");
} else if (currState == "ready") {
openWindow();
}
_parentProcess.reportEvent("windowForcedOpen");
}
function onEvent(evtName) {
_parentProcess.onEvent(evtName);
}
function get content() {
return(contentClip);
}
function onFrame() {
contentClip.onFrame(_currentframe);
leftShape.draw(1, 13651);
rightShape.draw(1, 13651);
if (maskActive) {
contentMask.draw(1, 13651);
}
}
function showKnock() {
var _local2 = attachClip("knockFlash");
_local2.onDone = function () {
this.removeMovieClip();
};
SoundManager.playSound("knock", 25);
}
var maskActive = false;
var knockCount = 0;
var rolledOver = false;
}
Symbol 872 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 873 MovieClip [__Packages.BallTracker] Frame 0
class BallTracker extends SuperClip
{
var _ballData, attentionSet, ballClickInits, contentYMax, onMouseDown, _ballArr, _ballColors, parentProcess, newClip;
function BallTracker () {
super();
}
function begin() {
_ballData = [];
attentionSet = false;
ballClickInits = [false, false, false];
var _local3 = 0;
while (_local3 < 3) {
_ballData[_local3] = {};
_local3++;
}
contentYMax = 400;
onMouseDown = function () {
this.onStageClick(_root._xmouse, _root._ymouse);
};
}
function findNearestBall(x, y) {
var _local9;
var _local10 = false;
var _local5 = 0;
while (_local5 < 3) {
var _local4 = _ballArr[_local5];
if (_local4._visible) {
var _local8 = _root.getGlobalCoords(_local4);
var _local7 = _local8.x - x;
var _local6 = _local8.y - y;
var _local3 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
if (((_local3 < _local9) || (_local9 == undefined)) && (_local3 < 50)) {
_local9 = _local3;
_local10 = _local4;
}
}
_local5++;
}
return(_local10);
}
function getBallCount() {
return(_root.processCoordinator.tentBallCount);
}
function onStageClick(x, y) {
var _local5 = findNearestBall(x, y);
if (_local5 == false) {
return(undefined);
}
var _local6 = _local5.indx;
var _local3 = _ballData[_local6];
var _local4 = instantiateDraggableBall(_local3.coords.x, _local3.coords.y, _local3.vx, _local3.vy, _local3.radius, _ballColors[_local6], _root.processCoordinator.tentBallEffects[_local6]);
_local3.mc.removeMovieClip();
_local3.mc = _local4;
_local3.draggable = true;
_local4.onPress();
_local4.snapToMouse = true;
parentProcess.removeBall(_local5);
parentProcess.reportEvent("tentBallPluck");
var _local7 = getBallCount();
if (_local7 == 0) {
parentProcess.reportEvent("tentBallAllPlucked");
}
_root.processCoordinator.setAttentionTarget(_local4);
}
function run(ballArr, ballColors, showBalls) {
_ballArr = ballArr;
_ballColors = ballColors;
var _local4 = 0;
while (_local4 < 3) {
var _local5 = ballArr[_local4];
if ((_local5 != undefined) and (ballClickInits[_local4] == false)) {
if (!attentionSet) {
attentionSet = true;
_root.processCoordinator.setAttentionTarget(_local5);
}
var _local9 = this;
_local5.indx = _local4;
}
var _local6 = {x:0, y:0};
_root.getGlobalCoords(_local5, _local6);
var _local3 = _ballData[_local4];
_local3.vx = _local6.x - _local3.coords.x;
_local3.vy = _local6.y - _local3.coords.y;
var _local8 = _local5.getBounds(this);
_local3.radius = (_local8.xMax - _local8.xMin) / 2;
_local3.coords = _local6;
if (showBalls) {
if ((ballArr[_local4]._visible && (ballArr[_local4].marked != true)) && (ballArr[_local4].age > 3)) {
if (_local3.mc == undefined) {
_local3.mc = makeBall(this, ballColors[_local4]);
_local3.mc.passiveMode = true;
}
_local5 = _local3.mc;
_local5.radius = _local3.radius;
_local5.setPos(_local3.coords.x, _local3.coords.y);
_local5.vx = _local3.vx;
_local5.vy = _local3.vy;
} else if ((_local3.mc != undefined) && (_local3.draggable != true)) {
_local3.mc.removeMovieClip();
_local3.mc = undefined;
}
}
_local4++;
}
}
function makeBall(stage, colr) {
var _local1 = stage.attachClip("draggable");
_local1.grav = 0.5;
_local1.bounceFactor = 0.5;
_local1.initShapeData("circle");
_local1.hitSound = "click";
_local1.setColor(colr);
return(_local1);
}
function conclude(ballArr, ballColors) {
onMouseDown = undefined;
}
function instantiateDraggableBall(x, y, vx, vy, r, ballColor, effect) {
var _local3 = makeBall(_root, ballColor);
_local3.radius = r;
_local3.setPos(x, y);
_local3.vx = vx;
_local3.vy = vy;
_local3.effect = effect;
_root.processCoordinator.addEdible(_local3);
_local3.swapDepths(_root.foreDepth);
kickOffEndProcess(_local3, 20, 3);
return(_local3);
}
function kickOffEndProcess(ballMc, targetR, maxCount) {
var rad = ballMc.radius;
var step = 0;
var pp = parentProcess;
var _local5 = newClip(this);
var yMax = contentYMax;
_local5.onEnterFrame = function () {
if (step < maxCount) {
step++;
var _local3 = Curves.scurve(step / maxCount);
var _local4 = 0;
while (_local4 < 3) {
ballMc.radius = (rad * (1 - _local3)) + (targetR * _local3);
ballMc.grav = (0.5 * (1 - _local3)) + (1 * _local3);
_local4++;
}
}
if ((ballMc._y > yMax) || (!pp._filmPlaying)) {
ballMc.swapDepths(_root.newDepth());
_root.stackClips();
if (step == maxCount) {
this.onEnterFrame = undefined;
}
}
};
}
}
Symbol 874 MovieClip [__Packages.HintMarker] Frame 0
class HintMarker extends ReversibleClip
{
var _parent, _name, gotoAndStop, _currentframe, play, gotoAndPlay;
function HintMarker () {
super();
register();
}
function register() {
_parent.addMarker(this, _name);
}
function show() {
active = true;
gotoAndStop("full");
}
function fadeIn() {
active = true;
if (_currentframe == 1) {
play();
}
}
function fadeOut() {
if (active) {
active = false;
gotoAndPlay("fadeOut");
}
}
var active = false;
}
Symbol 875 MovieClip [__Packages.RollHintMarker] Frame 0
class RollHintMarker extends HintMarker
{
function RollHintMarker () {
super();
}
function register() {
super.register();
}
}
Symbol 876 MovieClip [__Packages.HintMaster] Frame 0
class HintMaster extends MovieClip
{
var markers, flashClusters, active, currCl;
function HintMaster () {
super();
markers = {};
flashClusters = {};
}
function addMarker(obj, name) {
markers[name] = obj;
}
function showHint(name, silent, fadeFlag) {
if ((!active) || (markers[name] == undefined)) {
return(undefined);
}
if (fadeFlag) {
markers[name].fadeIn();
} else {
markers[name].show();
}
if (silent != true) {
SoundManager.playSound("ding", 200);
}
}
function hideHint(name) {
markers[name].fadeOut();
}
function addRollMarker(obj, name) {
flashClusters[name] = obj;
}
function onMouseMove() {
if (active) {
var _local5 = _root._xmouse;
var _local4 = _root._ymouse;
var _local6 = true;
for (var _local7 in flashClusters) {
var _local3 = flashClusters[_local7];
if (_local3.hitTest(_local5, _local4, false)) {
if (_local3.hitTest(_local5, _local4, true)) {
_local6 = false;
if ((_local3 != currCl) && (!_local3.active)) {
_local3.fadeIn();
currCl.fadeOut();
currCl = _local3;
}
}
}
}
} else {
var _local6 = true;
}
if (_local6) {
currCl.fadeOut();
currCl = undefined;
}
}
function killHint(name) {
markers[name].fadeOut();
flashClusters[name] = undefined;
markers[name] = undefined;
}
}
Symbol 877 MovieClip [__Packages.Noticer] Frame 0
class Noticer extends MovieClip
{
var _ymouse, _xmouse, play, _currentframe, stop;
function Noticer () {
super();
}
function onEnterFrame() {
var _local2 = Math.sqrt((_xmouse * _xmouse) + (_ymouse * _ymouse));
if (_local2 < 100) {
play();
} else if (_currentframe == 1) {
stop();
}
}
}
Symbol 878 MovieClip [__Packages.SpringKnob] Frame 0
class SpringKnob extends SuperClip
{
var knob, anim, knobRolledOver, restRotation, _rotation, currAngle, getAbsoluteRotation, restLength, maxLength, pullFrames, maxPullLength, _knobCoords, dropCoords, _ymouse, _xmouse, _parent, currTugDist, setAbsoluteRotation;
function SpringKnob () {
super();
knob = anim.knob;
knobRolledOver = false;
restRotation = _rotation;
currAngle = ((getAbsoluteRotation() / 180) * Math.PI) + (Math.PI/2);
restLength = -knob._y;
anim.gotoAndStop("extended");
maxLength = -knob._y;
pullFrames = anim._currentFrame;
anim.gotoAndStop(anim._totalFrames);
maxPullLength = -knob._y;
anim.gotoAndStop(1);
var o = this;
knob.onRollOver = function () {
if (!o.active) {
return(undefined);
}
o.knobRolledOver = true;
};
knob.onRollOut = (knob.onDragOut = function () {
o.knobRolledOver = false;
});
knob.onPress = function () {
if ((this._visible == false) || (!o.active)) {
return(undefined);
}
o.dragging = true;
o._root.processCoordinator.reportEvent("userGraspKnob");
o.onDrag();
if (o.pegged) {
o.releasing = true;
}
o.pegged = false;
this.onMouseUp = function () {
o.onLetGo();
this.onMouseUp = undefined;
};
};
_knobCoords = {};
}
function releaseKnob() {
}
function onEnterFrame() {
if (pegged) {
tug(dropCoords.x, dropCoords.y);
} else if (dragging) {
var _local4 = {x:_xmouse, y:_ymouse};
var _local3 = _root.getGlobalCoords(this, _local4);
tug(_local3.x, _local3.y);
} else if (!relaxed) {
releasing = true;
release();
}
}
function onLetGo() {
dragging = false;
if (isGrasped) {
pegged = true;
_root.processCoordinator.reportEvent("releaseKnobInHand");
} else {
_root.processCoordinator.reportEvent("releaseKnob");
pegged = false;
_parent.shut();
}
}
function tug(x, y) {
relaxed = false;
if (!inGraspRange) {
releasing = false;
}
var _local6 = getAnchorCoords(_parent.openAngle);
var _local3 = new Between({x:x, y:y}, _local6);
var _local7 = _local3.getAngle();
var _local2 = _local3.getDistance();
if (_local2 > (maxLength + 1)) {
_parent.onTug();
findRestAngle(x, y);
_parent.onTug();
draw();
} else {
if (_local2 < (maxLength - 1)) {
_parent.shutStep();
} else {
_parent.onTug();
}
setKnobPosition(x, y);
draw();
}
}
function release() {
currTugDist = restLength + ((currTugDist - restLength) / 2);
_rotation = (_rotation + restRotation) / 2;
if ((Math.round(_rotation - restRotation) == 0) && (anim._currentFrame == 1)) {
relaxed = true;
}
currAngle = ((getAbsoluteRotation() / 180) * Math.PI) + (Math.PI/2);
draw();
}
function setShade() {
}
function findRestAngle(x, y) {
var _local15 = getDir(_parent.openAngle, x, y);
var _local2 = 1;
var _local11 = 6;
var _local10 = _parent.openAngle;
var _local16 = ((_local15 == 1) ? (angleToHinge(x, y)) : 0);
if (_local16 > Math.PI) {
_local16 = Math.PI;
}
var _local12 = _local16 - _local10;
if (_local12 > Math.PI) {
_local12 = _local12 - (Math.PI*2);
}
if (_local12 < -3.14159265358979) {
_local12 = _local12 + (Math.PI*2);
}
if (_local12 > 0.628318530717959) {
_local12 = 0.628318530717959;
}
var _local17 = currTugDist;
var _local7 = 0.5;
var _local13 = _local10;
while (_local2 < _local11) {
_parent.setOpenAngle(_local10 + (_local12 * _local7));
var _local9 = getAnchorCoords(_parent.openAngle);
var _local3 = new Between({x:x, y:y}, _local9);
var _local14 = _local3.getDistance();
var _local8 = _local3.getAngle();
setKnob(_local14, _local8);
_local2++;
if (_local2 < _local11) {
_local14 = currTugDist - maxLength;
var _local6 = getDir(_parent.openAngle, x, y) * _local15;
if (_local6 == 1) {
_local13 = _parent.openAngle;
}
_local7 = _local7 + ((1 / Math.pow(2, _local2)) * _local6);
} else {
_parent.setOpenAngle(((_local13 * 2) + _local10) / 3);
setKnobPosition(x, y);
}
}
_parent.draw();
}
function angleToHinge(x, y) {
var _local4 = {x:x, y:y};
var _local3 = getParentCoords();
var _local2 = new Between(_local4, _local3).getAngle();
if (_local2 < 0) {
_local2 = _local2 + (Math.PI*2);
}
return(_local2);
}
function setKnobPosition(x, y) {
var _local5 = getAnchorCoords(_parent.openAngle);
var _local2 = new Between({x:x, y:y}, _local5);
var _local4 = _local2.getDistance();
var _local3 = _local2.getAngle();
setKnob(_local4, _local3);
}
function setKnob(tugDist, tugDir) {
currTugDist = tugDist;
if (currTugDist > maxPullLength) {
currTugDist = maxPullLength;
}
currAngle = tugDir;
}
function draw() {
var _local2 = Math.round((pullFrames * (currTugDist - restLength)) / (maxLength - restLength));
if (_local2 < 1) {
_local2 = 1;
}
if (_local2 > anim._totalFrames) {
_local2 = anim._totalFrames;
}
anim.gotoAndStop(_local2);
setAbsoluteRotation(((currAngle / Math.PI) * 180) - 90);
}
function getDir(ang, x, y) {
var _local5 = ang + 0.0001;
var _local3 = Math.abs(getTugDistanceForAngle(_local5, x, y) - maxLength);
var _local4 = ang - 0.0001;
var _local2 = Math.abs(getTugDistanceForAngle(_local4, x, y) - maxLength);
return(((_local3 < _local2) ? 1 : -1));
}
function getParentCoords() {
var _local3 = _root.getGlobalCoords(_parent);
return(_local3);
}
function getAnchorCoords(hingeAngle) {
if (hingeAngle == undefined) {
hingeAngle = _parent.openAngle;
}
var _local2 = getParentCoords();
var _local5 = (_parent.anchorDist * Math.cos(hingeAngle + _parent.anchorAngle)) + _local2.x;
var _local4 = (_parent.anchorDist * Math.sin(hingeAngle + _parent.anchorAngle)) + _local2.y;
return({x:_local5, y:_local4});
}
function getTugDistanceForAngle(hingeAngle, knobX, knobY) {
var _local2 = getAnchorCoords(hingeAngle);
return(new Between(_local2, {x:knobX, y:knobY}).getDistance());
}
function get knobCoords() {
updateKnobCoords();
return(_knobCoords);
}
function updateKnobCoords() {
var _local2 = getAnchorCoords(_parent.openAngle);
_knobCoords.x = _local2.x + (currTugDist * Math.cos(currAngle + Math.PI));
_knobCoords.y = _local2.y + (currTugDist * Math.sin(currAngle + Math.PI));
}
var dragging = false;
var relaxed = true;
var releasing = false;
var inGraspRange = false;
var inTryRange = false;
var isGrasped = false;
var pegged = false;
}
Symbol 879 MovieClip [__Packages.HingedObject] Frame 0
class HingedObject extends MovieClip
{
var lid, springKnob, anchorDist, anchorAngle, openAngle, _rotation, _parent, onOpen, onTugEvent, onEnterFrame, onShut;
function HingedObject () {
super();
lid.tiltDisc.stop();
lid.tiltDiscOverlay.stop();
}
function init() {
var _local2 = new Between({x:0, y:0}, {x:springKnob._x, y:springKnob._y});
anchorDist = _local2.getDistance();
anchorAngle = _local2.getAngle();
setOpenAngle(0);
draw();
}
function setOpenAngle(ang) {
if (ang > maxAngle) {
ang = maxAngle;
}
if (ang < 0) {
ang = 0;
}
openAngle = ang;
}
function setColor(rgb) {
new Color(lid.tiltDisc).setRGB(rgb);
new Color(lid.top).setRGB(rgb);
}
function draw() {
_rotation = ((openAngle / Math.PI) * 180) - _parent._rotation;
if (_rotation < 0) {
_rotation = 0;
}
var _local2 = 1 + Math.floor((180 * openAngle) / maxAngle);
lid.tiltDisc.gotoAndStop(_local2);
lid.tiltDiscOverlay.gotoAndStop(_local2);
springKnob.setShade();
}
function onTug() {
shutVel = 0;
if ((openAngle > 0) && (!isOpen)) {
isOpen = true;
onOpen();
}
onTugEvent();
onEnterFrame = undefined;
}
function push(vel) {
shutVel = vel;
shut();
}
function shut() {
onEnterFrame = function () {
this.shutStep(true);
};
}
function shutStep(checkForEnd) {
var _local2 = ((openAngle / maxAngle) * Math.PI) / 200;
shutVel = shutVel - _local2;
setOpenAngle(openAngle + shutVel);
if (openAngle == 0) {
if (Math.abs(shutVel) > 0.05) {
shutVel = shutVel / -12;
setOpenAngle(openAngle + shutVel);
} else {
if (checkForEnd) {
isOpen = false;
onShut();
}
shutVel = 0;
onEnterFrame = undefined;
}
}
draw();
}
var maxAngle = Math.PI;
var isOpen = false;
var shutVel = 0;
}
Symbol 880 MovieClip [__Packages.BendyLimb] Frame 0
class BendyLimb extends SuperClip
{
var sqrt, cos, sin;
function BendyLimb () {
super();
}
function bend(end, mid, base, l, dir) {
if (dir == undefined) {
dir = -1;
}
var _local5 = new Between(base, end);
var _local2 = _local5.getAngle();
var _local3 = _local5.getDistance();
var _local4 = sqrt((l * l) - (((_local3 / 2) * _local3) / 2)) * dir;
if (isNaN(_local4)) {
_local4 = 0;
}
mid.x = (base.x + (_local4 * sin(_local2))) + ((_local3 / 2) * cos(_local2));
mid.y = (base.y - (_local4 * cos(_local2))) + ((_local3 / 2) * sin(_local2));
}
}
Symbol 881 MovieClip [__Packages.Hand] Frame 0
class Hand extends BendyLimb
{
var _front, _shadow, _back, lowerArm, _listener, bx, by, midPt, restCoords, midCoords, baseCoords, armLength, handCoords, _parent, _rotation, bend, upperArm;
function Hand () {
super();
clearState();
isRetracted = true;
}
function init(listener, front, shadow) {
_front = front;
_shadow = shadow;
_back = lowerArm.back;
_listener = listener;
bx = _back._x;
by = _back._y;
resize();
midPt = {};
setPos(restCoords.x, restCoords.y);
_root.addResizeListener(this);
}
function resize() {
midCoords = _root.getGlobalCoords(this, {x:bx, y:by});
restCoords = {x:midCoords.x - 80, y:midCoords.y + 8};
baseCoords = {x:midCoords.x - 90, y:midCoords.y};
armLength = baseArmLength;
}
function gotoAndStop(frameNum) {
currentFrame = frameNum;
if (currentFrame > 5) {
currentFrame = 5;
}
if (currentFrame < 1) {
currentFrame = 1;
}
_back.gotoAndStop(currentFrame);
_front.gotoAndStop(currentFrame);
}
function setPos(x, y) {
handCoords = {x:x, y:y};
var _local8 = _root.getLocalCoords(_parent, getHandCoords());
_front._x = _local8.x;
_front._y = _local8.y;
_rotation = -_parent._rotation;
bend(handCoords, midPt, baseCoords, armLength / 2, -1);
var _local7 = {x:baseCoords.x, y:baseCoords.y};
var _local6 = {x:midPt.x, y:midPt.y};
_root.getLocalCoords(this, _local7);
_root.getLocalCoords(this, _local6);
upperArm._x = _local7.x;
upperArm._y = _local7.y;
upperArm._rotation = ((new Between(midPt, baseCoords).getAngle() / Math.PI) * 180) + 180;
lowerArm._x = _local6.x;
lowerArm._y = _local6.y;
lowerArm._rotation = ((new Between({x:x, y:y}, midPt).getAngle() / Math.PI) * 180) + 180;
var _local4 = ["upperArm", "lowerArm"];
for (var _local5 in _local4) {
var _local3 = _local4[_local5];
_shadow[_local3]._x = this[_local3]._x;
_shadow[_local3]._y = this[_local3]._y;
_shadow[_local3]._rotation = this[_local3]._rotation;
}
_front._rotation = lowerArm._rotation;
}
function resetCounters() {
}
function onRollOver() {
if ((!isReached) && (!isWaving)) {
isWaving = true;
SoundManager.playSound("handSound");
}
}
function onRollOut() {
}
function onDragOut() {
}
function getHandCoords() {
return({x:handCoords.x, y:handCoords.y});
}
function getGlobalHandCoords() {
var _local3 = _root.getGlobalCoords(lowerArm, {x:_back._x, y:_back._y});
return(_local3);
}
function clearState() {
isReached = false;
isRetracted = false;
isReaching = false;
isRetracting = false;
isWaving = false;
}
function reachTowards(endPt, cpt, maxDist, callBack) {
clearState();
isReaching = true;
_motionIdCounter++;
doReach(_motionIdCounter, 0, 10, getHandCoords(), endPt, cpt, maxDist, callBack);
}
function retract(callBack) {
clearState();
isRetracting = true;
_motionIdCounter++;
doRetract(_motionIdCounter, 0, 10, getHandCoords(), callBack);
}
function wave() {
isWaving = true;
_motionIdCounter++;
doWave(_motionIdCounter, 0, 20, getHandCoords());
}
function glideTo(endPoint, maxTime, callBack) {
clearState();
_motionIdCounter++;
doGlide(_motionIdCounter, 0, maxTime, getHandCoords(), endPoint, callBack);
}
function doGlide(motionId, counter, maxCount, initPoint, endPoint, callBack) {
if (_motionIdCounter != motionId) {
return(undefined);
}
if (counter < maxCount) {
counter++;
}
var _local4 = Curves.scurve(counter / maxCount);
setGlide(initPoint, endPoint, _local4);
gotoAndStop(currentFrame - 1);
if (counter == maxCount) {
callBack();
} else {
new DelayedEvent(this, 1, "doGlide", [motionId, counter, maxCount, initPoint, endPoint, callBack]);
}
}
function doReach(motionId, counter, maxCount, iPt, endPt, cpt, maxDist, callBack) {
if (_motionIdCounter != motionId) {
return(undefined);
}
if (counter < maxCount) {
counter++;
}
if (counter > (maxCount / 2)) {
gotoAndStop(currentFrame + 1);
}
var _local9 = new Between(cpt, endPt);
var _local10 = _local9.getDistance();
var _local8;
if (_local10 < maxDist) {
_local8 = {x:endPt.x, y:endPt.y};
} else {
var _local7 = _local9.getAngle();
_local8 = {x:cpt.x + (Math.cos(_local7) * maxDist), y:cpt.y + (Math.sin(_local7) * maxDist)};
}
setGlide(iPt, _local8, Curves.scurve(counter / maxCount));
if (counter == maxCount) {
clearState();
isReached = true;
callBack();
} else {
new DelayedEvent(this, 1, "doReach", [motionId, counter, maxCount, iPt, endPt, cpt, maxDist, callBack]);
}
}
function doRetract(motionId, counter, maxCount, iPt, callBack) {
if (_motionIdCounter != motionId) {
return(undefined);
}
gotoAndStop(currentFrame - 1);
if (counter < maxCount) {
counter++;
}
setGlide(iPt, midCoords, Curves.scurve(counter / maxCount));
if (counter == maxCount) {
clearState();
isRetracted = true;
callBack();
} else {
new DelayedEvent(this, 1, "doRetract", [motionId, counter, maxCount, iPt, callBack]);
}
}
function cancelMotion() {
_motionIdCounter++;
}
function doWave(motionId, counter, cycleLength, iPt) {
if (_motionIdCounter != motionId) {
return(undefined);
}
counter++;
var _local4 = {};
_local4.x = iPt.x + 20;
_local4.y = iPt.y + 20;
if (counter < (cycleLength / 2)) {
var _local6 = counter / (cycleLength / 2);
} else {
var _local6 = 1 - ((counter - (cycleLength / 2)) / (cycleLength / 2));
}
setGlide(iPt, _local4, Curves.scurve(_local6));
if (counter == cycleLength) {
isWaving = false;
} else {
new DelayedEvent(this, 1, "doWave", [motionId, counter, cycleLength, iPt]);
}
}
function setGlide(initPoint, endPoint, progressFrac) {
var _local2 = 1 - progressFrac;
var _local5 = (initPoint.x * _local2) + (endPoint.x * progressFrac);
var _local4 = (initPoint.y * _local2) + (endPoint.y * progressFrac);
setPos(_local5, _local4);
}
var baseArmLength = 140;
var currentFrame = 1;
var _motionIdCounter = 0;
var isReached = false;
var isRetracted = true;
var isReaching = false;
var isRetracting = false;
var isWaving = false;
}
Symbol 882 MovieClip [__Packages.Process] Frame 0
class Process
{
var _coordinator;
function Process (coord) {
_coordinator = coord;
}
function init() {
}
function run() {
}
function shutDown() {
}
function activateBall(tag, x, y, vx, vy, dragFlag, eyeFlag, shapeData) {
_coordinator.activateBall(tag, x, y, vx, vy, dragFlag, eyeFlag, shapeData);
}
function deactivateBall(ballObj) {
return(_coordinator.deactivateBall(ballObj));
}
function playSound(soundName, volume, loopNum, fadein, fadeout) {
return(SoundManager.playSound(soundName, volume, loopNum));
}
function fadeInSound(snd, numFrames) {
SoundManager.fadeInSound(snd, numFrames);
}
function fadeOutSound(snd, numFrames) {
SoundManager.fadeOutSound(snd, numFrames);
}
function reportEvent(evetName) {
_coordinator.reportEvent(evetName);
}
function setAttentionTarget(obj, timeOut, delay) {
_coordinator.setAttentionTarget(obj, timeOut, delay);
}
}
Symbol 883 MovieClip [__Packages.HatchProcess] Frame 0
class HatchProcess extends Process
{
var currContentType, active, _springKnob, retractHair, _head, _hatch, _hand, _handShadow, _handFront, _hairGrowAnim, _hatchContent, _handState, handLocked, contentActive, _contentClip, cancelRun, reachRestCoords, _contentShell, contentTransform, fullyOpen;
function HatchProcess (coord) {
super(coord);
}
function setContentType(strng) {
currContentType = strng;
}
function setActive(boo) {
active = boo;
_springKnob.active = boo;
if ((!boo) && (_springKnob.dragging)) {
_springKnob.onLetGo();
}
if (!boo) {
retractHair();
}
}
function init(head, hatch, hand, handShadow, handFront, earButton, hatchContent) {
_head = head;
_hatch = hatch;
_hand = hand;
_hatch.init();
_handShadow = handShadow;
_handFront = handFront;
_handFront._visible = false;
_handShadow._visible = false;
_hairGrowAnim = _hatch.hairGrowAnim;
_springKnob = _hatch.springKnob;
_hatchContent = hatchContent;
_springKnob._visible = false;
_hairGrowAnim.stop();
_handState = "off";
var o = this;
retractHair = function () {
o._hairGrowAnim._visible = true;
o._hatch.hitRange.gotoAndStop(1);
o._springKnob._visible = false;
o._hairGrowAnim.reverse(2);
};
_hatch.hitRange.onRollOver = function () {
if (o.active) {
o.growHair();
}
};
_hatch.hitRange.onRollOut = (_hatch.hitRange.onDragOut = function () {
o.rolledOver = false;
if ((((!o._springKnob.dragging) && (!o._springKnob.isGrasped)) && (o._hatch.openAngle == 0)) && (!this.hitTest(_root._xmouse, _root._ymouse, true))) {
o.retractHair();
}
});
_hatch.onOpen = function () {
o._hatch.hitRange._xscale = (o._hatch.hitRange._yscale = 1);
o._hatch.hairMask.gotoAndStop(2);
o._hatch.hatchTufts.setMask(o._hatch.hairMask);
if (!o.handLocked) {
o.turnOnHand();
}
};
_hatch.onShut = function () {
o._hatch.hitRange._xscale = (o._hatch.hitRange._yscale = 100);
o._hatch.hatchTufts.setMask(null);
o._hatch.hairMask.gotoAndStop(1);
if (((!o._springKnob.isGrasped) && (!o.rolledOver)) && (!o._springKnob.knobRolledOver)) {
o.retractHair();
}
o.deactivateHand();
o.reportEvent("hatchClosed");
};
_hatch.onTugEvent = function () {
if (!o.handLocked) {
if ((o._handState == "off") || (o._handState == "leaving")) {
o.turnOnHand();
}
}
};
run();
handLocked = true;
}
function growHair() {
rolledOver = true;
var o = this;
var _local2 = function () {
o._hairGrowAnim._visible = false;
o._hairGrowAnim.halt();
o._springKnob._visible = true;
o.reportEvent("springKnobGrow");
};
_hairGrowAnim.forward(1, _local2);
_hatch.hitRange.gotoAndStop(2);
}
function reset() {
legList = [];
deactivateHand();
resetLegs = true;
}
function addLeg(name) {
legList.push(name);
if (contentActive) {
_contentClip.addLeg(name);
} else {
pushHatchOpen(name + "Sound", legData[name].volume);
}
}
function pushHatchOpen(soundName, vol) {
_hatch.push(0.005);
SoundManager.playSound(soundName, vol);
new DelayedEvent(this, 5, "setAttentionTarget", [_hatch.attentionTarget, 90]);
}
function kickOff() {
var o = this;
var _local2 = function () {
o._hairGrowAnim._visible = false;
o._hairGrowAnim.halt();
o._springKnob._visible = true;
};
new DelayedEvent(_hairGrowAnim, 1, "forward", [1, _local2]);
}
function run() {
runHand();
runHatch();
}
function turnOnHand() {
if (_handState == "off") {
SoundManager.playSound("handSound");
new DelayedEvent(this, 5, "setAttentionTarget", [_handFront, 90]);
_hand._visible = true;
_handFront._visible = true;
_handShadow._visible = true;
}
handLocked = false;
_hand.gotoAndStop(1);
activateHand();
}
function activateHand() {
doEnter();
}
function onDeactivate() {
_hand._visible = false;
_handFront._visible = false;
_handShadow._visible = false;
_handState = "off";
}
function deactivateHand() {
if (_handState != "off") {
if (_hand.isReached) {
_springKnob.isGrasped = false;
_springKnob.onLetGo();
}
_hand.glideTo(_hand.restCoords, 10, mx.utils.Delegate.create(this, onDeactivate));
cancelRun = true;
_handState = "leaving";
}
}
function getHandCoords() {
return(_hand.getHandCoords());
}
function forceRelease() {
if (_springKnob.pegged) {
_springKnob.isGrasped = false;
_springKnob.onLetGo();
}
deactivateHand();
}
function doEnter() {
_handState = "enter";
doEnterPhaseOne();
}
function doEnterPhaseOne() {
var _local2 = {x:_hand.midCoords.x + 10, y:_hand.midCoords.y};
_hand.glideTo(_local2, 16, mx.utils.Delegate.create(this, doEnterPhaseTwo));
}
function doEnterPhaseTwo() {
_hand.glideTo(_hand.midCoords, 5, mx.utils.Delegate.create(this, onEnterComplete));
}
function onEnterComplete() {
_handState = "run";
cancelRun = false;
doRun();
}
function doRun() {
if (cancelRun) {
cancelRun = false;
return(undefined);
}
if (!_springKnob.pegged) {
_springKnob.dropCoords = undefined;
var _local3;
if (_springKnob.dragging) {
var _local5 = new Between(_springKnob.knobCoords, _hand.midCoords);
var _local6 = _local5.getDistance();
_local3 = _local6 < _reachRange;
} else {
_local3 = false;
}
_springKnob.inGraspRange = _local3;
if (_local3 && (!_springKnob.releasing)) {
if ((!_hand.isReached) && (!_hand.isReaching)) {
_hand.reachTowards(_springKnob.knobCoords, _hand.midCoords, _reachRange, null);
} else if (_hand.isReached) {
var _local4 = _root.getGlobalCoords(_hand, {x:_hand._xmouse, y:_hand._ymouse});
_hand.setPos(_local4.x, _local4.y);
_springKnob.isGrasped = true;
}
} else if ((!_hand.isRetracted) && (!_hand.isRetracting)) {
_hand.retract();
_springKnob.isGrasped = false;
} else if (!_hand.isRetracting) {
if (_springKnob.dragging) {
dragAge++;
if (((dragAge > 100) && (!_springKnob.releasing)) && (!_hand.isWaving)) {
dragAge = 0;
_hand.wave();
}
} else {
dragAge = 0;
}
}
} else {
if (_springKnob.dropCoords == undefined) {
reachRestCoords = getHandCoords();
_hand.isReached = false;
}
if ((!_hand.isReached) && (!_hand.isReaching)) {
_hand.reachTowards(_springKnob.getAnchorCoords(), reachRestCoords, _reachRange / 6, null);
}
_springKnob.dropCoords = _hand.getGlobalHandCoords();
}
new DelayedEvent(this, 1, "doRun");
}
function runHand() {
if (!initFlag) {
_hand.init(this, _handFront, _handShadow);
initFlag = true;
}
}
function runHatch() {
var _local2 = tweenDataObj[currContentType];
contentActive = _hatch.openAngle > _local2.initAngle;
if (contentActive) {
if (_contentClip._width <= 0) {
if (_local2.frame != undefined) {
ViewMaster.setFrame(_local2.frame);
}
_contentShell = _hatchContent.contentContainer.attachMovie(currContentType + "Content", currContentType + (contentDepthCounter++), contentDepthCounter);
_contentClip = _contentShell.contentClip;
_hatchContent.blocker.gotoAndStop(_local2.maskFrame);
if (tweenDataObj.addAsHitForm) {
HitManager.addHitForm(_contentClip);
}
_contentClip.parentProcess = this;
new DelayedEvent(this, 3, "setAttentionTarget", [_contentClip, 90]);
new DelayedEvent(this, 1, "initContentClip", [currContentType]);
tweenFrac = 0;
contentTransform = new flash.geom.Transform(_contentClip);
}
var _local4;
if (_hatch.openAngle < _local2.initAngle) {
_local4 = 0;
} else if (_hatch.openAngle < _local2.endAngle) {
_local4 = (_hatch.openAngle - _local2.initAngle) / (_local2.endAngle - _local2.initAngle);
if (_local4 > 1) {
_local4 = 1;
}
} else {
_local4 = 1;
}
tweenFrac = (_local4 + tweenFrac) / 2;
var _local7 = fullyOpen;
fullyOpen = tweenFrac > 0.99;
var _local5 = fullyOpen != _local7;
_contentClip.fullyOpen = fullyOpen;
var _local3 = Curves.scurve(tweenFrac);
if (_local2.path == "custom") {
if ((!fullyOpen) || (_local5)) {
_contentClip.setEmerge((_local5 ? 1 : (_local3)));
}
} else {
_contentShell._x = (_local2.path.x1 * (1 - _local3)) + (_local2.path.x2 * _local3);
_contentShell._y = (_local2.path.y1 * (1 - _local3)) + (_local2.path.y2 * _local3);
var _local6 = (_local2.path.scale1 * (1 - _local3)) + (_local2.path.scale2 * _local3);
_contentShell._xscale = (_contentShell._yscale = _local6);
contentTransform.colorTransform = new flash.geom.ColorTransform(_local3, _local3, _local3, 1, 0, 0, 0, 0);
}
} else if (_contentClip._parent != undefined) {
_contentShell.removeMovieClip();
_contentShell = undefined;
_hatchContent.blocker.gotoAndStop(1);
if (tweenDataObj.addAsHitForm) {
HitManager.removeHitForm(_contentClip);
}
ViewMaster.setFrame("regular");
}
}
function initCollapse() {
forceRelease();
ViewMaster.setFrame("regular");
}
function initContentClip(type) {
if ((currContentType == "legs") && (resetLegs)) {
_contentClip.reset();
resetLegs = false;
}
if (type == "legs") {
var _local2 = 0;
while (_local2 < legList.length) {
_contentClip.addLeg(legList[_local2]);
_local2++;
}
} else if (type == "smallHead0") {
_contentClip.headContainer.head.config(this, 0);
}
}
function get isGrasped() {
return(_springKnob.isGrasped);
}
var _reachRange = 60;
var rolledOver = false;
var tweenDataObj = {legs:{addAsHitTarget:true, initAngle:(Math.PI/4), endAngle:2.35619449019234, maskFrame:1, path:{x1:-5, y1:-6, x2:-6, y2:-90, scale1:75, scale2:100}}, smallHead0:{addAsHitTarget:false, initAngle:0.392699081698724, endAngle:2.74889357189107, maskFrame:2, path:"custom"}};
var legData = {elephant:{volume:10}, horse:{volume:20}, bear:{volume:20}, tentacle:{volume:30}, robot:{volume:20}, lady:{volume:30}, duck:{volume:20}};
var resetLegs = false;
var legList = [];
var initFlag = false;
var dragAge = 0;
var tweenFrac = 0;
var contentDepthCounter = 0;
}
Symbol 884 MovieClip [__Packages.Hair] Frame 0
class Hair extends MovieClip
{
var _dir, _rotation, pointer, sensor, _length, clear, lineStyle, curveTo;
function Hair () {
super();
_dir = (_rotation / 180) * Math.PI;
_rotation = 0;
pointer._visible = false;
sensor._alpha = 0;
}
function onRollOver() {
isGrowing = true;
}
function onRollOut() {
isGrowing = false;
}
function oDragOut() {
isGrowing = false;
}
function onEnterFrame() {
if (isGrowing) {
_growAmt = _growAmt + 1;
_length = _growAmt * 2;
var _local3 = _length / 2;
var _local6 = Math.PI - _dir;
var _local2 = ((_length / 400) * _local6) + _dir;
var _local4 = {x:_local3 * Math.cos(_dir), y:_local3 * Math.sin(_dir)};
var _local5 = {x:_length * Math.cos(_local2), y:_length * Math.sin(_local2)};
clear();
lineStyle(5, 0);
curveTo(_local4.x, _local4.y, _local5.x, _local5.y);
}
}
var _growAmt = 0;
var isGrowing = false;
}
Symbol 885 MovieClip [__Packages.TearDropMaker] Frame 0
class TearDropMaker extends SuperClip
{
var _rotation, _parent, attachClip;
function TearDropMaker () {
super();
}
function onEnterFrame() {
if (!active) {
return(undefined);
}
time++;
if (time == 6) {
time = 0;
osc = osc + 4.10823654700204;
newDrop();
}
_rotation = -_parent._rotation;
active = false;
}
function newDrop() {
var _local3 = attachClip("tearDrop");
var _local2 = (0.392699081698724 * Math.cos(osc)) + 0.392699081698724;
_local3.init(6, _local2, 20 * Math.cos(_local2), 20 * Math.sin(_local2));
}
var time = 0;
var osc = 0;
var active = false;
}
Symbol 886 MovieClip [__Packages.TearDrop] Frame 0
class TearDrop extends MovieClip
{
var tailArr, r, _width, vx, vy, drop, splash, removeMovieClip;
function TearDrop () {
super();
tailArr = [];
r = _width / 2;
}
function init(v, dir, x, y) {
vx = v * Math.cos(dir);
vy = v * Math.sin(dir);
drop._x = x;
drop._y = y;
new Color(this).setRGB(61183);
onEnterFrame();
}
function onEnterFrame() {
drop._x = drop._x + vx;
drop._y = drop._y + vy;
vy = vy + grav;
var _local4 = {x:0, y:_root.yMax};
_root.getLocalCoords(this, _local4);
var _local3 = _local4.y;
tailArr.push({x:drop._x, y:drop._y, vx:vx, vy:vy});
if (tailArr.length > 5) {
tailArr.splice(0, 1);
}
if (!hasHit) {
if (drop._y > _local3) {
hasHit = true;
splash._y = _local3;
splash._x = drop._x;
splash._xscale = (splash._yscale = 30);
splash.play();
}
} else {
splash._y = _local3;
}
draw();
}
function onDone() {
removeMovieClip();
}
function draw() {
var _local14;
var _local2 = tailArr[0];
var _local10 = drop._x - _local2.x;
var _local9 = drop._y - _local2.y;
_local14 = Math.sqrt((_local10 * _local10) + (_local9 * _local9));
var _local6 = _local14 / 30;
if (_local6 > 1) {
_local6 = 1;
}
drop._xscale = (drop._yscale = _local6 * 100);
var _local4 = Math.atan2(vy, vx);
var _local8 = Math.atan2(_local2.vy, _local2.vx);
var _local13 = (_local4 + _local8) / 2;
var _local3 = Tools.getIntersection(drop._x, drop._y, _local2.x, _local2.y, _local4, _local8);
var _local5 = Math.sin(_local4) * r;
var _local7 = Math.cos(_local4) * r;
var _local12 = Math.sin(_local13) * r;
var _local11 = Math.cos(_local13) * r;
drop.clear();
drop.beginFill(39896);
drop.moveTo(_local5, -_local7);
drop.curveTo((_local3.x - drop._x) + (_local12 / 2), (_local3.y - drop._y) - (_local11 / 2), _local2.x - drop._x, _local2.y - drop._y);
drop.curveTo((_local3.x - drop._x) - (_local12 / 2), (_local3.y - drop._y) + (_local11 / 2), -_local5, _local7);
drop.lineTo(_local5, -_local7);
}
var grav = 0.5;
var hasHit = false;
}
Symbol 887 MovieClip [__Packages.Head] Frame 0
class Head extends BasicHead
{
var sneezeSpot, top, tearDropMaker, spots, animForm, neckForm, _yLift, _y, oy, __get__yLift, _rotation, ear, earShadow, _coordinator, isTugging, tipAmt, _x, ox, currLockKey, currentEvent, isYawning;
function Head () {
super();
sneezeSpot = top.sneezeSpot;
tearDropMaker = top.tearDropMaker;
spots = top.spots;
animForm.defaultFrame = 1;
top.hand._visible = false;
top.handShadow._visible = false;
neckForm._visible = false;
}
function set yLift(num) {
_yLift = -num;
_y = oy + _yLift;
//return(__get__yLift());
}
function setRotation(num, pt) {
_rotation = num;
}
function growSpots() {
spots.grow();
_root.processCoordinator.setAttentionTarget(spots);
}
function shutDownSpots() {
spots.shutDown();
}
function growEar() {
ear.forward(1);
earShadow.forward(1);
}
function hideEar() {
ear.reverse(1);
earShadow.reverse(1);
}
function get nose() {
return(_coordinator.getNose());
}
function closeEyes(frameRate) {
_coordinator.eyeManager.close(frameRate);
}
function openEyes(frameRate) {
_coordinator.eyeManager.open(frameRate);
}
function releaseTug() {
_coordinator.eyeManager.setSurprise(0);
isTugging = false;
}
function rotateAroundPoint(tipamt, xpt, ypt) {
tipAmt = tipamt;
_rotation = (tipAmt / Math.PI) * 180;
tipX = xpt;
tipY = ypt;
var _local5 = (xpt * Math.cos(-tipAmt)) + (ypt * Math.sin(-tipAmt));
var _local4 = (ypt * Math.cos(-tipAmt)) - (xpt * Math.sin(-tipAmt));
var _local7 = xpt - _local5;
var _local6 = ypt - _local4;
_x = ox + _local7;
_y = (oy + _local6) + _yLift;
}
function addMouthAnimEvent(path, dir, spd, endFunc, initFunc, resetPath) {
var o = this;
var _local2 = function () {
endFunc();
o.mouthIsBusy = false;
o.nextMouthEvent();
};
mouthEvents.push({type:"anim", path:path, dir:dir, speed:spd, endFunc:_local2, initFunc:initFunc, resetPath:resetPath});
if (!mouthIsBusy) {
nextMouthEvent();
}
}
function nextMouthEvent() {
if (mouthEvents.length == 0) {
return(undefined);
}
mouthIsBusy = true;
var _local2 = mouthEvents.splice(0, 1)[0];
_local2.initFunc();
if (_local2.type == "anim") {
if (_local2.dir == 1) {
animForm.forward(_local2.speed, _local2.endFunc, _local2.path, false, _local2.resetPath);
} else {
animForm.reverse(_local2.speed, _local2.endFunc, _local2.path, false, _local2.resetPath);
}
} else if (_local2.type == "customPath") {
if (_local2.startFrame == "current") {
_local2.startFrame = animForm._cf;
}
animForm.customPath(_local2.startFrame, _local2.endFrame, _local2.steps, _local2.endFunc);
} else if (_local2.type == "lock") {
currLockKey = _local2.key;
}
currentEvent = _local2;
}
function cancelCurrentEvent() {
currentEvent.endFunc();
nextMouthEvent();
}
function setMouthLock(key) {
mouthEvents.push({type:"lock", key:key});
}
function removeMouthLock(key) {
var _local3 = mouthEvents.length;
var _local2 = _local3 - 1;
while (_local2 >= 0) {
if (mouthEvents[_local2].key == key) {
mouthEvents.splice(_local2, 1);
}
_local2--;
}
if (key == currLockKey) {
currLockKey = undefined;
nextMouthEvent();
}
}
function openMouth(frameRate, endFunc) {
if (!mouthIsBusy) {
addMouthAnimEvent("eat", 1, frameRate, endFunc);
}
}
function closeMouth(frameRate, endFunc) {
addCustomPathEvent("current", 1, 14, endFunc);
}
function swallow(endFunc) {
var o = this;
var _local2 = function () {
o.onSwallow();
};
addMouthAnimEvent("swallow", 1, 1, endFunc, _local2, true);
}
function onSwallow(endFunc) {
new DelayedEvent(SoundManager, 10, "playSound", ["gulp"]);
closeEyes(1);
new DelayedEvent(this, 20, "openEyes");
}
function yawn(endFunc, fireFlag) {
if (mouthIsBusy && (!fireFlag)) {
return(undefined);
}
var o = this;
var _local2 = function () {
o.isYawning = true;
};
var _local3 = function () {
o.isYawning = false;
endFunc();
};
addMouthAnimEvent((fireFlag ? "fireYawn" : "yawn"), 1, 1, _local3, _local2);
setMouthLock("yawn");
}
function closeYawn(endFunc) {
addCustomPathEvent("current", 1, 15, endFunc);
removeMouthLock("yawn");
if (isYawning) {
cancelCurrentEvent();
}
}
function addCustomPathEvent(startFrame, endFrame, steps, endFunc) {
var o = this;
var _local2 = function () {
endFunc();
o.mouthIsBusy = false;
o.nextMouthEvent();
};
mouthEvents.push({type:"customPath", startFrame:startFrame, endFrame:endFrame, steps:steps, endFunc:_local2});
}
function mouthFrame(frameNum) {
animForm.gotoFrame(frameNum);
}
var eatCoords = {x:172, y:337};
var tipX = 0;
var tipY = 0;
var topFrame = 2;
var mouthEvents = [];
var mouthIsBusy = false;
}
Symbol 888 MovieClip [__Packages.Trycloid] Frame 0
class Trycloid extends MovieClip
{
var shape, attachMovie, _feet, _legLength, _feetAngle, _arcLengths, removeMovieClip, getBounds, _x, _y;
function Trycloid () {
super();
}
function initShapeData(linkageId, dataObj) {
shape = attachMovie(linkageId, "shape", 0);
shape.setState(dataObj, true);
shape.fixNodes = true;
init();
}
function init() {
_feet = [];
_legLength = [];
_feetAngle = [];
_arcLengths = [];
var n = 0;
var nextFoot = eval ("this.shape.foot" + n);
while (nextFoot != undefined) {
_feet[n] = nextFoot;
_feet[n].radius = _feet[n]._width / 2;
var btw = new Between({x:_feet[n]._x, y:_feet[n]._y}, {x:0, y:0});
_feetAngle[n] = btw.getAngle();
_legLength[n] = btw.getDistance();
nextFoot = eval ("this.shape.foot" + (n++));
}
}
function onEnterFrame() {
run();
if (isOutOfBounds()) {
removeMovieClip();
return("onEnterFrame");
}
draw();
}
function isOutOfBounds() {
return((_x + getBounds(this).xMax) < _root.xMin);
}
function run() {
var _local10 = _root.yMax;
oscRate = oscRate + 0.005;
if (oscRate > maxOscRate) {
oscRate = maxOscRate;
}
walkOsc = walkOsc - oscRate;
if (walkOsc < -3.14159265358979) {
walkOsc = walkOsc + (Math.PI*2);
}
var _local8 = 0;
var _local9;
var _local11;
var _local3 = 0;
while (_local3 < _feet.length) {
var _local6 = _feet[_local3]._x;
var _local7 = _feetAngle[_local3] + walkOsc;
var _local4 = _local7 + Math.PI;
var _local5 = _legLength[_local3];
_feet[_local3]._x = Math.cos(_local4) * _local5;
_feet[_local3]._y = Math.sin(_local4) * _local5;
if (_local8 < (_feet[_local3]._y + _feet[_local3].radius)) {
_local8 = _feet[_local3]._y + _feet[_local3].radius;
_local9 = (_feet[_local3]._x - _local6) + (oscRate * _feet[_local3].radius);
}
_local3++;
}
_y = _local10 - _local8;
_x = _x - _local9;
_x = _x + driftSpeed;
shape._rotation = (walkOsc / Math.PI) * 180;
}
function draw() {
}
var _radius = 20;
var _baseR = 10;
var walkOsc = 0;
var _contactAngles = [-1.87377631383923, -0.291776313839326, 1.67940899334066];
static var driftSpeed = 0;
var maxOscRate = 0.1;
var oscRate = 0;
}
Symbol 889 MovieClip [__Packages.WalkingNose] Frame 0
class WalkingNose extends Trycloid
{
function WalkingNose () {
super();
}
}
Symbol 890 MovieClip [__Packages.NodeShape] Frame 0
class NodeShape extends MovieClip
{
var _bounds;
function NodeShape () {
super();
}
function getBounds() {
if (_bounds == undefined) {
_bounds = calculateBounds();
}
return(_bounds);
}
function calculateBounds() {
var _local4 = [];
var _local6 = 0;
while (this["foot" + _local6] != undefined) {
_local4.push(this["foot" + _local6]);
_local6++;
}
var _local3 = {xMin:999, xMax:-999, yMin:999, yMax:-999};
for (_local6 in _local4) {
var _local5 = _local4[_local6];
var _local2 = _local5.getBounds(this);
if (_local2.xMin < _local3.xMin) {
_local3.xMin = _local2.xMin;
}
if (_local2.yMin < _local3.yMin) {
_local3.yMin = _local2.yMin;
}
if (_local2.xMax > _local3.xMax) {
_local3.xMax = _local2.xMax;
}
if (_local2.yMax > _local3.yMax) {
_local3.yMax = _local2.yMax;
}
}
return(_local3);
}
}
Symbol 891 MovieClip [__Packages.TrunkShape] Frame 0
class TrunkShape extends NodeShape
{
var hitForm, form, _parent;
function TrunkShape () {
super();
var f = ((hitForm = (form = (_root.trunk = _root.attachClip("trunk")))));
_parent.extendShape = function (fac) {
f.extend(fac);
};
_parent.onRemove = function () {
f.removeMovieClip();
};
}
function init(param1, param2) {
form.init(param1, param2);
}
function getState() {
return(form.getRenderArray());
}
function setState() {
}
}
Symbol 892 MovieClip [__Packages.Trunk] Frame 0
class Trunk extends BendyLimb
{
var hand, elbow, shoulder, fingers, _renderArray, minusDistance, grabGripAngle, currGripAngle, lastGripAngle, renderForm, attachMovie, _baseMc, transitionData, restData, _wantArray, want, sqrt, atan2, lastWant, clear, onEnterFrame, _x, _y, dragTarget, isGrabbing, initDragPos, cos, sin, bend, isTossing, isAvoidingFire, initSwingPos, PI, abs;
function Trunk () {
super();
var _local6 = {_width:10, _height:10};
hand = {x:0, y:0};
elbow = {x:0, y:0};
shoulder = {x:0, y:0};
fingers = new Array({tip:{}, mid:{}}, {tip:{}, mid:{}});
_renderArray = [];
minusDistance = 30;
grabGripAngle = openGripAngle;
currGripAngle = grabGripAngle;
lastGripAngle = openGripAngle;
renderForm = attachMovie("renderShapeTrunk", "renderShapeTrunk", 0);
}
function init(wantArr, baseMc) {
setWantArr(wantArr);
_baseMc = baseMc;
length = maxLength;
transitionData = {reachAngle:2.51327412287183, handReach:length * 1.5, handAngle:1.88495559215388};
restData = {reachAngle:-3.76991118430775, handReach:length * 1.5, handAngle:-4.39822971502571};
active = 20;
reachAngle = Math.PI;
handAngle = Math.PI;
handReach = maxLength * 2;
}
function goRest() {
var _local2 = Curves.scurve(active / 20);
reachAngle = restData.reachAngle + (limitAngle(transitionData.reachAngle - restData.reachAngle) * _local2);
handAngle = restData.handAngle + (limitAngle(transitionData.handAngle - restData.handAngle) * _local2);
handReach = restData.handReach + (limitAngle(transitionData.handReach - restData.handReach) * _local2);
handRoteV = 0;
handAV = 0;
handV = 0;
}
function setWantArr(arr) {
_wantArray = arr;
}
function setWant(obj) {
want = obj;
var _local2 = (lw / 2) + want.r;
minusDistance = (want.fake ? 20 : (sqrt((fingerExt * fingerExt) - (_local2 * _local2))));
lastGripAngle = grabGripAngle;
grabGripAngle = (want.fake ? (openGripAngle) : (atan2(_local2, minusDistance)));
var o = this;
obj.onRemove = function () {
o.removeWant(this);
};
obj.onLetGo = function () {
if ((o.want == this) and o.checkGrab()) {
o.grabWant();
}
};
}
function removeWant(obj) {
var _local2 = 0;
while (_local2 < _wantArray.length) {
if (obj == _wantArray[_local2]) {
_wantArray.splice(_local2, 1);
}
_local2++;
}
}
function findClosestWant() {
var _local5 = length * 2.5;
var _local8;
var _local3 = 0;
while (_local3 < _wantArray.length) {
if ((_wantArray[_local3] != lastWant) && (_wantArray[_local3].r <= _root.processCoordinator.maxWantRadius)) {
var _local4 = new Between(getShoulderCoords(), {x:_wantArray[_local3]._x, y:_wantArray[_local3]._y}).getDistance();
if (_local4 < _local5) {
_local5 = _local4;
_local8 = _wantArray[_local3];
}
}
_local3++;
}
if (_local8 != undefined) {
setWant(_local8);
} else {
want = undefined;
}
}
function turnOff() {
clear();
onEnterFrame = undefined;
}
function setShoulder() {
var _local3 = maxShoulderAngle + ((_root.head.animForm.top._rotation / 180) * Math.PI);
shoulder.y = 80 * Math.sin(_local3);
shoulder.x = 80 * Math.cos(_local3);
}
function extend(frac) {
xOff = 240 * (1 - frac);
}
function step() {
var _local25 = hand.x;
var _local41 = hand.y;
var _local32 = elbow.x;
var _local30 = elbow.y;
var _local35 = shoulder.x;
var _local33 = shoulder.y;
if (activeDir != 0) {
active = active + activeDir;
if ((active == 20) or (active == 0)) {
activeDir = 0;
}
goRest();
} else if (momentum < 1) {
momentum = momentum + 0.1;
}
var _local19 = getAbsoluteCoords();
_x = _local19.x + xOff;
_y = _local19.y;
dragTarget = {x:(_root.head._x + _root.head.eatCoords.x) - 40, y:_root.head._y + _root.head.eatCoords.y};
if (isGrabbing && (want._width > 0)) {
dragCounter++;
if (dragCounter > 36) {
dragCounter = 36;
}
var _local5 = initDragPos.y > dragTarget.y;
var _local21 = new Between(dragTarget, initDragPos);
var _local28 = _local21.getDistance() / 2;
var _local42 = _local21.getAngle() + (_local5 ? -1.5707963267949 : (Math.PI/2));
var _local8 = _local28 / cos(_local42);
var _local11 = {x:dragTarget.x, y:dragTarget.y + (_local5 ? (_local8) : (-_local8))};
var _local22 = new Between(_local11, initDragPos).getAngle();
var _local7 = Curves.scurve(dragCounter / 36);
var _local6 = (_local5 ? -1.5707963267949 : (Math.PI/2)) - _local22;
if (_local5 && (_local6 < 0)) {
_local6 = _local6 + (Math.PI*2);
}
if ((!_local5) && (_local6 > 0)) {
_local6 = _local6 - (Math.PI*2);
}
var _local23 = _local22 + (_local6 * _local7);
var _local47 = _local11.x + (cos(_local23) * _local8);
var _local46 = _local11.y + (sin(_local23) * _local8);
var _local49 = want.px;
var _local48 = want.py;
var _local45 = new Between({x:_local47, y:_local46}, {x:want.px, y:want.py}).getDistance();
want.dragTo(_local47, _local46);
want.onEnterFrame(true);
_local19 = getAbsoluteCoords();
handAngle = initDragPos.handAngle * (1 - _local7);
hand.x = (want.px - (minusDistance * Math.cos(handAngle))) - _local19.x;
hand.y = (want.py - (minusDistance * Math.sin(handAngle))) - _local19.y;
setShoulder();
bend(hand, elbow, shoulder, length);
fingerPlot(((currGripAngle * 2) + grabGripAngle) / 3);
if (dragCounter == 36) {
want.controlled = false;
want.inputLock = false;
lastWant = want;
want.forceMotion(0, 3, 10);
dragCounter = 0;
isGrabbing = false;
handAV = 0;
var _local24 = new Between(shoulder, hand);
reachAngle = _local24.getAngle();
handReach = _local24.getDistance();
}
} else if (isTossing) {
dragCounter++;
var _local16 = 16;
var _local3 = {x:-165, y:-110, handAngle:4.39822971502571, angleV:0.261799387799149};
tossBall(dragCounter, _local16, initDragPos, _local3);
if (dragCounter == _local16) {
var _local38 = Math.atan2(_local3.y, _local3.x);
var _local29 = Math.sqrt((_local3.y * _local3.y) + (_local3.x * _local3.x));
dragCounter = 0;
var _local24 = new Between(shoulder, hand);
reachAngle = _local24.getAngle();
handReach = _local24.getDistance();
isTossing = false;
want.controlled = false;
want.inputLock = false;
var _local36 = _local3.angleV * _local29;
var _local37 = _local38 + (Math.PI/2);
want.forceMotion(_local37, _local36, 1);
}
} else if (isAvoidingFire) {
dragCounter++;
var _local16 = 16;
if (dragCounter <= _local16) {
var _local10 = -2.35619449019234;
if (_local10 < initSwingPos.handAngle) {
_local10 = _local10 + (Math.PI*2);
}
var _local39 = {x:-190, y:-70, handAngle:_local10, angleV:0};
swingTrunkToPoint(dragCounter, _local16, initSwingPos, _local39);
}
var _local24 = new Between(shoulder, hand);
reachAngle = _local24.getAngle();
handReach = _local24.getDistance();
} else {
findClosestWant();
if (want == undefined) {
var _local20 = getRestCoords();
setWant({_x:_local20.x, _y:_local20.y, fake:true});
}
var _local17 = {x:want._x, y:want._y};
_local19 = getShoulderCoords();
var _local21 = new Between({x:_local19.x, y:_local19.y}, _local17);
var _local34 = _local21.getAngle();
var _local4 = _local21.getDistance() - minusDistance;
if (_local4 > (length * 2)) {
_local4 = length * 2;
frustrationMeter++;
if (frustrationMeter > 60) {
_root.processCoordinator.forceCry();
_root.processCoordinator.setAttentionTarget(want);
}
}
var _local18 = limitAngle(reachAngle - _local34);
var _local7 = abs(_local18) / (PI / 8);
if (_local7 > 1) {
_local7 = 1;
}
if (_local18 > 0) {
handAV = handAV - ((0.01 * _local7) * momentum);
} else {
handAV = handAV + ((0.01 * _local7) * momentum);
}
handAV = handAV * 0.8;
reachAngle = reachAngle + handAV;
_local7 = abs(handReach - _local4) / 20;
if (_local7 > 1) {
_local7 = 1;
}
if ((_local4 < handReach) or (_local4 == null)) {
handV = handV - ((8 * _local7) * momentum);
} else {
handV = handV + ((8 * _local7) * momentum);
}
if (handReach > (length * 2)) {
handV = handV * -0.5;
handReach = (length * 2) - (((handV * (handReach - (length * 2))) / handV) / 2);
}
handV = handV * 0.3;
handReach = handReach + handV;
hand.x = shoulder.x + (handReach * cos(reachAngle));
hand.y = shoulder.y + (handReach * sin(reachAngle));
setShoulder();
bend(hand, elbow, shoulder, length);
_local19 = getAbsoluteCoords();
_local21 = new Between({x:hand.x + _local19.x, y:hand.y + _local19.y}, _local17);
var _local26 = _local21.getAngle();
var _local31 = _local21.getDistance();
var _local13 = limitAngle(handAngle - _local26);
_local7 = abs(_local13) / (PI / 8);
if (_local7 > 1) {
_local7 = 1;
}
if (_local13 > 0) {
handRoteV = handRoteV - ((0.3 * _local7) * momentum);
} else {
handRoteV = handRoteV + ((0.3 * _local7) * momentum);
}
handRoteV = handRoteV * 0.95;
handAngle = handAngle + handRoteV;
var _local9 = new Between(elbow, hand).getAngle();
var _local15 = limitAngle(handAngle - _local9);
if (_local15 < ((-PI) / 2)) {
handAngle = _local9 - (PI / 2);
} else if (_local15 > (PI / 2)) {
handAngle = _local9 + (PI / 2);
}
handRoteV = 0;
var _local12 = _local31 - minusDistance;
if ((_local12 < 60) && (gripCounter < (30 - (_local12 / 2)))) {
gripCounter = gripCounter + Math.ceil((1 - (_local12 / 60)) * 10);
if (gripCounter > 30) {
gripCounter = 30;
}
} else if (gripCounter > 0) {
gripCounter = gripCounter - 2;
}
var _local14 = Curves.scurve(gripCounter / 30);
var _local27 = ((currGripAngle * 2) + ((lastGripAngle * (1 - _local14)) + (grabGripAngle * _local14))) / 3;
fingerPlot(_local27);
if (want.fake != true) {
var _local40 = checkGrab();
if (_local40 and (!want.drag)) {
grabWant();
}
}
if ((_wantArray.length == 0) && (phaseOutFlag == false)) {
phaseOutFlag = true;
want = undefined;
activeDir = -1;
transitionData.reachAngle = limitAngle(reachAngle);
transitionData.handAngle = limitAngle(handAngle);
transitionData.handReach = limitAngle(handReach);
}
}
if ((((((Math.abs(hand.x - _local25) > 0.5) || (Math.abs(hand.y - _local41) > 0.5)) || (Math.abs(elbow.x - _local32) > 0.5)) || (Math.abs(elbow.y - _local30) > 0.5)) || (Math.abs(shoulder.x - _local35) > 0.5)) || (Math.abs(shoulder.y - _local33) > 0.5)) {
draw();
}
}
function swingTrunkToPoint(counter, counterMax, initPos, swingPt) {
var _local9 = getAbsoluteCoords();
var _local5 = swingPt.x;
var _local4 = swingPt.y;
var _local7 = initPos.x - _local9.x;
var _local6 = initPos.y - _local9.y;
var _local16 = Math.atan2(_local4, _local5);
var _local14 = Math.sqrt((_local4 * _local4) + (_local5 * _local5));
var _local11 = Math.atan2(_local6, _local7);
var _local12 = Math.sqrt((_local6 * _local6) + (_local7 * _local7));
var _local3 = Curves.scurve(counter / counterMax);
var _local2 = _local16 - _local11;
while (_local2 < 0) {
_local2 = _local2 + (Math.PI*2);
}
var _local10 = _local11 + (_local2 * _local3);
var _local8 = (_local12 * (1 - _local3)) + (_local14 * _local3);
handAngle = (initPos.handAngle * (1 - _local3)) + (swingPt.handAngle * _local3);
var _local18 = _local8 * Math.cos(_local10);
var _local17 = _local8 * Math.sin(_local10);
hand.x = _local18;
hand.y = _local17;
setShoulder();
bend(hand, elbow, shoulder, length);
fingerPlot(((currGripAngle * 2) + grabGripAngle) / 3);
}
function tossBall(counter, counterMax, initPos, swingPt) {
var _local4 = getAbsoluteCoords();
var _local7 = swingPt.x;
var _local5 = swingPt.y;
var _local12 = initPos.x - _local4.x;
var _local10 = initPos.y - _local4.y;
var _local14 = Math.atan2(_local5, _local7);
var _local18 = Math.sqrt((_local5 * _local5) + (_local7 * _local7));
var _local22 = swingPt.angleV;
var _local11 = Math.atan2(_local10, _local12);
var _local17 = Math.sqrt((_local10 * _local10) + (_local12 * _local12));
var _local20 = counterMax - counter;
var _local2 = Curves.scurve(counter / counterMax);
var _local19 = _local14 - (_local22 * _local20);
var _local8 = _local19 - _local11;
if (_local8 < -1.5707963267949) {
_local8 = _local8 + (Math.PI*2);
}
var _local3 = {angle:_local11 + (_local8 * _local2), reach:(_local17 * (1 - _local2)) + (_local18 * _local2), handAngle:(initPos.handAngle * (1 - _local2)) + (swingPt.handAngle * _local2)};
var _local21 = initPos.handAngle - _local11;
var _local6 = swingPt.handAngle - _local14;
if (_local6 > Math.PI) {
_local6 = _local6 - (Math.PI*2);
}
var _local16 = Math.cos(_local3.angle) * _local3.reach;
var _local15 = Math.sin(_local3.angle) * _local3.reach;
want.dragTo(_local16 + _local4.x, _local15 + _local4.y);
want.onEnterFrame(true);
handAngle = (_local3.angle + (_local21 * (1 - _local2))) + (_local6 * _local2);
hand.x = _local16 - (minusDistance * Math.cos(handAngle));
hand.y = _local15 - (minusDistance * Math.sin(handAngle));
setShoulder();
bend(hand, elbow, shoulder, length);
fingerPlot(((currGripAngle * 2) + grabGripAngle) / 3);
}
function releaseWant() {
if (isGrabbing) {
want.inputLock = false;
want.controlled = false;
}
}
function avoidFire() {
var _local2 = getAbsoluteCoords();
initSwingPos = {x:_local2.x + hand.x, y:_local2.y + hand.y, handAngle:handAngle};
isAvoidingFire = true;
releaseWant();
isGrabbing = false;
dragCounter = 0;
}
function endAvoidFire() {
isAvoidingFire = false;
dragCounter = 0;
}
function grabWant() {
frustrationMeter = 0;
_root.processCoordinator.endCry();
_root.processCoordinator.setAttentionTarget(want);
if (want.doNotEat) {
isTossing = true;
} else {
isGrabbing = true;
}
want.inputLock = true;
want.controlled = true;
initDragPos = {x:want._x, y:want._y, handAngle:handAngle};
if (initDragPos.handAngle < 0) {
initDragPos.handAngle = initDragPos.handAngle + (Math.PI*2);
}
}
function fingerPlot(angle) {
currGripAngle = angle;
var _local5 = cos(angle) * fingerExt;
var _local4 = sin(angle) * fingerExt;
var _local2 = 0;
while (_local2 < 2) {
var _local3 = (_local2 - 0.5) * 2;
fingers[_local2].tip.x = (hand.x + (_local5 * cos(handAngle))) + ((_local4 * sin(handAngle)) * _local3);
fingers[_local2].tip.y = (hand.y + (_local5 * sin(handAngle))) - ((_local4 * cos(handAngle)) * _local3);
fingers[_local2].mid.x = (hand.x + ((20 * sin(handAngle)) * _local3)) + (7 * cos(handAngle));
fingers[_local2].mid.y = (hand.y - ((20 * cos(handAngle)) * _local3)) + (7 * sin(handAngle));
_local2++;
}
}
function getAbsoluteCoords() {
var _local3 = {x:plantX, y:plantY};
_root.getGlobalCoords(_baseMc, _local3);
return(_local3);
}
function getShoulderCoords() {
var _local2 = getAbsoluteCoords();
return({x:_local2.x + shoulder.x, y:_local2.y + shoulder.y});
}
function getRestCoords() {
var _local3 = getAbsoluteCoords();
var _local4 = restData.reachAngle;
var _local2 = restData.handReach;
return({x:(_local3.x + shoulder.x) + (Math.cos(_local4) * _local2), y:(_local3.y + shoulder.y) + (Math.sin(_local4) * _local2)});
}
function checkGrab() {
var _local2 = want.r + (lw / 2);
var _local3 = getAbsoluteCoords();
var _local4 = {x:want._x - _local3.x, y:want._y - _local3.y};
var _local6 = new Between(fingers[0].tip, _local4).getDistance() < (_local2 + 0.2);
var _local5 = new Between(fingers[1].tip, _local4).getDistance() < (_local2 + 0.2);
return(_local6 && (_local5));
}
function draw() {
var _local25 = {x:hand.x - (30 * cos(handAngle)), y:hand.y - (30 * sin(handAngle))};
var _local37 = fingers[1].tip;
var _local31 = fingers[0].tip;
var _local27 = fingers[1].mid;
var _local26 = fingers[0].mid;
var _local10 = [{x:0, y:0}, shoulder, averagePoints(shoulder, elbow), elbow, averagePoints(_local25, elbow), _local25, hand];
var _local22 = Math.atan2(shoulder.y, shoulder.x);
var _local34 = new Between(shoulder, _local25).getAngle();
var _local33 = new Between(shoulder, elbow).getAngle();
var _local24 = new Between(elbow, hand).getAngle();
var _local13 = [_local22, _local22 + (limitAngle(_local33 - _local22) / 2), _local33, _local34, _local24, _local24 + (limitAngle(handAngle - _local24) / 2), handAngle];
var _local15 = [[], []];
var _local17 = 60;
var _local18 = 20;
var _local7 = 0;
while (_local7 < 2) {
var _local11 = _local15[_local7];
var _local2 = 0;
while (_local2 < _local10.length) {
var _local5 = _local10[_local2];
var _local9 = (_local7 * 2) - 1;
var _local8 = Math.sin(((_local2 / (_local10.length - 1)) * Math.PI) / 2);
var _local6 = (_local17 * (1 - _local8)) + (_local18 * _local8);
_local11[_local2] = {x:_local5.x + ((Math.cos(_local13[_local2] + (PI / 2)) * _local6) * _local9), y:_local5.y + ((Math.sin(_local13[_local2] + (PI / 2)) * _local6) * _local9)};
_local2++;
}
_local15[_local7] = smoothPoints(_local11);
_local15[_local7].push(fingers[1 - _local7].tip);
_local7++;
}
var _local16 = _local15[0].length;
var _local3 = _local15[0];
var _local4 = _local15[1];
var _local28 = averagePoints(_local3[0], _local4[0]);
var _local29 = averagePoints(_local3[0], _local28);
var _local32 = averagePoints(_local28, _local29);
var _local21 = [{x:_local4[0].x - (Math.cos(_local22) * 40), y:_local4[0].y - (Math.sin(_local22) * 40)}, _local28, {x:_local32.x + (Math.cos(_local22) * 10), y:_local32.y + (Math.sin(_local22) * 10)}, _local29, {x:_local3[0].x - (Math.cos(_local22) * 20), y:_local3[0].y - (Math.sin(_local22) * 20)}];
_renderArray.length = 0;
var _local12 = 4;
_renderArray.push({type:"mv", x:_local3[0].x, y:_local3[0].y});
_local7 = 1;
while (_local7 <= _local12) {
var _local14 = averagePoints(_local3[_local7], _local3[_local7 + 1]);
_renderArray.push({type:"cv", cx:_local3[_local7].x, cy:_local3[_local7].y, x:_local14.x, y:_local14.y});
_local7++;
}
var _local23 = averagePoints(_local4[_local12 + 1], _local4[_local12]);
_renderArray.push({type:"ln", x:_local23.x, y:_local23.y});
_local7 = _local12;
while (_local7 >= 1) {
var _local14 = averagePoints(_local4[_local7], _local4[_local7 - 1]);
_renderArray.push({type:"cv", cx:_local4[_local7].x, cy:_local4[_local7].y, x:_local14.x, y:_local14.y});
_local7--;
}
_renderArray.push({type:"cv", cx:_local21[0].x, cy:_local21[0].y, x:_local21[1].x, y:_local21[1].y});
_renderArray.push({type:"cv", cx:_local21[2].x, cy:_local21[2].y, x:_local21[3].x, y:_local21[3].y});
_renderArray.push({type:"cv", cx:_local21[4].x, cy:_local21[4].y, x:_local3[0].x, y:_local3[0].y});
_renderArray.push({type:"breakFill"});
_local23 = averagePoints(_local3[_local12 + 1], _local3[_local12]);
_renderArray.push({type:"mv", x:_local23.x, y:_local23.y});
_local7 = _local12 + 1;
while (_local7 < (_local16 - 1)) {
var _local14 = averagePoints(_local3[_local7], _local3[_local7 + 1]);
_renderArray.push({type:"cv", cx:_local3[_local7].x, cy:_local3[_local7].y, x:_local14.x, y:_local14.y});
_local7++;
}
_renderArray.push({type:"ln", x:_local3[_local16 - 1].x, y:_local3[_local16 - 1].y});
var _local30 = averagePoints(_local27, _local26);
_renderArray.push({type:"cv", cx:_local27.x, cy:_local27.y, x:_local30.x, y:_local30.y});
_renderArray.push({type:"cv", cx:_local26.x, cy:_local26.y, x:_local31.x, y:_local31.y});
_local7 = _local16 - 1;
while (_local7 >= (_local12 + 1)) {
var _local14 = averagePoints(_local4[_local7], _local4[_local7 - 1]);
_renderArray.push({type:"cv", cx:_local4[_local7].x, cy:_local4[_local7].y, x:_local14.x, y:_local14.y});
_local7--;
}
_renderArray.push({type:"ln", x:_local23.x, y:_local23.y});
renderForm.render(lw, 13651, _renderArray);
}
function limitAngle(ang) {
if (ang < (-PI)) {
ang = ang + (PI * 2);
}
if (ang > PI) {
ang = ang - (PI * 2);
}
return(ang);
}
function smoothPoints(arr) {
var _local8 = [arr[0]];
var _local2 = 0;
while (_local2 < (arr.length - 2)) {
var _local9 = arr[_local2];
var _local6 = arr[_local2 + 2];
var _local5 = arr[_local2 + 1];
var _local4 = averagePoints(_local9, _local5);
var _local7 = averagePoints(_local6, _local5);
var _local10 = averagePoints(_local4, _local7);
_local8.push(_local4);
_local8.push(_local7);
_local8.push(_local6);
_local2 = _local2 + 2;
}
return(_local8);
}
function averagePoints(p1, p2) {
return({x:(p1.x * 0.5) + (p2.x * 0.5), y:(p1.y * 0.5) + (p2.y * 0.5)});
}
function clearRender() {
renderForm.clear();
}
function getRenderArray() {
return(_renderArray);
}
var length = 0;
var maxLength = 90;
var fingerExt = 30;
var reachAngle = 0;
var handAngle = 0;
var handRoteV = 0;
var handReach = 0;
var handAV = 0;
var handV = 0;
var openGripAngle = 1.0471975511966;
var lw = 6;
var plantX = -212;
var plantY = -65;
var activeDir = 0;
var active = 20;
var dragCounter = 0;
var momentum = 0;
var gripCounter = 0;
var phaseOutFlag = false;
var maxShoulderAngle = -3.76991118430775;
var speed = 1;
var xOff = 0;
var frustrationMeter = 0;
}
Symbol 893 MovieClip [__Packages.TreePart] Frame 0
class TreePart extends MovieClip
{
var rootForm, _masterArr, parentNode, parent, childrenObjArr, kids, scale, extension, growthHistory, nodes, nodeCount, attachMovie, phase, removeMovieClip, _x, _y, _rotation, _growth;
function TreePart () {
super();
}
function init(rootMc, masterArr, arr, p, pNode, scl, initGrowth) {
rootForm = rootMc;
_masterArr = masterArr;
_masterArr.push(this);
parentNode = pNode;
parent = p;
childrenObjArr = arr;
kids = [];
lw = ((pNode.radius != undefined) ? ((pNode.radius * 2) * scalar) : (lw));
scale = ((scl != undefined) ? (scl) : 1);
extension = 0;
growthHistory = buildGrowthHistory(initGrowth);
nodes = [];
var _local2 = 0;
while (_local2 < nodeCount) {
if (arr[_local2] != undefined) {
nodes[_local2] = attachMovie("node", "node" + _local2, _local2);
nodes[_local2].rootForm = rootMc;
nodes[_local2].radius = lw / 2;
}
_local2++;
}
phase = "grow";
osc = ((random(1000) / 1000) * Math.PI) * 2;
}
function buildGrowthHistory(iGrowth) {
var _local3 = [];
var _local2 = iGrowth;
if (_local2 == undefined) {
_local2 = 0;
}
while (_local2 < 1) {
_local2 = _local2 + ((baseGrowth * (1 - _local2)) + ((baseGrowth * scalar) * _local2));
_local3.push(_local2);
}
return(_local3);
}
function run() {
if (phase == "grow") {
growth = (growthHistory[growthIndex]);
if (growth >= 1) {
phase = "done";
birthChildren((growth - 1) - baseGrowth);
growth = (1);
onGrowComplete();
} else {
growthIndex++;
}
}
if (phase == "wilt") {
growthIndex--;
growth = (growthHistory[growthIndex]);
if (growthIndex == 0) {
phase = "done";
parent.phase = "wilt";
removeMovieClip();
}
}
if (parentNode != undefined) {
_x = parentNode.x;
_y = parentNode.y;
_rotation = parentNode.rotation;
}
osc = getOsc();
}
function getOsc() {
var _local3 = oscV;
var _local2 = osc;
_local2 = _local2 + ((_local3 * 0.5) + ((_local3 * 0.5) * (1 - scale)));
if (_local2 > (Math.PI*2)) {
_local2 = _local2 - (Math.PI*2);
}
return(_local2);
}
function birthChildren(initGrowth) {
for (var _local5 in childrenObjArr) {
var _local3 = rootForm.getNextHighestDepth();
var _local2 = rootForm.attachMovie(childrenObjArr[_local5].type, ("kid" + _local3) + (id++), _local3);
_local2.init(rootForm, _masterArr, childrenObjArr[_local5].children, this, nodes[_local5], scale * scalar, initGrowth * scalar);
_local2.index = _local5;
kids.push(_local2);
}
}
function onGrowComplete() {
}
function set growth(val) {
_growth = val;
growthHistory.push(val);
if (val < 1) {
extension = val;
} else {
extension = 1;
}
//return(growth);
}
function get growth() {
return(_growth);
}
function getWeight() {
return(10 * extension);
}
var hexColor = 13651;
var oscV = 0.005;
var osc = 0;
var index = 0;
var scalar = 1;
var lw = 25;
var baseGrowth = 0.25;
var growthIndex = 0;
var id = 0;
}
Symbol 894 MovieClip [__Packages.TreeLimb] Frame 0
class TreeLimb extends TreePart
{
var scale, lineData, lw, parentNode, getWeight, extension, osc, clear, nodes, _y, _x, _rotation, hexColor, lineStyle, moveTo, curveTo;
function TreeLimb () {
super();
}
function init(rootMc, masterArr, arr, p, pNode, scl) {
super.init(rootMc, masterArr, arr, p, pNode, scl);
var _local4 = Math.round(scale * 200);
scl = (((scale * 1000) + random(_local4 * 2)) - _local4) / 1000;
maxFulcrumDist = maxFulcrumDist * Math.sqrt(scl);
maxFulcrumRadius = maxFulcrumRadius * Math.sqrt(Math.sqrt(scl));
maxFulcrumOffset = maxFulcrumOffset * Math.sqrt(scl);
swingRangeOffset = swingRangeOffset * Math.sqrt(scl);
swingRange = ((swingRange * 0.5) * (1 - scl)) + (swingRange * 0.5);
}
function run() {
lineData = [];
super.run();
draw();
}
function getWeightOffset() {
var _local2 = Math.pow((16 - lw) / 16, 4);
return(((getWeight() / 10) * Math.cos((parentNode.rotation / 180) * Math.PI)) * _local2);
}
function draw() {
weightOffset = ((weightOffset * 9) + getWeightOffset()) / 10;
var _local2 = getNodeCoords(extension, osc, swingRangeOffset + weightOffset);
var _local4 = _local2[0];
var _local3 = _local2[1];
clear();
drawLimb(0, 0, _local4, _local3, nodes[0], _local2[2]);
}
function getNodeCoords(ext, os, angleOffset) {
var _local3 = ((Math.sin(os) * swingRange) / 2) + angleOffset;
var _local2 = (((Math.sin(_local3) + 1) / 2) - 0.5) * 2;
_local2 = _local2 * _local2;
var _local7 = maxFulcrumDist * ext;
var _local5 = (maxFulcrumRadius * ext) + Math.abs(((maxFulcrumRadius * ext) / 3) * _local2);
var _local6 = maxFulcrumOffset * ext;
return([(_local7 + (_local5 * Math.cos(_local3))) - (_local6 * Math.sin(_local3)), ((_local5 * Math.sin(_local3)) * ext) + (_local6 * Math.cos(_local3)), _local2]);
}
function drawLimb(baseX, baseY, x, y, node, extFac) {
node._x = x;
node._y = y;
var _local3 = baseX + ((x * 4) / 7);
var _local2 = baseY;
_local3 = _local3 + ((_local3 / 2) * extFac);
_local2 = _local2 + ((_local2 / 2) * extFac);
node._rotation = (180 * Math.atan2(y - _local2, x - _local3)) / Math.PI;
drawBranch(baseX, baseY, _local3, _local2, x, y);
}
function drawBranch(baseX, baseY, midX, midY, nx, ny) {
lineData.push({lw:lw, color:hexColor, rotation:_rotation, x:_x, y:_y, initPt:{x:baseX, y:baseY}, midPt:{x:midX, y:midY}, endPt:{x:nx, y:ny}});
lineStyle(lw, hexColor);
moveTo(baseX, baseY);
curveTo(midX, midY, nx, ny);
}
var nodeCount = 1;
var weightOffset = 0;
var maxFulcrumDist = 40;
var maxFulcrumOffset = 4;
var fulcrumOffSetLimit = 20;
var maxFulcrumRadius = 20;
var swingRange = 0.098174770424681;
var swingRangeOffset = 0;
}
Symbol 895 MovieClip [__Packages.Branch] Frame 0
class Branch extends TreeLimb
{
var osc, oscV, clear, weightOffset, getWeightOffset, nodes, getNodeCoords, extension, parentNode, drawLimb, kids;
function Branch () {
super();
}
function run() {
super.run();
osc = osc + oscV;
clear();
var _local7 = lw;
weightOffset = (weightOffset + getWeightOffset()) / 2;
if (nodes[0] != undefined) {
var _local3 = getNodeCoords(extension, -osc, (-swingRangeOffset) + weightOffset);
var _local4 = -(parentNode.radius - (lw / 2));
var _local6 = _local3[0];
var _local5 = _local3[1];
drawLimb(0, _local4, _local6, _local5, nodes[0], 0);
}
if (nodes[1] != undefined) {
var _local3 = getNodeCoords(extension, osc + (Math.PI/4), swingRangeOffset + weightOffset);
var _local4 = parentNode.radius - (lw / 2);
var _local6 = _local3[0];
var _local5 = _local3[1];
drawLimb(0, _local4, _local6, _local5, nodes[1], 0);
}
}
function getWeight() {
var _local4 = super.getWeight();
var _local3 = 0;
while (_local3 < kids.length) {
_local4 = _local4 + kids[_local3].getWeight();
_local3++;
}
return(_local4);
}
var nodeCount = 2;
var swingRange = 0.098174770424681;
var lw = 16;
var scalar = 0.7;
var swingRangeOffset = 1.14239732857811;
}
Symbol 896 MovieClip [__Packages.TreeShape] Frame 0
class TreeShape extends MovieClip
{
var plan, _parent, fruitArray, numPopped, treeCollapsed, memberArr, branch;
function TreeShape () {
super();
plan = [{type:"branch", children:[{type:"branch", children:[{type:"branch", children:[{type:"fruit"}, {type:"fruit"}]}, {type:"branch", children:[{type:"fruit"}, {type:"fruit"}]}]}, {type:"branch", children:[{type:"branch", children:[{type:"fruit"}, {type:"fruit"}]}, {type:"branch", children:[{type:"fruit"}, {type:"fruit"}]}]}]}];
if (_root.processCoordinator.noFruit) {
var crawlChildren = function (arr) {
var _local1 = arr.length - 1;
while (_local1 >= 0) {
if (arr[_local1].type == "fruit") {
arr[_local1].type = "treeTip";
} else {
crawlChildren(arr[_local1].children);
}
_local1--;
}
};
crawlChildren(plan);
waitForReady = false;
_parent.onShapeReady();
}
fruitArray = [];
numPopped = 0;
treeCollapsed = false;
new DelayedEvent(this, 1, "init");
}
function init() {
memberArr = [];
branch.swingRangeOffset = 0;
branch.init(this, memberArr, plan, this, this);
}
function addFruit(obj, indx) {
fruitArray[7 - indx] = obj;
}
function popOffFruit(obj, mouseDragBoo) {
var _local3 = generateFruit(obj);
if (mouseDragBoo) {
_local3.onPress();
} else {
_local3.forceMotion((obj._rotation / 180) * Math.PI, 5);
}
obj.remove();
_root.processCoordinator.setAttentionTarget(_local3, 90);
numPopped++;
collapseTree();
}
function logSound(soundName) {
soundLog.push(soundName);
var _local3 = completeScaleVal.length;
var _local2 = soundLog.toString();
if (_local2.substr(_local2.length - _local3, _local3) == completeScaleVal) {
var _local4 = fruitArray.length - 1;
new DelayedEvent(this, 16, "nextFruit", [_local4]);
}
}
function nextFruit(popIndex) {
popOffFruit(fruitArray[popIndex]);
if (popIndex > 0) {
new DelayedEvent(this, 3, "nextFruit", [popIndex - 1]);
} else {
new DelayedEvent(this, 3, "collapseTree");
}
}
function collapseTree() {
if (!treeCollapsed) {
SoundManager.playSound("pop");
treeCollapsed = true;
_root.processCoordinator.noseProcess.doNose().forceMotion(Math.PI, 5, 1);
}
}
function onEnterFrame(forced) {
var _local2 = 0;
while (_local2 < memberArr.length) {
memberArr[_local2].run(forced != true);
_local2++;
}
}
function generateFruit(obj) {
var _local10 = obj._xscale;
var _local9 = obj._yscale;
var _local4 = _root.getCoords(obj.shape);
var _local6 = obj.getState();
var _local11 = (_local6.rotation / 180) * Math.PI;
var _local5 = obj.actualRadius;
var _local8 = _local4.x;
var _local7 = _local4.y;
var _local2;
_local2 = _root.attachClip("draggable");
_local2.setColor(obj.colr);
_local2.initShapeData("circle");
_local2.shapeCollision = true;
_local2.setPos(_local8, _local7);
_local2.radius = _local5;
_local2.hitSound = "click";
_local2.effect = _root.processCoordinator.getFruitEffectByIndex(obj.indx);
_root.processCoordinator.addEdible(_local2);
return(_local2);
}
function getState() {
var _local5 = [];
var _local4 = [];
var _local3 = 0;
while (_local3 < memberArr.length) {
var _local2 = memberArr[_local3];
if (_local2.isFruit && (!_local2.gone)) {
_local2.gone = true;
_local4.push(_local2);
}
_local5.push(_local2.lineData);
_local3++;
}
_local3 = _local4.length - 1;
while (_local3 >= 0) {
generateFruit(_local4[_local3]);
_local3--;
}
return({lines:_local5});
}
function setState(dataObj) {
onEnterFrame();
}
function onFruitComplete() {
grownFruit++;
checkForComplete();
}
function checkForComplete() {
if (grownFruit == 8) {
_parent.onShapeReady();
}
}
var rotation = 180;
var completeScaleVal = "do,re,mi,fa,so,la,ti,do2";
var soundLog = [];
var waitForReady = true;
var grownFruit = 0;
}
Symbol 897 MovieClip [__Packages.PipeShape] Frame 0
class PipeShape extends SuperClip
{
var myCoords;
function PipeShape () {
super();
myCoords = {};
}
function makePuff() {
var _local3 = _root.attachForeGroundDraggable("smokePuff");
_local3.init(myCoords);
}
function onExtendComplete() {
_puffing = true;
}
function onEnterFrame() {
var _local3 = _root.getGlobalCoords(this, {x:-111.4, y:8.4});
myCoords.x = _local3.x;
myCoords.y = _local3.y;
myCoords.rotation = (_root.processCoordinator.headTilt / Math.PI) * 180;
if (!_puffing) {
return(undefined);
}
counter++;
if (counter == 30) {
makePuff();
}
if (counter == 60) {
counter = 0;
}
}
var counter = 0;
var _puffing = false;
}
Symbol 898 MovieClip [__Packages.Nose] Frame 0
class Nose extends MovieClip
{
var shape, attachMovie;
function Nose () {
super();
}
function initShapeData(linkageId) {
shape = attachMovie(linkageId, "shape", 0);
shape.initNewShape();
}
function extend() {
readyForTug = false;
_extending = true;
extendShape(0);
}
function getMyBounds() {
return(shape.getMyBounds());
}
function onEnterFrame() {
if (_extending) {
_extendCounter++;
var _local2 = Curves.easeOut(_extendCounter / 8);
extendShape(_local2);
if (_extendCounter == 8) {
_extending = false;
if (shape.waitForReady != true) {
readyForTug = true;
}
shape.onExtendComplete();
}
}
}
function onShapeReady() {
readyForTug = true;
}
function extendShape(fac) {
shape._x = ((-(1 - fac)) * (1 - fac)) * shape.getBounds().xMin;
}
function getShapeData() {
return(shape.getState());
}
var readyForTug = true;
var _extending = false;
var _extendCounter = 0;
}
Symbol 899 MovieClip [__Packages.FlyingNose] Frame 0
class FlyingNose extends MovieClip
{
var shape, attachMovie, _x, removeMovieClip, getBounds;
function FlyingNose () {
super();
}
function initShapeData(linkageId, dataObj) {
shape = attachMovie(linkageId, "shape", 0);
shape.setState(dataObj);
}
function onEnterFrame() {
v = v - 2;
_x = _x + v;
if (isOutOfBounds()) {
removeMovieClip();
return("onEnterFrame");
}
}
function isOutOfBounds() {
return((_x + getBounds(this).xMax) < _root.xMin);
}
var v = 0;
}
Symbol 900 MovieClip [__Packages.FanShape] Frame 0
class FanShape extends NodeShape
{
var fans, shadowFans, propellorShell, footNodes, foot4, foot5, foot3, fixNodes, pullingAway, mAngle, _parent, wasJustHit;
function FanShape () {
super();
fans = [];
shadowFans = [];
var o = this;
var _local3 = 0;
while (_local3 < 3) {
fans[_local3] = propellorShell.attachMovie("fanBlade", "fb" + _local3, _local3);
shadowFans[_local3] = propellorShell.attachMovie("fanBlade", "sb" + _local3, (-_local3) - 1);
shadowFans[_local3]._alpha = 50;
fans[_local3].onPress = function () {
o.pickup();
};
_local3++;
}
footNodes = [foot4, foot5, foot3];
setAngle(fanAngle, 0);
propellorShell._xscale = 50;
}
function initNewShape() {
var _local2 = 0;
while (_local2 < 3) {
fans[_local2]._xscale = (fans[_local2]._xscale = 0);
shadowFans[_local2]._xscale = (shadowFans[_local2]._xscale = 0);
_local2++;
}
}
function setAngle(rad, diff, setNodes) {
var _local4 = (50 * (1 - (diff / 0.7))) + 50;
if (_local4 < 50) {
_local4 = 50;
}
if (_local4 > 100) {
_local4 = 100;
}
var _local2 = 0;
while (_local2 < 3) {
var _local3 = ((rad / Math.PI) + (0.666666666666667 * _local2)) * Math.PI;
fans[_local2]._rotation = (_local3 / Math.PI) * 180;
fans[_local2]._alpha = _local4;
shadowFans[_local2]._rotation = ((_local3 - (diff / 3)) / Math.PI) * 180;
shadowFans[_local2]._alpha = _local4 / 2;
if (setNodes) {
footNodes[_local2]._x = propellorShell._x + ((Math.cos(_local3) * 73) / 2);
footNodes[_local2]._y = propellorShell._y + (Math.sin(_local3) * 73);
}
_local2++;
}
}
function onExtendComplete() {
growBlades = true;
}
function onEnterFrame() {
if (fixNodes) {
return(undefined);
}
if (growBlades) {
growCounter++;
var _local3 = 0;
while (_local3 < 3) {
var _local5 = Curves.easeOut(growCounter / 6) * 100;
fans[_local3]._xscale = (fans[_local3]._xscale = _local5);
shadowFans[_local3]._xscale = (shadowFans[_local3]._xscale = _local5);
_local3++;
}
if (growCounter == 6) {
growBlades = false;
}
}
if (pullingAway) {
tugV = tugV - 0.05;
tugVal = tugVal + tugV;
var o = this;
var _local6 = function () {
o.onSuccess(o.tugV);
SoundManager.playSound.pop();
};
_root.processCoordinator.noseProcess.shiftHead(tugVal, 0, _local6);
fanAngle = fanAngle + fanV;
} else if (isHit) {
var _local8 = new Between({x:0, y:0}, {x:propellorShell._xmouse, y:propellorShell._ymouse}).getAngle();
var _local13;
var _local4 = _local8 - mAngle;
while (_local4 > Math.PI) {
_local4 = _local4 - (Math.PI*2);
}
while (_local4 < -3.14159265358979) {
_local4 = _local4 + (Math.PI*2);
}
mAngle = mAngle + _local4;
if (mAngle > (Math.PI*2)) {
mAngle = mAngle - (Math.PI*2);
}
if (mAngle < 0) {
mAngle = mAngle + (Math.PI*2);
}
fanV = _local4;
fanAngle = mAngle;
} else {
if (Math.abs(fanV) > 0.9) {
if (fanV < 0) {
fanV = -0.9;
} else {
fanV = 0.9;
}
if (engineTries >= 2) {
upToSpeed = true;
}
engineTries++;
if (upToSpeed) {
_parent.onPress = function () {
};
var _local7 = SoundManager.playSound("planeSuccess");
new DelayedEvent(SoundManager, 30, "fadeOutSound", [_local7, 48]);
pullingAway = true;
} else {
SoundManager.playSound("planeFail");
}
} else if (wasJustHit && (Math.abs(fanV) > 0.4)) {
engineTries++;
SoundManager.playSound("planeFail");
}
if (!upToSpeed) {
var _local9 = Math.abs(fanV) / fanV;
fanV = fanV - ((0.05 * Math.sqrt(Math.abs(fanV) / 0.9)) * _local9);
if (Math.abs(fanV) < 0.005) {
fanV = 0.005;
}
}
fanAngle = fanAngle + fanV;
}
setAngle(fanAngle, fanV);
var _local10 = isHit;
checkHit();
wasJustHit = (!isHit) && (_local10);
}
function onMouseUp() {
mouseDown = false;
isHit = false;
}
function onMouseDown() {
mouseDown = true;
}
function checkHit() {
if (!mouseDown) {
isHit = false;
return(undefined);
}
if (isHit && (new Between({x:0, y:0}, {x:propellorShell._xmouse, y:propellorShell._ymouse}).getDistance() < 85)) {
isHit = true;
return(undefined);
}
var _local4 = false;
var _local3 = 0;
while (_local3 < 3) {
if (fans[_local3].hitTest(_root._xmouse, _root._ymouse, true)) {
_local4 = true;
}
_local3++;
}
isHit = _local4;
}
function pickup() {
isHit = true;
mAngle = new Between({x:0, y:0}, {x:propellorShell._xmouse, y:propellorShell._ymouse}).getAngle();
fanAngle = mAngle;
setAngle(mAngle);
}
function getState() {
return({fanV:fanV, fanAngle:fanAngle, upToSpeed:upToSpeed});
}
function setState(dataObj) {
fanV = dataObj.fanV;
fanAngle = dataObj.fanAngle;
upToSpeed = dataObj.upToSpeed;
setAngle(fanAngle, 0, true);
onEnterFrame();
}
var fanAngle = 0.5;
var fanV = 0.1;
var upToSpeed = false;
var engineTries = 0;
var tugVal = 0;
var tugV = 0;
var growCounter = 0;
var growBlades = false;
var mouseDown = false;
var isHit = false;
}
Symbol 901 MovieClip [__Packages.ChirpShape] Frame 0
class ChirpShape extends MovieClip
{
var chirpForm;
function ChirpShape () {
super();
}
function onEnterFrame() {
if ((random(20) == 1) && (chirpForm._cf == 1)) {
var o = chirpForm;
var onReverseComplete = function () {
};
var _local2 = function () {
o.reverse(1, onReverseComplete);
};
chirpForm.forward(1, _local2);
}
}
function getState() {
return(chirpForm._cf);
}
function setState(cf) {
chirpForm.gotoFrame(cf);
}
var initFlag = false;
}
Symbol 902 MovieClip [__Packages.CannonFuse] Frame 0
class CannonFuse extends ReversibleClip
{
var setFrame, initFrame, _totalframes, fuseMask, attachClip, m0, m1, m2, spark, fuseForm, hitSpot, snd, _parent;
function CannonFuse () {
super();
setFrame(((initFrame != undefined) ? (initFrame) : (_totalframes)));
fuseMask = attachClip("autoShape");
fuseMask.setMarkers([m0, m1, m2]);
spark._visible = false;
var o = this;
fuseMask._alpha = 0;
fuseMask.draw();
new DelayedEvent(fuseMask, 1, "draw");
fuseForm.setMask(fuseMask);
hitSpot.onRollOver = function () {
o.isLit = true;
o.spark._visible = true;
o.forward(1, o._endFunc);
if (o.snd == undefined) {
o.snd = SoundManager.playSound("hiss", 100);
}
};
if (isLit) {
hitSpot.onRollOver();
}
}
function _endFunc() {
spark._visible = false;
snd.stop();
snd = undefined;
_parent.onFuseComplete();
isLit = false;
}
function onFrame(frameNum) {
if (isLit) {
_root.processCoordinator.setAttentionTarget(spark);
}
fuseMask.draw();
}
var isLit = false;
}
Symbol 903 MovieClip [__Packages.CannonShape] Frame 0
class CannonShape extends NodeShape
{
var hitForm, retractForm, fuse;
function CannonShape () {
super();
}
function explodeFlower() {
hitForm.anim.forward(1, null, "explode");
SoundManager.playSound("pop", 200);
}
function onFuseComplete() {
var o = this;
var _local3 = function () {
o.retractForm.onRollOver = function () {
o.retract();
this.onRollOver = undefined;
};
};
hitForm.anim.forward(3, _local3);
SoundManager.playSound("flowerThunk", 100);
_root.processCoordinator.setAttentionTarget(retractForm, 60);
_root.processCoordinator.setSurprise(1);
_root.processCoordinator.clearSurprise(90);
}
function retract() {
hitForm.anim.reverse(1, null);
fuse.reverse(3);
}
function onExtendComplete() {
fuse.reverse(3);
}
function getState() {
return({animFrame:hitForm.anim.getFrame(), fuseFrame:fuse.getFrame(), isLit:fuse.isLit, snd:fuse.snd});
}
function setState(stateObj) {
hitForm.anim.gotoAndStop(stateObj.animFrame);
new DelayedEvent(hitForm.anim, 1, "setFrame", [stateObj.animFrame]);
fuse.gotoAndStop(stateObj.fuseFrame);
new DelayedEvent(fuse, 1, "setFrame", [stateObj.fuseFrame]);
new DelayedEvent(hitForm.anim, 1, "reverse", [1, null]);
fuse.initFrame = stateObj.fuseFrame;
fuse.isLit = stateObj.isLit;
fuse.snd = stateObj.snd;
}
}
Symbol 904 MovieClip [__Packages.Pufflet] Frame 0
class Pufflet extends MovieClip
{
var parent, x, y, offSetX, offSetY, maxR, _width, _height, stop, _y, _x, r, _disperseFlag, _disperseCount, v, _disperseR, _rotation, play;
function Pufflet () {
super();
}
function init(p, r, ox, oy) {
parent = p;
x = 0;
y = 20;
offSetX = ox;
offSetY = oy;
maxR = r;
_width = (_height = initR);
stop();
onEnterFrame();
}
function onEnterFrame() {
var _local3;
if (age < maxAge) {
age++;
_local3 = age / maxAge;
var _local4 = Curves.scurve(_local3);
_y = (y + (offSetY * _local4)) + ((offSetY / 5) * (1 - _local4));
_x = (x + (offSetX * _local4)) + ((offSetX / 5) * (1 - _local4));
var _local5 = Curves.scurve(_local3);
r = (_local5 * maxR) + ((1 - _local5) * initR);
_height = r * 2;
_width = r * 2;
} else {
_local3 = 1;
}
if (_disperseFlag) {
_disperseCount++;
if (_disperseCount == 10) {
parent.onDisperseComplete(this);
}
}
v = ((1 - _local3) * 10) + (cruiseV * _local3);
y = y - v;
_y = y + (offSetY * _local3);
if ((y < -400) || ((_y + parent._y) < (_root.yMin - 50))) {
parent.disperse();
}
}
function disperse() {
if (_disperseFlag) {
return(undefined);
}
_disperseFlag = true;
_disperseCount = 0;
_disperseR = r;
_rotation = random(360);
play();
}
var initR = 10;
var cruiseV = 2;
var age = 0;
var maxAge = 20;
}
Symbol 905 MovieClip [__Packages.SmokePuff] Frame 0
class SmokePuff extends SuperClip
{
var coords, pufflets, puffCount, counter, disperseCount, ox, oy, oRote, _x, _y, puffContent, _dispersing, mask, removeMovieClip;
function SmokePuff () {
super();
}
function init(c) {
coords = c;
pufflets = [];
puffCount = 0;
counter = 0;
disperseCount = 0;
ox = coords.x;
oy = coords.y;
oRote = coords.rotation;
_x = ox;
_y = oy;
}
function onEnterFrame() {
counter++;
if ((counter == 1) && (puffCount < 5)) {
counter = 0;
puffCount++;
var _local2 = puffContent.attachMovie("pufflet", "puff" + puffCount, puffCount);
var _local3 = 1.25663706143592 * puffCount;
_local2.init(this, random(20) + 15, Math.cos(_local3) * 20, Math.sin(_local3) * 20);
pufflets.push(_local2);
if (_dispersing) {
_local2.disperse();
}
}
mask._x = mask._x + (coords.x - ox);
mask._y = mask._y + (coords.y - oy);
ox = coords.x;
oy = coords.y;
oRote = coords.rotation;
vx = (driftSpeed + (vx * 9)) / 10;
_x = _x + vx;
}
function onDisperseComplete(puff) {
disperseCount++;
if (disperseCount == 5) {
removeMovieClip();
}
}
function onRollOver() {
disperse();
}
function disperse() {
if (_dispersing) {
return(undefined);
}
_dispersing = true;
disperseCount = 0;
var _local2 = 0;
while (_local2 < pufflets.length) {
pufflets[_local2].disperse();
_local2++;
}
}
static var driftSpeed = 0;
var vx = 0;
}
Symbol 906 MovieClip [__Packages.TreeTip] Frame 0
class TreeTip extends TreePart
{
var lineData, _y, _x;
function TreeTip () {
super();
}
function run(onFrame) {
lineData = [];
super.run();
draw();
}
function draw() {
lineData.push({x:_x, y:_y, endNode:true});
}
function getWeight() {
return(0);
}
var nodeCount = 0;
}
Symbol 907 MovieClip [__Packages.Node] Frame 0
class Node extends MovieClip
{
var getBounds, rootForm, _parent, _rotation, _width, _height, _radius;
function Node () {
super();
}
function get x() {
var _local2 = getBounds(rootForm);
return((_local2.xMin + _local2.xMax) / 2);
}
function get y() {
var _local2 = getBounds(rootForm);
return((_local2.yMin + _local2.yMax) / 2);
}
function get rotation() {
return(_rotation + _parent._rotation);
}
function set radius(num) {
_width = num * 2;
_height = num * 2;
_radius = num;
//return(radius);
}
function get radius() {
return(_radius);
}
}
Symbol 908 MovieClip [__Packages.SingingFruit] Frame 0
class SingingFruit extends MovieClip
{
var front, _currentframe, back, colorClip, soundName, play, _parent;
function SingingFruit () {
super();
front.gotoAndStop(_currentframe);
back.gotoAndStop(_currentframe);
}
function onEnterFrame() {
front.gotoAndStop(_currentframe);
back.gotoAndStop(_currentframe);
}
function setColor(colr) {
new Color(colorClip).setRGB(colr);
}
function setSound(sndName) {
soundName = sndName;
}
function playSound() {
if (_currentframe == 1) {
play();
SoundManager.playSound(soundName, 75);
_parent.rootForm.logSound(soundName);
}
}
}
Symbol 909 MovieClip [__Packages.TreeFruit] Frame 0
class TreeFruit extends TreePart
{
var indx, shape, attachMovie, sound, colr, rawRadius, onPress, rootForm, lineData, parent, _y, _x, parentNode, actualRadius, scale, __get__growth, _xscale, _yscale, extension, _rotation;
function TreeFruit () {
super();
if (indexArray.length == 0) {
var _local4 = 0;
while (_local4 < srcIndexArray.length) {
indexArray[_local4] = srcIndexArray[_local4];
_local4++;
}
}
indx = indexArray.splice(random(indexArray.length), 1)[0];
shape = attachMovie("fruitShape", "fruit", 0);
shape._x = 75;
sound = _root.processCoordinator.fruitDataArr[indx].sound;
colr = _root.processCoordinator.getFruitColorByIndex(indx);
new Color(shape).setRGB(colr);
rawRadius = _root.processCoordinator.getFruitRadiusByIndex(indx);
onPress = function () {
this.onMouseMove = function () {
this.popOff();
};
this.onMouseUp = function () {
this.onMouseMove = undefined;
};
};
}
function init(rootMc, masterArr, arr, p, pNode, scl, initGrowth) {
super.init(rootMc, masterArr, arr, p, pNode, scl, initGrowth);
rootForm.addFruit(this, indx);
}
function remove() {
shape.removeMovieClip();
gone = true;
}
function run(onFrame) {
lineData = [];
super.run();
draw();
}
function onGrowComplete() {
rootForm.onFruitComplete(this);
}
function fixLimb(src, amt, fac) {
src.parent.maxFulcrumOffset = src.parent.maxFulcrumOffset - (amt / (10 * fac));
runParents();
var _local6 = getParentDistance();
src.parent.maxFulcrumOffset = src.parent.maxFulcrumOffset + (amt / (10 * fac));
runParents();
var _local5 = getParentDistance();
if (_local6 < _local5) {
src.parent.maxFulcrumOffset = src.parent.maxFulcrumOffset - (0.2 + (amt / fac));
if (src.parent.maxFulcrumOffset < -20) {
src.parent.maxFulcrumOffset = -20;
}
} else {
src.parent.maxFulcrumOffset = src.parent.maxFulcrumOffset + ((amt / fac) - 0.2);
if (src.parent.maxFulcrumOffset > 20) {
src.parent.maxFulcrumOffset = 20;
}
}
}
function runParents(src) {
var _local3 = this;
var _local4 = [];
while (_local3.parent != src) {
_local3 = _local3.parent;
_local4.push(_local3);
}
var _local2 = _local4.length - 1;
while (_local2 >= 0) {
_local4[_local2].run();
_local2--;
}
}
function getFulcrumOffsetArray() {
return([parent.maxFulcrumOffset, parent.parent.maxFulcrumOffset]);
}
function setFulcrumOffset(baseArr, ang) {
parent.maxFulcrumOffset = baseArr[0] + ang;
parent.parent.maxFulcrumOffset = baseArr[1] + (ang / 2);
parent.parent.run();
parent.run();
}
function limitAngle(ang) {
if (ang > Math.PI) {
ang = ang - (Math.PI*2);
}
if (ang < -3.14159265358979) {
ang = ang + (Math.PI*2);
}
return(ang);
}
function getParentDistance() {
return(new Between({x:_x, y:_y}, parentNode).getDistance());
}
function popOff() {
rootForm.popOffFruit(this, true);
}
function draw() {
actualRadius = (Math.sin((__get__growth() * Math.PI) / 2) * scale) * rawRadius;
_xscale = (actualRadius / 75) * 100;
_yscale = (actualRadius / 75) * 100;
lineData.push({x:_x, y:_y, endNode:true});
}
function get parentOsc() {
return(parentNode._parent.osc);
}
function getWeight() {
if (gone) {
return(0);
}
return(20 * extension);
}
function getState() {
return({frame:shape._currentFrame, rotation:_rotation, hitSound:sound});
}
function setState(dataObj) {
shape.gotoAndPlay(dataObj.frame);
}
var nodeCount = 0;
var isFruit = true;
static var srcIndexArray = [0, 1, 2, 3, 4, 5, 6, 7];
static var indexArray = [];
var gone = false;
}
Symbol 910 MovieClip [__Packages.TreeLimbArm] Frame 0
class TreeLimbArm extends TreeLimb
{
function TreeLimbArm () {
super();
}
var osc = 0;
var maxFulcrumDist = 40;
var maxFulcrumOffset = 0;
var maxFulcrumRadius = 20;
var swingRange = 2.61799387799149;
var swingRangeOffset = 0;
var oscV = 0;
}
Symbol 911 MovieClip [__Packages.PhaseClip] Frame 0
class PhaseClip extends SuperClip
{
function PhaseClip () {
super();
}
function setPhaseDir(num) {
_phaseDir = num;
}
function step() {
var _local8 = 0;
var _local3 = _phaseThresholds[_phaseThresholds.length - 1] - 1;
var _local2 = _currentPhase;
_phaseCount = _phaseCount + _phaseDir;
if (_phaseCount < 0) {
_phaseCount = 0;
}
if (_phaseCount > _local3) {
_phaseCount = _local3;
}
_currentPhase = getPhaseForCount(_phaseCount);
if (_local2 != _currentPhase) {
if (_phaseDir == 1) {
onStep(_local2, _phaseThresholds[_local2 + 1], 1);
} else {
onStep(_local2, 0, 0);
}
switchPhase(_local2, _currentPhase);
}
var _local4 = _phaseThresholds[_currentPhase];
var _local7 = _phaseThresholds[_currentPhase + 1];
var _local5 = _phaseCount - _local4;
var _local6 = _local5 / (_local7 - _local4);
onStep(_currentPhase, _local5, _local6);
}
function getPhaseForCount(count) {
var _local3 = _phaseThresholds.length;
var _local2 = 0;
while (_local2 < _local3) {
if (_phaseThresholds[_local2] > count) {
return(_local2 - 1);
}
_local2++;
}
}
function onStep(currPhase, currPhaseCount, currPhaseFrac) {
}
function switchPhase(oldPhase, newPhase) {
}
var _phaseThresholds = [];
var _phaseDir = 0;
var _phaseCount = 0;
var _currentPhase = 0;
}
Symbol 912 MovieClip [__Packages.Projector] Frame 0
class Projector extends PhaseClip
{
static var projectorInstance, currWheelType;
var _parentProcess, rollClip, wheel1, projectorGuts, wheel2, _phaseDir, _currentPhase, _contentData, _parent, gotoAndStop, beam, film, attentionTarget, loader, step;
function Projector () {
super();
projectorInstance = this;
_parentProcess = _root.processCoordinator.windowProcess;
var o = this;
rollClip.onPress = function () {
if (o._currentPhase == 1) {
if (Projector.isWheel) {
o.startUp();
} else {
o.shutDown();
}
} else if (o._currentPhase >= 3) {
o.shutDown();
}
};
rollClip.onRelease = function () {
};
rollClip.onRollOut = (rollClip.onDragOut = function () {
});
wheel1 = projectorGuts.wheel1;
wheel2 = projectorGuts.wheel2;
_root.processCoordinator.projectorWheel = wheel1;
wheel1._visible = isWheel;
setWheelEvents();
if (isWheel) {
if (currWheelType == undefined) {
currWheelType = "tentBalls";
new Color(wheel1).setRGB(wheelData[currWheelType].colr);
} else {
addWheel(currWheelType);
}
}
updateContentData(currWheelType);
}
function setWheelEvents() {
var o = this;
wheel1.onPress = function () {
o.removeWheel(true, false);
};
_phaseDir = 0;
}
function addWheel(type, rote) {
currWheelType = type;
var _local3 = wheelData[type].colr;
isWheel = true;
wheel1._visible = true;
wheel1._rotation = rote;
new Color(wheel1).setRGB(_local3);
updateContentData(type);
_root.processCoordinator.reportEvent("projectorNewWheel");
}
function removeWheel(grabFlag, bumpingObj) {
if (!isWheel) {
return(undefined);
}
SoundManager.playSound("filmClick");
isWheel = false;
wheel1._visible = false;
var _local4 = _root.getGlobalCoords(wheel1);
var _local3;
_local3 = _root.attachForeGroundDraggable("draggable");
configLooseWheel(_local3, currWheelType, _local4.x, _local4.y);
if (grabFlag) {
_local3.onPress();
}
_local3.shape._rotation = wheel1._rotation;
if (_currentPhase > 1) {
_phaseDir = -1;
}
if (bumpingObj != false) {
var _local5 = new Between(bumpingObj, _local4);
var _local6 = _local5.getAngle();
var _local7 = 10;
_local3.forceMotion(_local6, 10, 1);
}
_root.processCoordinator.looseWheel = _local3;
_root.processCoordinator.reportEvent("projectorWheelLoose");
}
function updateContentData(type) {
_parentProcess.setCurrentWindowType(type);
_contentData = _parentProcess.getWindowContentData(type);
}
function onOpen() {
_phaseDir = 1;
}
function cleanUp() {
SoundManager.killSound(noise);
}
function onWindowRollOut() {
if (_currentPhase < 2) {
_phaseDir = -1;
}
}
function onStep(currPhase, currPhaseCount, currPhaseFrac) {
if (currPhase == 0) {
if ((currPhaseCount == 0) && (_phaseDir == -1)) {
_parent.onContentComplete();
_phaseDir = 0;
}
gotoAndStop(currPhaseCount + 1);
} else if (currPhase == 1) {
} else if (currPhase == 2) {
var _local3 = Curves.scurve(currPhaseFrac);
beam._alpha = 100 * _local3;
wheel1.setSpeed(_local3);
wheel2.setSpeed(_local3);
noise.setVolume(30 * _local3);
_local3 = Curves.scurve(currPhaseFrac);
film.fader._alpha = 100 * (1 - _local3);
}
}
function getContent() {
return(film);
}
function switchPhase(oldPhase, newPhase) {
if (newPhase == 0) {
if (_phaseDir == 1) {
}
} else if (newPhase == 1) {
if (_phaseDir == 1) {
} else {
SoundManager.killSound(noise);
noise = null;
_parent.onEvent("filmEnd");
_parentProcess.saveContentData("tentBalls", film.getData());
film.removeMovieClip();
film = null;
projectorGuts.gotoAndStop(1);
if (!isShuttingDown) {
_phaseDir = 0;
}
}
if (_phaseDir == 1) {
_phaseDir = 0;
}
} else if (newPhase == 2) {
if (_phaseDir == -1) {
_parent.onEvent("filmFade");
} else {
if (noise == null) {
noise = SoundManager.playSound("filmNoise", 0, 999);
}
projectorGuts.gotoAndStop(2);
attentionTarget = projectorGuts.attentionTarget;
wheel1.setSpeed = (wheel2.setSpeed = function (frac) {
this.onEnterFrame = function () {
this._rotation = this._rotation - (frac * 8);
};
});
beam = projectorGuts.beam;
var o = this;
projectorGuts.getContentData = function () {
return(o._contentData);
};
_parent.onEvent("filmBegin");
filmIndx++;
loader = projectorGuts.filmShell;
film = loader.attachMovie("tentFilmLoader", "film" + filmIndx, filmIndx);
new DelayedEvent(this, 1, "initFilm");
_parentProcess.setAttentionTarget(attentionTarget);
}
}
}
function initFilm() {
film.setContentData(_contentData);
film.begin();
}
function startUp() {
_phaseDir = 1;
}
function shutDown() {
_phaseDir = -1;
isShuttingDown = true;
}
function onEnterFrame() {
step();
}
static function configLooseWheel(looseWheel, effect, x, y) {
var _local9 = wheelData[effect].colr;
looseWheel.shapeCollision = false;
looseWheel.setColor(_local9);
looseWheel.initShapeData("projectorWheel");
looseWheel.shapeCollision = false;
looseWheel.setPos(x, y);
looseWheel.radius = 17;
looseWheel.hitSound = "click";
looseWheel.effect = effect;
looseWheel.doesRoll = true;
looseWheel.onLetGo = function () {
var _local5 = Projector.projectorInstance;
var _local4 = _root.processCoordinator.projectorWheel;
var _local3 = _root.getGlobalCoords(_local4);
if ((!Projector.isWheel) && (this.hitTest(_local3.x, _local3.y, true))) {
_local5.addWheel(effect, looseWheel.shape._rotation);
SoundManager.playSound("filmSnap");
this.removeMovieClip();
}
};
wheelData[effect].exists = true;
looseWheel.onFrame = function () {
if (Projector.isWheel) {
var _local8 = Projector.projectorInstance;
var _local7 = _root.processCoordinator.projectorWheel;
var _local5 = _root.getGlobalCoords(_local7);
var _local4 = _local5.x - this._x;
var _local3 = _local5.y - this._y;
var _local6 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local6 < (this.r * 2)) {
_local8.removeWheel(false, this);
}
}
};
looseWheel.onPickup = function () {
_root.processCoordinator.reportEvent("wheelPickedUp");
};
looseWheel.destroy = function () {
var o = this;
var _local2 = function () {
Projector.wheelData[o.effect].exists = false;
o.removeMovieClip();
};
this.fadeAway(30, _local2);
};
return(looseWheel);
}
var _phaseThresholds = [0, 20, 21, 36, 37];
var noise = null;
static var wheelData = {tentBalls:{colr:6737151, exists:true}, tentNested:{colr:6750105, exists:false}};
static var isWheel = true;
static var filmIndx = 0;
var isShuttingDown = false;
}
Symbol 913 MovieClip [__Packages.GroundObject] Frame 0
class GroundObject extends SuperClip
{
var px, _x, py, _y;
function GroundObject () {
super();
px = _x;
py = _y;
}
function onEnterFrame() {
px = px + (driftSpeed * driftFactor);
_x = px;
_y = py;
}
static var driftSpeed = 0;
var driftFactor = 1;
}
Symbol 914 MovieClip [__Packages.Obstacle] Frame 0
class Obstacle extends GroundObject
{
var px, _x, py, _y, getBounds, removeMovieClip, forePole, backPole, clear, beginFill, moveTo, lineTo, endFill, manager;
function Obstacle () {
super();
px = _x;
py = _y;
}
function onEnterFrame() {
px = px + GroundObject.driftSpeed;
_x = px;
if (!isFading) {
_y = py;
}
var _local6 = getBounds(_root);
if (_local6.xMin > _root.xMax) {
removeMovieClip();
return(undefined);
}
var _local5 = (px - _root.xMin) / (_root.xMax - _root.xMin);
forePole._x = (40 * _local5) + 20;
backPole._x = (-20 * _local5) + 10;
if (!isHit) {
clear();
beginFill(0);
moveTo(forePole._x, -100);
lineTo(forePole._x, -80);
lineTo(backPole._x, -72);
lineTo(backPole._x, -90);
lineTo(forePole._x, -100);
endFill();
}
if (px > _root.xMin) {
if (!isPast) {
var _local4 = _root.head.getBounds(_root);
if ((px > (((_local4.xMax + _local4.xMin) / 2) + 60)) && (!isHit)) {
isPast = true;
manager.onObstacleJump();
}
}
if ((((px > _root.xMin) && (px < _root.xMax)) && (!isHit)) && (!isPast)) {
var _local3 = _root.getGlobalCoords(this, {y:-95, x:0});
if ((_root.walkingLegsShell.hitTest(_local3.x, _local3.y, true) != false) || (_root.head.animForm.neckShape.hitTest(_local3.x, _local3.y, true) != false)) {
isHit = true;
isPast = true;
manager.onObstacleCrash();
onHit(0);
}
}
}
if ((!isFading) && (!active)) {
isFading = true;
doFade(0);
}
}
function doFade(count) {
count++;
var _local2 = 16;
var _local4 = Curves.easeIn(count / _local2);
_y = py + ((forePole._height + 10) * _local4);
if (count < _local2) {
new DelayedEvent(this, 1, "doFade", [count]);
} else {
removeMovieClip();
}
}
function onHit(step) {
step++;
var _local4 = Curves.easeOut(step / 15);
var _local2 = -1.5707963267949 * _local4;
forePole._rotation = (_local2 / Math.PI) * 180;
backPole._rotation = (_local2 / Math.PI) * 180;
var _local5 = _local2 + (Math.PI/2);
clear();
beginFill(0);
moveTo(forePole._x + (100 * Math.sin(_local2)), -100 * Math.cos(_local2));
lineTo(forePole._x + (80 * Math.sin(_local2)), -80 * Math.cos(_local2));
lineTo(backPole._x + (72 * Math.sin(_local2)), -72 * Math.cos(_local2));
lineTo(backPole._x + (90 * Math.sin(_local2)), -90 * Math.cos(_local2));
lineTo(forePole._x + (100 * Math.sin(_local2)), -100 * Math.cos(_local2));
endFill();
if (step < 15) {
new DelayedEvent(this, 1, "onHit", [step]);
}
}
static var active = false;
var isHit = false;
var isFading = false;
var isPast = false;
}
Symbol 915 MovieClip [__Packages.FireWork] Frame 0
class FireWork extends GroundObject
{
var bursts, fadeOut, _rotation, _x, px, _y, py, _xscale, _yscale;
function FireWork () {
super();
SoundManager.playSound("firework");
bursts = [];
rote = rote + ((Math.random() * Math.PI) + (Math.PI/2));
var o = this;
var _local3 = function () {
o.removeMovieClip();
};
fadeOut(24, _local3);
_rotation = (rote / Math.PI) * 180;
}
function setPos(x, y) {
_x = (px = x);
_y = (py = y);
}
function addBurst(burstObj) {
bursts.push(burstObj);
}
function onEnterFrame() {
fall = fall + 0.5;
fall = fall * 0.9;
py = py + fall;
super.onEnterFrame();
count++;
var _local6 = Curves.easeOut(count / 24);
var _local4 = 1 + (6 * _local6);
_xscale = (_yscale = 100 * _local4);
var _local5 = bursts.length;
var _local3 = 0;
while (_local3 < _local5) {
bursts[_local3]._xscale = (bursts[_local3]._yscale = 100 / _local4);
_local3++;
}
}
static var rote = 0;
var count = 0;
var driftFactor = 0.2;
var fall = 0;
}
Symbol 916 MovieClip [__Packages.SuccessDisplay] Frame 0
class SuccessDisplay extends SuperClip
{
var circles, attachMovie, fadeIn, _x, _y, _xscale, _yscale;
function SuccessDisplay () {
super();
circles = [];
var _local5 = 0;
while (_local5 < 5) {
var _local4 = attachMovie("obstacleMeterUnit", "cf" + _local5, _local5);
_local4._x = 16 + (28 * _local5);
_local4._y = 16;
_local4._width = (_local4._height = 20);
circles.push(_local4);
_local5++;
}
setCounter(0);
_root.addResizeListener(this);
resize();
fadeIn(10);
}
function resize() {
var _local3 = _root.scale;
_x = _root.xMin;
_y = _root.yMin;
_xscale = (_yscale = 100 / _local3);
}
function setCounter(num) {
var _local2 = 0;
while (_local2 < 5) {
if (_local2 < num) {
if (circles[_local2]._currentFrame == 1) {
circles[_local2].forward(1);
}
} else if (circles[_local2]._currentFrame != 1) {
circles[_local2].reverse(1);
}
_local2++;
}
}
var successColor = 61183;
var failColor = 13124;
}
Symbol 917 MovieClip [__Packages.StretchShape] Frame 0
class StretchShape extends AutoShape
{
var _oPts, markers, _pressed, _oCoords, _ymouse, _xmouse, onMouseUp, onMouseMove, _pullCoords, clear, beginFill, moveTo, curveTo;
function StretchShape () {
super();
_oPts = [];
var _local7 = markers.length;
var _local3 = 0;
while (_local3 < _local7) {
_oPts.push({x:markers[_local3]._x, y:markers[_local3]._y, rotation:markers[_local3]._rotation});
_local3++;
}
_pressed = false;
}
function onPress() {
_pressed = true;
_oCoords = {x:_xmouse, y:_ymouse};
onMouseUp = function () {
this.onMouseUp = null;
this.onMouseMove = null;
this._pressed = false;
};
onMouseMove = function () {
this.stretch();
};
}
function onEnterFrame() {
if (!_pressed) {
_pullCoords = {x:(_pullCoords.x + _oCoords.x) / 2, y:(_pullCoords.y + _oCoords.y) / 2};
doExtend(_oCoords, _pullCoords);
} else {
stretch();
}
draw(1, 3355443, 3355443);
}
function draw() {
var _local7 = [];
var _local8 = [];
var _local5 = markers.length;
var _local4 = 0;
while (_local4 < _local5) {
var _local2 = _local4 + 1;
if (_local2 == _local5) {
_local2 = 0;
}
var _local3 = markers[_local4];
var _local6 = markers[_local2];
_local8.push({x:_local3._x, y:_local3._y});
_local7.push({x:(_local3._x + _local6._x) / 2, y:(_local3._y + _local6._y) / 2});
_local4++;
}
clear();
beginFill(5767959);
moveTo(_local7[0].x, _local7[0].y);
_local4 = 0;
while (_local4 < _local5) {
var _local2 = _local4 + 1;
if (_local2 == _local5) {
_local2 = 0;
}
curveTo(_local8[_local2].x, _local8[_local2].y, _local7[_local2].x, _local7[_local2].y);
_local4++;
}
}
function stretch() {
_pullCoords = {x:_xmouse, y:_ymouse};
doExtend(_oCoords, _pullCoords);
}
function doExtend(oCoords, mouseCoords) {
var _local21;
var _local20;
var _local19 = new Between(oCoords, mouseCoords);
_local20 = _local19.getAngle();
var _local18 = {x:0, y:oCoords.y};
var _local16 = Math.atan2(mouseCoords.y - _local18.y, -(mouseCoords.x - _local18.x));
var _local17 = markers.length;
var _local6 = 0;
while (_local6 < _local17) {
var _local2 = _oPts[_local6];
var _local3 = markers[_local6];
var _local15 = oCoords.x;
if (_local2.x < _local15) {
var _local10 = _local2.x - oCoords.x;
var _local9 = _local2.y - oCoords.y;
var _local4 = _local16 * 0.8;
_local3._x = (mouseCoords.x + (Math.cos(_local4) * _local10)) + (Math.sin(_local4) * _local9);
_local3._y = (mouseCoords.y + (Math.cos(_local4) * _local9)) - (Math.sin(_local4) * _local10);
_local3._rotation = _local2.rotation - ((180 * _local4) / Math.PI);
} else {
var _local10 = _local2.x - oCoords.x;
var _local9 = _local2.y - oCoords.y;
var _local4 = _local16;
var _local14 = (mouseCoords.x + (Math.cos(_local4) * _local10)) + (Math.sin(_local4) * _local9);
var _local13 = (mouseCoords.y + (Math.cos(_local4) * _local9)) - (Math.sin(_local4) * _local10);
var _local12 = (_local2.rotation / 180) * Math.PI;
var _local11 = _local12 - _local4;
var _local8 = Math.pow(_local2.x / oCoords.x, 2);
_local3._x = _local2.x + ((_local14 - _local2.x) * _local8);
_local3._y = _local2.y + ((_local13 - _local2.y) * _local8);
_local3._rotation = (_local11 / Math.PI) * 180;
}
_local6++;
}
}
}
Symbol 918 MovieClip [__Packages.ProcessCoordinator] Frame 0
class ProcessCoordinator
{
var _mc, hintMaster, deactivatedBalls, eyeManager, attentionManager, noseProcess, _activeProcesses, eatProcess, walkProcess, feeder, introStepNum, beachBalls, hatchProcess, introBubbleOn, introBubble, coughProcess, windowProcess, cryProcess, yawnProcess, tuftProcess, looseWheel, waterBallPlaced, fishTankShell, fishBallCount, fishBalls, fader;
function ProcessCoordinator (mc, hm) {
_mc = mc;
hintMaster = hm;
deactivatedBalls = {};
}
function getFruitColorByIndex(indx) {
return(fruitDataArr[indx].color);
}
function getFruitRadiusByIndex(indx) {
return(75 * (1.2 - ((((indx / 10) * indx) / 10) * 1.2)));
}
function getFruitEffectByIndex(indx) {
return(fruitDataArr[indx].effect);
}
function setSurprise(num) {
eyeManager.setSurprise(num);
}
function clearSurprise(timeCount) {
if (timeCount == undefined) {
eyeManager.setSurprise(0);
} else {
new DelayedEvent(eyeManager, timeCount, "setSurprise", [0]);
}
}
function setAttentionTarget(obj, timeOut, delay) {
if (obj == attentionManager.activeEyeClip._parent) {
return(undefined);
}
if (delay != undefined) {
new DelayedEvent(attentionManager, delay, "setTarget", [obj]);
} else {
attentionManager.setTarget(obj);
}
if (timeOut != undefined) {
clearAttentionTarget(obj, timeOut);
}
}
function freezeAttention(time) {
attentionManager.setActive(false);
new DelayedEvent(attentionManager, time, "setActive", [true]);
}
function clearAttentionTarget(obj, delay) {
if (delay != undefined) {
new DelayedEvent(attentionManager, delay, "clearTarget", [obj]);
} else {
attentionManager.clearTarget(obj);
}
}
function getNose() {
return(noseProcess.getNose());
}
function removeNoseFromSequence(noseName) {
noseProcess.removeNoseType(noseName);
}
function addProcess(processName) {
var _local2 = this[processName + "Process"];
new DelayedEvent(this, 30, "beginProcess", [_local2]);
}
function beginProcess(process) {
process.kickOff();
}
function init() {
_activeProcesses = [];
attentionManager = new AttentionManager();
attentionManager.followMouse();
hintMaster.active = true;
eatProcess = new EatProcess(this);
eatProcess.init(_mc, _mc.eatSpot, _mc.swallowSpot);
_activeProcesses.push(eatProcess);
noseProcess = new NoseProcess(this);
noseProcess.addNoseType(_noseDataArr.regular);
noseProcess.init(_root.trunk, _mc.top, _mc, _global.noseActive);
noseProcess.setActive(true);
walkProcess = new WalkProcess(this);
walkProcess.init(_root.walkingLegsShell.content, _root.legsMask, _mc, _root.legRollOver, _root.ground, _mc.tail);
_activeProcesses.push(walkProcess);
if (_global.noseActive) {
noseProcess.kickOff();
_activeProcesses.push(noseProcess);
}
initYawn();
initNose();
initHatch();
if (_global.tuftActive) {
initTuft();
}
initWindow();
if (_global.feedActive) {
feeder = new Feeder(this);
eatProcess.addListener(feeder);
}
eyeManager = new EyeManager(this);
eyeManager.init(_mc, _mc.eye, attentionManager);
eyeManager.setActive(true);
eyeManager.initClose();
initCough();
initCry();
new DelayedEvent(_mc, 20, "growEar");
new DelayedEvent(eyeManager, 35, "open");
KeyListener.pc = this;
}
function doIntro() {
_mc._y = _root.yMax;
introStepNum = 0;
introStep();
}
function introStep() {
introStepNum++;
var _local3 = Curves.easeOut(introStepNum / 16);
_mc._y = (_root.yMax * (1 - _local3)) + (97.3 * _local3);
if (introStepNum < 16) {
new DelayedEvent(this, 1, "introStep");
}
}
function addFirstBeachBall() {
if (beachBallAdded == true) {
return(undefined);
}
beachBallAdded = true;
beachBalls = [];
ballsFaded = false;
new DelayedEvent(this, 120, "actuallyAddBeachBall");
}
function actuallyAddBeachBall(forceAdd) {
if ((forceAdd != true) && (ballsFading || (!hatchProcess.fullyOpen))) {
beachBallAdded = false;
return(undefined);
}
if (beachBallCount == 3) {
showWindow(400);
}
reportEvent("beachBallIntroduced");
var _local3 = feeder.addDraggable(beachBallSizes[beachBallCount], "beachBallShape" + beachBallCount, false, null, _root.xMin - 30, _root.yMax - 120, 0, 10, null);
beachBalls.push(_local3);
addEdible(_local3);
_local3.doNotEat = true;
_local3.shapeCollision = true;
_local3.dragSpeed = 30;
_local3.bounceFactor = 0.8;
if ((forceAdd != true) && (beachBallCount == 0)) {
checkBallY();
}
beachBallCount++;
if (forceAdd != true) {
checkForNextBeachBall();
}
}
function getCurrBeachBallData() {
return({indx:beachBallCount, radius:beachBallSizes[beachBallCount]});
}
function checkForNextBeachBall() {
var _local3 = true;
var _local2 = 0;
while (_local2 < beachBalls.length) {
if (beachBalls[_local2].hidden != true) {
_local3 = false;
}
_local2++;
}
if (_local3) {
new DelayedEvent(this, 120, "actuallyAddBeachBall");
} else if (!ballsFading) {
new DelayedEvent(this, 1, "checkForNextBeachBall");
}
}
function fadeBeachBalls() {
ballsFading = true;
var o = this;
var _local3 = function (obj) {
o.removeEatTarget(obj);
o.ballsFading = false;
o.ballsFaded = true;
o.beachBallAdded = false;
obj.remove();
};
var _local2 = beachBalls.length;
while (_local2 >= 0) {
beachBalls[_local2].fadeAway(20, _local3);
_local2--;
}
beachBalls = [];
beachBallCount = 0;
}
function checkBallY() {
var _local5 = hatchProcess.isGrasped;
var _local4 = "regular";
if (_local5) {
var _local3 = 0;
while (_local3 < beachBalls.length) {
if (beachBalls[_local3].hidden || (beachBalls[_local3].py < (_root.yMin + 200))) {
_local4 = "hatch";
}
_local3++;
}
}
ViewMaster.setFrame(_local4);
if (((!_local5) && (_local4 == "regular")) && (!hatchProcess.fullyOpen)) {
fadeBeachBalls();
} else {
new DelayedEvent(this, 1, "checkBallY");
}
}
function addFood(effect) {
_foodCount++;
var _local3 = feeder.addDraggable(21, "circle", 6352639, effect, _root.xMin - 30, _root.yMax - 120, 0, 10, null);
eatProcess.addEatTarget(_local3);
}
function killIntroBubble() {
if (!introBubbleOn) {
return(undefined);
}
introBubbleOn = false;
introBubble.forward(1, null, "outro");
new DelayedEvent(hintMaster, 120, "killHint", ["nose1"]);
}
function initIntroBubble() {
if (eventHasOccurred("noseDetached")) {
return(undefined);
}
introBubbleOn = true;
introBubble = _root.introBubble;
introBubble.definePaths(["intro", "outro"]);
var o = this;
var _local3 = function () {
new DelayedEvent(o.hintMaster, 5, "showHint", ["nose1"]);
new DelayedEvent(o, 80, "killIntroBubble");
};
introBubble.forward(1, _local3, "intro");
}
function initCough() {
coughProcess = new CoughProcess(this);
coughProcess.init(_mc, _mc.coughSpot, eyeManager);
_activeProcesses.push(coughProcess);
}
function initWindow() {
windowProcess = new WindowProcess(this);
windowProcess.init(_mc.top.window, _root.ballTracker);
windowProcess.setActive(true);
windowProcess.setWindowState("projector");
_activeProcesses.push(windowProcess);
}
function initCry() {
cryProcess = new CryProcess(this);
cryProcess.init(eyeManager, _mc.tearDropMaker);
cryProcess.setActive(true);
_activeProcesses.push(cryProcess);
}
function initYawn() {
yawnProcess = new YawnProcess(this);
yawnProcess.init(_mc, _mc.ear);
yawnProcess.setActive(true);
_activeProcesses.push(yawnProcess);
}
function initNose(noseTypesArr) {
noseProcess.kickOff();
_activeProcesses.push(noseProcess);
noseProcess.addNoseType(_noseDataArr.regular);
noseProcess.addNoseType(_noseDataArr.regular);
noseProcess.addNoseType(_noseDataArr.roman);
noseProcess.addNoseType(_noseDataArr.bulb);
noseProcess.addNoseType(_noseDataArr.block);
noseProcess.addNoseType(_noseDataArr.pipe);
noseProcess.addNoseType(_noseDataArr.fan);
noseProcess.addNoseType(_noseDataArr.cannon);
noseProcess.addNoseType(_noseDataArr.tree);
noseProcess.addNoseType(_noseDataArr.trunk);
}
function initHatch() {
hatchProcess = new HatchProcess(this);
hatchProcess.init(_mc, _mc.top.hatch, _mc.top.hand, _mc.top.handShadow, _mc.top.handFront, _mc.top.earButton, _mc.top.hatchContent);
hatchProcess.setActive(true);
hatchProcess.setContentType("legs");
_activeProcesses.push(hatchProcess);
}
function beginHatch() {
hatchProcess.kickOff();
}
function initTuft() {
tuftProcess = new TuftProcess(this);
tuftProcess.init(_mc.animForm);
_activeProcesses.push(tuftProcess);
tuftProcess.kickOff();
}
function addEdible(obj) {
eatProcess.addEatTarget(obj);
}
function getEdibles() {
return(eatProcess.getEatTargets());
}
function setActiveEye(obj) {
attentionManager.setActiveEye(obj);
}
function activateBall(tag, x, y, vx, vy, dragFlag, eyeFlag, shapeDataObj) {
var _local2 = deactivatedBalls[tag];
_local2.setPos(x, y);
_local2.vx = vx;
_local2.vy = vy;
_local2.show();
_local2.shape.setState(shapeDataObj);
if (eyeFlag) {
setActiveEye(_local2.shape);
}
if (dragFlag) {
_local2.onPress();
}
}
function deactivateBall(ballObj) {
ballObj.hide();
var _local2 = "ball" + tagIndex;
tagIndex++;
deactivatedBalls[tagIndex] = ballObj;
return(tagIndex);
}
function openMouth(frameRate) {
_mc.openMouth(frameRate);
}
function closeMouth(frameRate) {
_mc.closeMouth(frameRate);
}
function lockMouth() {
_mc.lockMouth(true);
}
function setMouthLock(key) {
_mc.setMouthLock(key);
}
function unlockMouth(key) {
_mc.removeMouthLock(key);
}
function swallow(effect) {
var o = this;
var _local2 = function () {
o.onEat(effect);
};
_mc.swallow(_local2);
}
function mouthIsBusy() {
return(_mc.mouthIsBusy);
}
function forceCry() {
cryProcess.forceCry();
}
function endCry() {
cryProcess.endCry();
}
function run() {
attentionManager.run();
eyeManager.run();
var _local2 = 0;
while (_local2 < _activeProcesses.length) {
_activeProcesses[_local2].run();
_local2++;
}
}
function onEat(evtType) {
reportEvent("eat");
reportEvent("swallow");
reportEvent(evtType);
}
function limitActivities(currActivityName) {
if (currActivityName != "fishTank") {
removeFishTank();
}
if (currActivityName != "window") {
windowProcess.forceClose();
}
if ((currActivityName != "hatch") && (currActivityName != "yawn")) {
hatchProcess.forceRelease();
}
if (currActivityName != "walk") {
walkProcess.shutDown();
}
if (currActivityName == "hatch") {
walkProcess.setActive(false);
}
}
function reportEvent(evtType) {
if (eventRecord[evtType] == undefined) {
eventRecord[evtType] = 1;
}
eventRecord[evtType]++;
switch (evtType) {
case "birdDream" :
limitActivities("birdDream");
hintMaster.active = false;
hatchProcess.setActive(false);
windowProcess.setActive(false);
yawnProcess.setActive(false);
noseProcess.setActive(false);
walkProcess.setActive(false);
eatProcess.setLock(true);
cryProcess.setActive(false);
eyeManager.setActive(false);
tuftProcess.shutDown();
_mc.shutDownSpots();
var _local4 = 25;
if (noseProcess._currNoseIndex > 2) {
noseProcess.forceNosePull(0);
_local4 = 40;
}
eyeManager.close();
var _local5 = _root.attachMovie("birdClusterShell", "birds", _root.birdDepth);
new DelayedEvent(this, _local4, "initBirdShell", [_local5, _root.faderDepth]);
break;
case "showCredits" :
new DelayedEvent(_root.bubble, 90, "play");
break;
case "beginYawn" :
limitActivities("yawn");
hintMaster.killHint("earLobe1");
break;
case "noseRolledOver" :
hintMaster.showHint("nose2", true, true);
break;
case "noseRolledOut" :
hintMaster.hideHint("nose2");
break;
case "noseClicked" :
hintMaster.killHint("nose1");
if (introBubbleOn) {
killIntroBubble();
}
break;
case "noseReleased" :
break;
case "noseDetached" :
hintMaster.killHint("nose2");
firstNose = false;
limitActivities("nose");
break;
case "springKnobPulled" :
break;
case "springKnobGrow" :
break;
case "windowKnock" :
break;
case "projectorStart" :
limitActivities("window");
break;
case "wheelPluck" :
limitActivities("window");
break;
case "wheelPickedUp" :
windowProcess.forceOpen();
break;
case "tentBallPluck" :
tentBallCount--;
limitActivities();
break;
case "tentBallAllPlucked" :
break;
case "projectorWheelLoose" :
break;
case "projectorNewWheel" :
if (Projector.currWheelType == "tentNested") {
new DelayedEvent(looseWheel, 60, "destroy");
}
break;
case "handEmerge" :
break;
case "userGraspKnob" :
limitActivities("hatch");
break;
case "handGrasp" :
break;
case "releaseKnobInHand" :
if ((legCount == 7) && (hatchProcess.currContentType == "legs")) {
addFirstBeachBall();
}
break;
case "beachBallIntroduced" :
break;
case "hatchBallsArePresent" :
ViewMaster.setFrame("hatch");
break;
case "releaseKnob" :
break;
case "hatchClosed" :
if (walkProcessIsReady()) {
walkProcess.setActive(true);
}
break;
case "noseCycleComplete" :
noFruit = true;
break;
case "spotsDone" :
_tentBallStates[2] = true;
break;
case "tuftsDone" :
_tentBallStates[1] = true;
break;
case "startFire" :
_root.trunk.avoidFire();
break;
case "endFire" :
_root.trunk.endAvoidFire();
new DelayedEvent(this, 20, "lockOutEat", [false]);
if (!fireHintShown) {
fireHintShown = true;
new DelayedEvent(hintMaster, 80, "killHint", ["earLobe"]);
new DelayedEvent(hintMaster, 20, "showHint", ["earLobe"]);
}
_tentBallStates[0] = true;
break;
case "eye" :
eyeManager.initHeadEye();
break;
case "earLobeRolledOver" :
hintMaster.showHint("earLobe1", true, true);
break;
case "earLobeRolledOut" :
hintMaster.hideHint("earLobe1");
break;
case "fire" :
lockOutEat(true);
yawnProcess.yawnState = "fire";
yawnProcess.doYawn();
new DelayedEvent(yawnProcess, 90, "endYawn");
hintMaster.killHint("earLobe1");
limitActivities("yawn");
break;
case "tuft" :
initTuft();
break;
case "spots" :
_mc.growSpots();
break;
case "hand" :
hatchProcess.turnOnHand();
break;
case "beginWalk" :
ViewMaster.setFrame("walking");
limitActivities("walk");
break;
case "endWalk" :
ViewMaster.setFrame("regular", undefined, "walking");
break;
case "smallHead" :
waterBallPlaced = false;
limitActivities();
hatchProcess.setContentType("smallHead0");
new DelayedEvent(hatchProcess, 10, "pushHatchOpen", ["hey", 30]);
new DelayedEvent(SoundManager, 20, "playSound", ["hey", 20]);
new DelayedEvent(SoundManager, 30, "playSound", ["hey", 10]);
break;
case "fishTank" :
walkProcess.filmWheelExists = false;
initFishTank();
break;
case "fishTankComplete" :
removeFishTank();
break;
case "fishTankRemoved" :
prohibitWalkProcess = false;
break;
case "obstacleCourseComplete" :
prohibitWalkProcess = true;
walkProcess.setActive(false);
break;
case "eat" :
walkProcess.shutDown();
}
if (evtType.substr(0, 3) == "leg") {
legCount++;
if (hatchProcess == undefined) {
initHatch();
}
var _local6 = evtType.split("_")[1];
hatchProcess.addLeg(_local6);
if (legCount == 7) {
if (hatchProcess.isGrasped) {
addFirstBeachBall();
}
}
hatchProcess.setContentType("legs");
}
if (evtType == "swallow") {
}
if (evtType == "newNose") {
var _local7 = noseProcess.getNoseType();
if ((_local7 == "trunk") && (getEdibles().length == 0)) {
new DelayedEvent(this, 25, "addFood", [null]);
}
}
}
function walkProcessIsReady() {
return(((legCount == 7) && (!prohibitWalkProcess)) && (eventHasOccurred("hatchBallsArePresent")));
}
function restart(shell, callBack) {
_level0.restart();
}
function addProjectorWheel() {
var _local3;
for (var _local4 in Projector.wheelData) {
if (Projector.wheelData[_local4].exists == false) {
_local3 = _local4;
}
}
looseWheel = _root.attachForeGroundDraggable("draggable");
Projector.configLooseWheel(looseWheel, _local3, _root.xMin - 10, 500);
looseWheel.onScreen = false;
setAttentionTarget(looseWheel);
return(looseWheel);
}
function initFishTank() {
ViewMaster.setFrame("regular");
limitActivities("fishTank");
var _local3 = _root.fishDepth;
_root.fishShell = (fishTankShell = _root.attachClip("fishTankShell"));
_root.stackClips();
new DelayedEvent(this, 1, "beginFishTank");
}
function onFishBallEaten() {
fishBallCount--;
if (fishBallCount == 0) {
if (!waterBallPlaced) {
waterBallPlaced = true;
new DelayedEvent(fishTankShell.fishTank, 30, "releaseBall");
} else {
new DelayedEvent(fishTankShell.fishTank, 30, "removeFishTank");
}
}
}
function beginFishTank() {
fishTankActive = true;
fishBallCount = 5;
fishBalls = [];
var _local3 = 0;
while (_local3 < fishBallCount) {
fishBalls[_local3] = _root.attachForeGroundDraggable("fishFood", {_y:_root.yMax, _x:_root.xMin - 16});
fishBalls[_local3].hide();
fishBalls[_local3].setColor(16777215);
fishBalls[_local3].extraInit(fishTankShell.fishTank);
fishBalls[_local3].bounceFactor = 0.8;
_local3++;
}
fishTankShell.fishTank.setBalls(fishBalls);
fishTankShell.fishTank.begin(0.5, 60, mx.utils.Delegate.create(this, onFishBallEaten), mx.utils.Delegate.create(this, onGrabFishTankBall), mx.utils.Delegate.create(this, onFishTankBallDry));
yawnProcess.setActive(false);
_mc.lockNeck();
_mc.hideEar();
eyeManager.setActive(false);
eatProcess.setLock(true);
eyeManager.close();
windowProcess.setActive(false);
walkProcess.setActive(false);
new DelayedEvent(this, 60, "addFishBalls");
}
function onGrabFishTankBall(srcObj) {
reportEvent("fishTankComplete");
}
function onFishTankBallDry(srcObj) {
makeFishTankBall(srcObj, true);
}
function makeFishTankBall(srcObj, doSnap) {
fishTankBallRemoved = true;
var fishTankBall = _root.attachClip("draggable");
fishTankBall.swapDepths(_root.foreDepth);
fishTankBall.initShapeData("circle");
fishTankBall.radius = 23;
fishTankBall.setColor(8917265);
var _local3 = _root.getGlobalCoords(srcObj);
fishTankBall.setPos(_local3.x, _local3.y);
fishTankBall.snapToMouse = true;
if (doSnap) {
fishTankBall.onPress(true);
}
fishTankBall.effect = "smallHead";
var o = this;
fishTankBall.onFrame = function () {
if (this.checkHit(HitManager.hitForms, this.px, this.py).hit != true) {
this.shapeCollision = true;
o.addEdible(this);
var _local3 = _root.newDepth();
fishTankBall.swapDepths(_local3);
}
};
}
function addFishBalls() {
walkProcess.convertScoreToPills(fishBalls);
new DelayedEvent(this, 20, "dropPill", [0]);
}
function dropPill(indx) {
var _local3 = fishBalls[indx];
_local3.inputLock = false;
_local3.baseGrav = 1;
var _local4 = _local3._xscale / 100;
sizePill(_local3, 0, 30, _local4, 1);
if (indx < 5) {
new DelayedEvent(this, 20, "dropPill", [indx + 1]);
} else {
_root.fadeInTitle();
}
}
function sizePill(obj, counter, maxCounter, startScale, endScale) {
counter++;
var _local2 = Curves.scurve(counter / maxCounter);
obj._xscale = (obj._yscale = 100 * ((startScale * (1 - _local2)) + (endScale * _local2)));
if (counter < maxCounter) {
new DelayedEvent(this, 1, "sizePill", [obj, counter, maxCounter, startScale, endScale]);
}
}
function removeFishTank() {
function onComplete() {
if ((!o.fishTankBallRemoved) && (o.fishTankShell.fishTank.ballReleased)) {
o.makeFishTankBall(o.fishTankShell.fishTank.floatingBall, false);
}
o.eyeManager.open();
o.fishTankShell.removeMovieClip();
o.yawnProcess.setActive(true);
o.eyeManager.setActive(true);
o.eatProcess.setLock(false);
o.windowProcess.setActive(true);
o.walkProcess.setActive(o.walkProcessIsReady());
o._mc.unlockNeck();
o._mc.growEar();
o.reportEvent("fishTankRemoved");
}
if (!fishTankActive) {
return(undefined);
}
fishTankActive = false;
var o = this;
fishTankShell.fishTank.shutDown(30, onComplete);
var _local2 = 0;
while (_local2 < 5) {
if (fishBalls[_local2]._width != undefined) {
fadeAndRemove(fishBalls[_local2], 0, 10);
}
_local2++;
}
}
function fadeAndRemove(obj, counter, counterMax) {
counter++;
obj._alpha = 100 * (1 - (counter / counterMax));
if (counter == counterMax) {
obj.removeMovieClip();
} else {
new DelayedEvent(this, 1, "fadeAndRemove", [obj, counter, counterMax]);
}
}
function initBirdShell(shell, faderDpth) {
var o = this;
var completionCallBack = function () {
new DelayedEvent(o, 90, "restart", [shell, null]);
};
var headFadeCallBack = function () {
SoundManager.playSound("squawk", 40);
new DelayedEvent(SoundManager, 40, "playSound", ["squawk", 20]);
new DelayedEvent(SoundManager, 80, "playSound", ["squawk", 12]);
o._mc._visible = false;
shell.activate(completionCallBack);
};
var _local2 = function () {
o.fadeOutHead(faderDpth, headFadeCallBack);
};
shell.doIntro(_local2);
}
function fadeOutHead(dpth, callBack) {
fader = _root.attachMovie("fader", "fader", dpth);
fader._x = _root.xMin;
fader._y = _root.yMin;
fader._width = _root.xMax - _root.xMin;
fader._height = _root.yMax - _root.yMin;
var _local3 = {callBack:callBack};
new DelayedEvent(_local3, fader._totalFrames, "callBack");
}
function showWindow(time) {
if (windowForced) {
return(undefined);
}
windowForced = true;
new DelayedEvent(this, time, "fakeKnock");
new DelayedEvent(this, time + 10, "fakeKnock");
new DelayedEvent(this, time + 20, "fakeKnock");
}
function fakeKnock() {
if ((!eventHasOccurred("windowOpening")) && (!windowProcess.rolledOver)) {
windowProcess.fakeKnock();
}
}
function getTentBallStates() {
return(_tentBallStates);
}
function setTentBallStates(arr) {
_tentBallStates = arr;
}
function lockOutEat(boo) {
eatProcess.setLock(boo);
if (boo) {
HitManager.addHitForm(_mc.animForm.mouthShape);
} else {
HitManager.removeHitForm(_mc.animForm.mouthShape);
}
}
function reportLocation(locationName) {
var _local2 = new LoadVars();
_local2.loke = locationName;
_local2.lokeStep = currStep++;
_local2.userId = userId;
var _local3 = new LoadVars();
_local2.sendAndLoad("report.php", _local3, "POST");
}
function eventHasOccurred(evtType) {
return(eventRecord[evtType] > 0);
}
function setPanSpeed(dx) {
Draggable.driftSpeed = dx;
Trycloid.driftSpeed = dx;
GroundObject.driftSpeed = dx;
SmokePuff.driftSpeed = dx;
}
function setLift(amt) {
_mc.yLift = amt;
hintMaster._y = -amt;
yawnProcess.updateFireY();
ViewMaster.onResize();
}
function rotateAroundPoint(tipAmt, xpt, ypt) {
headTilt = tipAmt;
_mc.rotateAroundPoint(tipAmt, xpt, ypt);
}
var eventRecord = {};
var noseCycleCompleted = false;
var maxWantRadius = 26;
var tentBallCount = 3;
var noFruit = false;
var creditsShown = false;
var firstNose = true;
var fireHintShown = false;
var legCount = 0;
var beachBallAdded = false;
var beachBallCount = 0;
var beachBallSizes = [25, 23, 21];
var _noseDataArr = {regular:{type:"regular", tuggable:true}, roman:{type:"roman", tuggable:true}, bulb:{type:"bulb", tuggable:true}, block:{type:"block", tuggable:true}, pipe:{type:"pipe", tuggable:true}, fan:{type:"fan", tuggable:true}, cannon:{type:"cannon", tuggable:true}, tree:{type:"tree", tuggable:true}, trunk:{type:"trunk", tuggable:true}};
var tentBallEffects = ["fire", "tuft", "spots"];
var fruitDataArr = [{color:3368550, sound:"do", effect:"leg_elephant"}, {color:26163, sound:"re", effect:"leg_tentacle"}, {color:3355392, sound:"mi", effect:"leg_bear"}, {color:6697728, sound:"fa", effect:"leg_horse"}, {color:13421721, sound:"so", effect:"leg_lady"}, {color:16737843, sound:"la", effect:"leg_duck"}, {color:13158, sound:"ti", effect:"leg_robot"}, {color:16777215, sound:"do2", effect:"hand"}];
var processData = {nose:{knockOuts:[]}, ear:{knockOuts:[]}, hatch:{knockOuts:[]}, eye:{knockOuts:[]}, mouth:{knockOuts:[]}};
var ballsFading = false;
var ballsFaded = false;
var _foodCount = 0;
var tagIndex = 0;
var prohibitWalkProcess = false;
var fishTankActive = false;
var fishTankBallRemoved = false;
var windowForced = false;
var _tentBallStates = [true, true, true];
var currStep = 0;
var userId = 100000 + random(900000);
var headTilt = 0;
}
Symbol 919 MovieClip [__Packages.AttentionManager] Frame 0
class AttentionManager
{
var activeEyeClips, attentionType, attentionClip, mergeCoords;
function AttentionManager () {
activeEyeClips = {};
}
function setActiveEye(obj, owner) {
if (owner == undefined) {
owner = "main";
}
activeEyeClips[owner] = obj;
activeEyeClips[owner].initLook();
}
function followMouse() {
attentionType = "mouse";
}
function setTarget(clip, timeOut) {
newTarget = true;
attentionType = "clip";
attentionClip = clip;
attentionTime = ((timeOut == undefined) ? false : (timeOut));
}
function addTarget() {
}
function clearTarget(obj) {
if ((obj == undefined) || (obj == attentionClip)) {
followMouse();
}
}
function setActive(boo) {
_active = boo;
}
function getAttentionCoords(obj) {
return(_root.getLocalCoords(obj, {x:lastCoords.x, y:lastCoords.y}));
}
function run() {
if (!_active) {
return(undefined);
}
if (attentionTime != null) {
attentionTime--;
}
if (attentionTime == 0) {
newTarget = true;
attentionType = "mouse";
attentionTime = null;
}
var _local7;
if ((attentionType == "clip") && ((attentionClip == undefined) || (attentionClip._visible != true))) {
newTarget = true;
attentionType = "mouse";
}
if (attentionType == "clip") {
_local7 = _root.getCoords(attentionClip);
} else {
_local7 = {x:_root._xmouse, y:_root._ymouse};
}
if (newTarget) {
attentionEase = 10;
mergeCoords = lastCoords;
}
if (attentionEase > 0) {
attentionEase--;
var _local9 = Curves.scurve(1 - (attentionEase / 10));
_local7.x = (_local7.x * _local9) + (mergeCoords.x * (1 - _local9));
_local7.y = (_local7.y * _local9) + (mergeCoords.y * (1 - _local9));
}
for (var _local8 in activeEyeClips) {
var _local3 = activeEyeClips[_local8];
if (_local3.controlled != true) {
var _local6;
var _local5;
if (_local3.fixedCoordinates == false) {
var _local4 = _root.getCoords(_local3);
_local6 = _local7.x - _local4.x;
_local5 = _local7.y - _local4.y;
} else {
_local6 = _local3.fixedCoordinates[0];
_local5 = _local3.fixedCoordinates[1];
}
_local3.lookRun(_local6, _local5);
}
}
lastCoords = _local7;
newTarget = false;
}
var attentionTime = null;
var attentionEase = 0;
var lastCoords = {x:0, y:0};
var newTarget = false;
var _active = true;
}
Symbol 920 MovieClip [__Packages.EatProcess] Frame 0
class EatProcess extends Process
{
var _locked, _head, _eatSpot, _swallowSpot, _eatListener, wasEating, _coordinator;
function EatProcess (coord) {
super(coord);
}
function init(head, eatSpot, swallowSpot) {
_locked = false;
_head = head;
_eatSpot = eatSpot;
_swallowSpot = swallowSpot;
}
function setLock(boo) {
_locked = boo;
}
function addListener(obj) {
_eatListener = obj;
}
function run() {
checkEatTargets();
}
function addEatTarget(obj) {
_eatTargets.push(obj);
obj.shapeCollision = true;
}
function getEatTargets() {
return(_eatTargets);
}
function removeEatTarget(obj) {
_eatListener.onEaten(obj);
var _local2 = 0;
while (_local2 < _eatTargets.length) {
if (_eatTargets[_local2] == obj) {
_eatTargets.splice(_local2, 1);
}
_local2++;
}
obj.remove();
}
function checkEatTargets() {
var _local2;
for (var _local3 in _eatTargets) {
if (checkEatTarget(_eatTargets[_local3])) {
_local2 = true;
wasEating = true;
}
checkSwallowTarget(_eatTargets[_local3], _eatTargets[_local3].effect == "eye");
}
if (_local2) {
if (!_coordinator.mouthIsBusy()) {
_coordinator.openMouth(2);
_coordinator.setMouthLock("eat");
_coordinator.closeMouth(2);
}
} else if (wasEating) {
_coordinator.unlockMouth("eat");
wasEating = false;
}
}
function checkEatTarget(obj) {
if (obj.doNotEat) {
return(undefined);
}
if (_eatSpot.hitTest(obj) && (!_locked)) {
if (_eatSpot.hitTest(obj._x, obj._y, true)) {
obj.slowMode = true;
return(true);
}
obj.slowMode = false;
return(false);
}
obj.slowMode = false;
return(false);
}
function checkSwallowTarget(obj, noSwallow) {
if (_swallowSpot.hitTest(obj) && (!_locked)) {
if (_swallowSpot.hitTest(obj._x, obj._y, true)) {
if (!noSwallow) {
_coordinator.swallow(obj.effect);
} else {
_coordinator.onEat(obj.effect);
}
removeEatTarget(obj);
_root.processCoordinator.freezeAttention(30);
return(true);
}
return(false);
}
return(false);
}
function emitObject(shapeId, effect, emitAction) {
_coordinator.openMouth(2);
_coordinator.setMouthLock("emit");
_coordinator.closeMouth(2);
_isEmitting++;
_head.isEmitting = true;
new DelayedEvent(this, 18, "produceObj", [shapeId, effect, emitAction, _head._x + _head.eatCoords.x, _head._y + _head.eatCoords.y]);
}
function produceObj(shapeId, effect, emitAction, x, y) {
_isEmitting--;
_head.isEmitting = _isEmitting > 0;
var _local3 = _root.attachClip("draggable", {_x:x, _y:y});
_local3.initShapeData(shapeId);
addEatTarget(_local3);
_local3.hitSound = "click";
_local3.effect = effect;
_local3.forceMotion(Math.PI, 7, 1);
emitAction.owner[emitAction.action](_local3);
new DelayedEvent(_coordinator, 12, "unlockMouth", ["emit"]);
}
var _eatTargets = [];
var _isEmitting = 0;
}
Symbol 921 MovieClip [__Packages.NoseProcess] Frame 0
class NoseProcess extends Process
{
var active, _trunk, _top, _head, _nose, eOx, iOx, _floatingNose, eOy, iOy, _coordinator, playSound, setAttentionTarget, reportEvent;
function NoseProcess (coord) {
super(coord);
}
function setActive(boo) {
active = boo;
}
function addNoseType(typeData) {
_noseArr.push(typeData);
}
function removeNoseType(noseName) {
var _local3 = _noseArr.length;
var _local2 = _local3 - 1;
while (_local2 >= 0) {
if (_noseArr[_local2].type == noseName) {
_noseArr.splice(_local2, 1);
}
_local2--;
}
}
function init(trunk, top, head, noseActive) {
_trunk = trunk;
_top = top;
_head = head;
_nose = attachNose();
_nose.gotoAndStop("complete");
}
function kickOff() {
setNosePullMethod();
}
function run() {
if (noseShift) {
noseShiftCounter++;
var _local2 = Math.sin(((Math.PI/2) * noseShiftCounter) / 4);
_floatingNose.ox = (iOx * (1 - _local2)) + (eOx * _local2);
_floatingNose.oy = (iOy * (1 - _local2)) + (eOy * _local2);
if (noseShiftCounter == 4) {
noseShift = false;
}
}
}
function getNose() {
return(_nose);
}
function removeNose() {
_nose.onRemove();
removeMovieClip(_nose);
}
function attachNose() {
var _local2 = _top.noseContainer.attachMovie("growNose", "nose" + _currNoseIndex, _currNoseIndex, {_x:_noseX, _y:_noseY});
_local2.initShapeData(getNoseType() + "NoseShape");
HitManager.addHitForm(_local2);
return(_local2);
}
function getNoseType() {
return(_noseArr[_currNoseIndex].type);
}
function doNose(xShift, yShift, dontSetNextNoseEventBoo) {
_coordinator.hairProcess.deactivateHand();
var noseType = getNoseType();
if (noseType == "trunk") {
_nose.shape.form.releaseWant();
}
playSound("pop");
_floatingNose = attachNoseClip("draggable");
var _local4;
if (noseType == "tree") {
_local4 = "renderShapeTree";
} else if (noseType == "trunk") {
_local4 = "renderShapeTrunk";
} else {
_local4 = _noseArr[_currNoseIndex].type + "NoseShape";
}
var _local7;
var _local5;
if (noseType == "trunk") {
_local7 = _nose.shape.form._xmouse;
_local5 = _nose.shape.form._ymouse;
} else {
_local7 = _nose._xmouse;
_local5 = _nose._ymouse;
}
_floatingNose.drag = true;
_floatingNose.ox = _local7;
_floatingNose.oy = _local5;
iOx = _local7;
eOx = iOx + xShift;
iOy = _local5;
var _local3 = _nose.getMyBounds();
if (iOy > ((_local3.yMax * 3) / 4)) {
iOy = (_local3.yMax * 3) / 4;
}
if (iOy < ((_local3.yMin * 3) / 4)) {
iOy = (_local3.yMin * 3) / 4;
}
eOy = iOy + yShift;
noseShift = true;
noseShiftCounter = 0;
_floatingNose.initShapeData(_local4, _nose.getShapeData());
var _local6;
if (noseType == "trunk") {
_local6 = _root.getCoords(_nose.shape.form);
} else {
_local6 = _root.getCoords(_nose);
}
removeNose();
_floatingNose.px = _local6.x;
_floatingNose.py = _local6.y;
_floatingNose.onEnterFrame(true);
var o = this;
if (noseType == "fan") {
_floatingNose.onLetGo = function () {
if (this.shape.upToSpeed) {
o.noseFlyAway(this.getShapeData());
new DelayedEvent(o, 60, "gotoNextNose");
}
};
}
_floatingNose.onGroundHit = function () {
o.noseWalkAway(this.getShapeData(), noseType);
if (dontSetNextNoseEventBoo != true) {
o.gotoNextNose();
}
};
setAttentionTarget(_floatingNose);
return(_floatingNose);
}
function forceNosePull(nextNoseIndex) {
doNose(0, 0, true);
_floatingNose.forceMotion(Math.PI, 8, 1);
if (nextNoseIndex != undefined) {
_currNoseIndex = nextNoseIndex - 1;
}
new DelayedEvent(this, 30, "gotoNextNose");
}
function gotoNextNose() {
_currNoseIndex++;
if (_currNoseIndex == _noseArr.length) {
_currNoseIndex = 0;
_coordinator.reportEvent("noseCycleComplete");
}
var _local2 = getNoseType();
_nose = attachNose();
if (_local2 == "trunk") {
_nose.shape.init(_coordinator.getEdibles(), _top);
}
_nose.extend();
if (_local2 == "tree") {
}
if (_noseArr[_currNoseIndex].tuggable) {
setNosePullMethod();
}
if (getNoseType() == "fan") {
var o = this;
_nose.shape.onSuccess = function () {
o.noseFlyAway(o._nose.getShapeData());
new DelayedEvent(o, 40, "gotoNextNose");
};
}
reportEvent("newNose");
}
function shiftHead(tugValX, tugValY, rtnFunc) {
var _local6;
var _local2 = tugValX;
var _local4;
if (_local2 >= 0) {
if (_local2 > 25) {
_local2 = 25;
}
_local4 = Math.sqrt(_local2);
}
if (_local2 < 0) {
if (_local2 < -25) {
_local2 = -25;
_local6 = true;
}
_local4 = -Math.sqrt(-_local2);
}
var _local3 = tugValY;
var _local5;
if (_local3 >= 0) {
if (_local3 > 25) {
_local3 = 25;
}
_local5 = Math.sqrt(_local3);
}
if (_local3 < 0) {
if (_local3 < -25) {
_local3 = -25;
}
_local5 = -Math.sqrt(-_local3);
}
_head.tug(_local4, _local5);
if (_local6 && (_nose.readyForTug)) {
rtnFunc(_local2, _local4, _local3, _local5);
_head.releaseTug();
}
}
function setNosePullMethod() {
var o = this;
var hitForm = _nose.shape.hitForm;
if (hitForm == undefined) {
hitForm = _nose.shape;
}
hitForm.onRollOver = function () {
o._coordinator.reportEvent("noseRolledOver");
};
hitForm.onRollOut = function () {
o._coordinator.reportEvent("noseRolledOut");
};
hitForm.onPress = function () {
if (!o.active) {
return(undefined);
}
var mx = _root._xmouse;
var my = _root._ymouse;
o._coordinator.reportEvent("noseClicked");
var onTugComplete = function (headShiftX, shiftAmtX, headShiftY, shiftAmtY) {
hitForm.onMouseMove = undefined;
o.doNose(-(headShiftX - shiftAmtX), -(headShiftY - shiftAmtY));
o._coordinator.reportEvent("noseDetached");
};
this.onMouseMove = function () {
o.shiftHead(_root._xmouse - mx, _root._ymouse - my, onTugComplete);
};
this.onMouseUp = function () {
this.onMouseMove = undefined;
o._head.releaseTug();
o._coordinator.reportEvent("noseReleased");
};
o.shiftHead(0, 0, onTugComplete);
};
}
function attachNoseClip(linkName) {
var _local3 = noseDepth++;
return(_root.noseLayer.attachMovie(linkName, "n" + _local3, _local3));
}
function noseFlyAway(initData) {
var _local3 = attachNoseClip("flyingNose");
var _local4 = _root.getCoords(_nose);
removeNose();
_local3._x = _local4.x;
_local3._y = _local4.y;
_local3.initShapeData(getNoseType() + "NoseShape", initData);
_local3.onEnterFrame();
_nose.removeMovieClip();
setAttentionTarget(_local3);
}
function noseWalkAway(initData, noseType) {
var _local2 = attachNoseClip("walkingNose");
var _local3;
if (noseType == "tree") {
_local3 = "renderShapeTree";
} else if (noseType == "trunk") {
_local3 = "renderShapeTrunk";
} else {
_local3 = noseType + "NoseShape";
}
_local2._x = _floatingNose._x;
_local2._y = _floatingNose._y;
_local2.initShapeData(_local3, initData);
_local2.onEnterFrame();
var _local4 = _floatingNose.getDepth();
_floatingNose.removeMovieClip();
_local2.swapDepths(_local4);
setAttentionTarget(_local2);
}
var _noseX = -270;
var _noseY = -42;
var _noseArr = [];
var _currNoseIndex = 0;
var noseShift = false;
var noseShiftCounter = 0;
var noseDepth = 0;
}
Symbol 922 MovieClip [__Packages.WalkProcess] Frame 0
class WalkProcess extends Process
{
var _walkingLegs, _maskMc, _headMc, _hitMc, _groundMc, _tailMc, tipX, tipY, isAppearing, shutDownFlag, reportEvent, _active, _successDisplay, _coordinator, isRolledOver, distanceRun, obstaclesAdded, filmWheelExists, filmWheel, setAttentionTarget;
function WalkProcess (coord) {
super(coord);
}
function init(walkingLegs, maskMc, headMc, hitSpot, ground, tail) {
_walkingLegs = walkingLegs;
_maskMc = maskMc;
_headMc = headMc;
_hitMc = hitSpot;
_groundMc = ground;
_tailMc = tail;
tipX = maskMc._x - headMc._x;
tipY = maskMc._y - headMc._y;
var o = this;
tail.useHandCursor = true;
tail.onPress = function () {
if (o._active) {
o.appear();
}
};
hitSpot.useHandCursor = false;
hitSpot.onRollOver = (hitSpot.onDragOut = function () {
this.onMouseDown = function () {
if ((walkingLegs.getSpeed() > 0) && (!o.filmWheelExists)) {
walkingLegs.insertCycles(["jump", "gallop"]);
}
};
o.isRolledOver = true;
});
hitSpot.onRollOut = (hitSpot.onDragOut = function () {
this.onMouseDown = undefined;
o.isRolledOver = false;
});
addTransition("stand", 3);
addTransition("gallop", 5);
}
function hide() {
_walkingLegs.setState(false);
_groundMc.clear();
isWalking = false;
isAppearing = false;
shutDownFlag = false;
new DelayedEvent(this, random(300), "tailAppear");
reportEvent("endWalk");
}
function tailAppear() {
if (_active && (!isWalking)) {
var o = this;
var _local2 = function () {
o.tailExtended = true;
};
_tailMc.forward(1, _local2);
}
}
function endWalk() {
if (successCount < 5) {
_successDisplay.fadeOut(10);
}
_coordinator.setPanSpeed(0);
_coordinator.setLift(0);
_coordinator.rotateAroundPoint(0, tipX, tipY);
isWalking = false;
hide();
}
function shutDown(cancelRollOver) {
isRolledOver = false;
if (isWalking) {
shutDownFlag = true;
Obstacle.active = false;
}
}
function run() {
if (isWalking) {
var _local4 = _walkingLegs.getTransitionState();
if ((shutDownFlag != true) && (isRolledOver || (_local4[0] == 1))) {
_walkingLegs.incrementTransition(0.2);
} else if (!isRolledOver) {
_walkingLegs.incrementTransition(-0.2);
if ((_local4[0] == 1) && (_local4[1] == 0)) {
endWalk();
}
}
if (isWalking) {
_walkingLegs.run();
_local4 = _walkingLegs.getTransitionState();
var _local3 = _walkingLegs.getSpeed();
_walkingLegs._y = (_root.yMax - _walkingLegs.yTouch) - 12;
var _local8 = 1.0471975511966;
var _local7 = ((_local4[0] == 1) ? 0 : (_local4[1] / 5));
var _local5 = Curves.scurve(_local7);
tipAngle = (tipAngle + (_walkingLegs.getTilt() / 3.5)) / 2;
lift = (lift + _walkingLegs.getLift()) / 2;
_maskMc._y = (_root.yMax - lift) - 1;
_coordinator.setPanSpeed(_local3);
_coordinator.setLift(lift);
_coordinator.rotateAroundPoint(tipAngle, tipX, tipY);
_maskMc._rotation = (tipAngle / Math.PI) * 180;
_groundMc.run(_local3, _local5);
distanceRun = distanceRun + _local3;
if ((!obstaclesAdded) && (distanceRun > 1500)) {
obstaclesAdded = true;
addObstacle();
}
var _local6 = (_root.xMin + _root.xMax) / 2;
if (filmWheelExists && (Math.abs(_local6 - filmWheel._x) < 400)) {
obstacleCourseComplete();
shutDown(true);
}
}
} else if (tailExtended && (random(300) == 1)) {
wagTail();
}
}
function wagTail() {
_tailMc.form.forward(1);
}
function setActive(boo, immediateFlag) {
_active = boo;
if (boo) {
if (isWalking) {
return(undefined);
}
if (immediateFlag) {
tailAppear();
} else {
new DelayedEvent(this, 60 + random(120), "tailAppear");
}
} else if (isWalking) {
shutDown();
} else {
tailExtended = false;
_tailMc.reverse(2);
}
}
function setInitMode(nm) {
_walkingLegs.addTransition(nm, 0.1);
}
function addTransition(nm, maxVal) {
_walkingLegs.addTransition(nm, maxVal);
}
function appear() {
reportEvent("beginWalk");
var o = this;
var _local3 = function () {
o._walkingLegs.setState(true);
o.isWalking = true;
o.isAppearing = false;
};
isAppearing = true;
tailExtended = false;
_tailMc.reverse(3, _local3);
_successDisplay = _root.attachForeGroundDraggable("obstacleMeter");
_root.fadeOutTitle();
successCount = 0;
distanceRun = 0;
obstaclesAdded = false;
Obstacle.active = true;
ViewMaster.setFrame("obstacles");
}
function onObstacleJump() {
SoundManager.playSound("tadah" + successCount);
successCount++;
setSuccess(successCount);
if (successCount == 5) {
new DelayedEvent(this, 60, "addFireWork", [8]);
SoundManager.playSound("applause");
addFilmWheel();
} else {
addObstacle();
}
}
function addFireWork(numLeft) {
numLeft--;
var _local3 = _root.attachClip("fireWork");
new Color(_local3).setRGB(fireWorkColors[numLeft]);
var _local5 = (_root.xMax + _root.xMin) / 2;
_local3.setPos((_local5 + (Math.random() * 400)) - 600, (_root.yMax + (Math.random() * 400)) - 550);
if (numLeft > 1) {
new DelayedEvent(this, 4 + random(16), "addFireWork", [numLeft]);
}
}
function convertScoreToPills(pillArr) {
var _local3 = _successDisplay.circles;
var _local2 = 0;
while (_local2 < 5) {
configFishFood(_local3[_local2], pillArr[_local2]);
_local2++;
}
_successDisplay.removeMovieClip();
}
function configFishFood(srcObj, pill) {
var _local6 = srcObj.getBounds(_root);
var _local3 = _root.getGlobalCoords(srcObj);
pill.px = _local3.x;
pill.py = _local3.y;
pill.bounceFactor = 0.8;
pill.show();
pill.inputLock = true;
pill.baseGrav = 0;
var _local5 = (srcObj._width / 2) / pill.radius;
pill._xscale = (pill._yscale = (100 * _local5) / _root.scale);
}
function onObstacleCrash() {
SoundManager.playSound("crash");
SoundManager.playSound("aww");
setSuccess(0);
addObstacle();
}
function setSuccess(num) {
successCount = num;
_successDisplay.setCounter(successCount);
}
function addObstacle() {
var _local3 = _root.attachForeGroundDraggable("obstacle", {_x:(_root.xMin - 100) - random(400), _y:_root.yMax});
_local3.manager = this;
_local3.init();
setAttentionTarget(_local3);
}
function addFilmWheel() {
if (filmWheelExists) {
return(undefined);
}
var pedestal = _root.attachClip("pedestal", {_x:_root.xMin - 1000, _y:_root.yMax});
var o = this;
filmWheelExists = true;
filmWheel = _coordinator.addProjectorWheel();
filmWheel._x = _root.xMin - 1000;
filmWheel.px = _root.xMin - 1000;
filmWheel.py = (_root.yMax - 57) - filmWheel.radius;
filmWheel.grav = 0;
filmWheel.onScreen = false;
filmWheel.alsoOnPickup = filmWheel.onPickup;
filmWheel.onPickup = function () {
this.alsoOnPickup();
o.obstacleCourseComplete();
pedestal.play();
this.grav = 1;
};
setAttentionTarget(filmWheel);
}
function obstacleCourseComplete() {
reportEvent("obstacleCourseComplete");
ViewMaster.setFrame("regular", 60);
}
var isWalking = false;
var tailExtended = false;
var tipAngle = 0;
var lift = 0;
var successCount = 0;
var fireWorkColors = [16777113, 16764108, 10092543, 16777113, 10092543, 16764108, 10092543, 16777113, 16764108, 10092543];
}
Symbol 923 MovieClip [__Packages.Feeder] Frame 0
class Feeder
{
var _coordinator, lastOffering;
function Feeder (coord) {
_coordinator = coord;
}
function addDraggable(size, shape, color, effect, x, y, motionDir, motionAmt, param) {
lastOffering = _root.attachClip("draggable");
if (color != false) {
lastOffering.setColor(color);
}
lastOffering.initShapeData(shape);
lastOffering.shapeCollision = true;
lastOffering.setPos(x, y);
lastOffering.forceMotion(motionDir, motionAmt, 1);
if (size != false) {
lastOffering.radius = size;
}
lastOffering.hitSound = "click";
lastOffering.effect = effect;
lastOffering.onScreen = false;
lastOffering.param = param;
return(lastOffering);
}
function addEye() {
var _local3 = addDraggable(false, "eyeForm", false, "eye", _root.xMin - 30, _root.yMax - 120, 0, 10);
_coordinator.eyeManager.setActiveEye(_local3.shape);
}
function onEaten(obj) {
var _local2 = ((obj.effect == "eye") ? 150 : 90);
eventIndex++;
}
function doNextEvent() {
if (eventIndex >= eventSet.length) {
return(undefined);
}
var _local2 = eventSet[eventIndex].type;
if (_local2 == undefined) {
_local2 = "none";
}
this[_local2 + "Event"]();
}
function noneEvent() {
var _local3 = eventSet[eventIndex].shape;
if (_local3 == undefined) {
_local3 = "circle";
}
addDraggable(eventSet[eventIndex].size, _local3, eventSet[eventIndex].color, eventSet[eventIndex].effect, _root.xMin - 30, _root.yMax - 120, 0, 10, eventSet[eventIndex].param);
}
function eyeEvent() {
addEye();
}
function initOffering(obj) {
}
var eventSet = [{effect:"eye", type:"eye"}];
var eventIndex = 0;
}
Symbol 924 MovieClip [__Packages.EyeManager] Frame 0
class EyeManager extends Process
{
var _head, _headEye, _attentionManager, active, _coordinator;
function EyeManager (coord) {
super(coord);
}
function init(head, headEye, attnMan) {
_head = head;
_headEye = headEye;
_attentionManager = attnMan;
initEye();
}
function setActive(boo) {
active = boo;
}
function initEye() {
_headEye.setFrame("complete");
setActiveEye(_headEye.eyeball);
var o = this;
var mp = _coordinator.eatProcess;
_headEye.onReady = function () {
o.onReady();
};
_headEye.emitEye = function () {
mp.emitObject("eyeForm", "eye", {owner:o, action:"setOutsideEye"});
};
_headEye.onPress = function () {
if (!o.active) {
return(undefined);
}
this.reverse();
this.rollSound.play();
};
_headEye.onRollOver = function () {
if (!o.active) {
return(undefined);
}
this.useHandCursor = true;
o.isRolledOver = true;
};
_headEye.onRollOut = (_headEye.onDragOut = function () {
o.isRolledOver = false;
});
_headEye.onMouseDown = function () {
if (!o.active) {
return(undefined);
}
o.surprise = true;
};
_headEye.onMouseUp = function () {
o.surprise = false;
};
_headEye.eyeShape.definePaths(["close", "blink", "surprise"]);
}
function blink() {
var shape = _headEye.eyeShape;
var _local2 = function () {
shape.gotoFrame("blink");
shape.halt();
};
shape.forward(1, _local2, "blink");
}
function setSurprise(amt) {
_surpriseAmt = Math.round(amt * 16);
if (_surpriseAmt > 16) {
_surpriseAmt = 16;
}
if (_surpriseAmt > 0) {
_headEye.eyeShape.switchPaths("surprise");
}
}
function run() {
var _local3 = _headEye.eyeShape;
if (_local3.currPathName == "surprise") {
var _local2 = _local3.getFrame() - 1;
if (_surpriseAmt != _local2) {
if (_surpriseAmt > _local2) {
var _local4 = 4;
if (_local4 > (_surpriseAmt - _local2)) {
_local4 = _surpriseAmt - _local2;
}
_local3.forward(_local4, null, "surprise");
} else if (_surpriseAmt < _local2) {
_local3.reverse(1, null, "surprise");
}
} else {
_local3.halt();
}
}
}
function setActiveEye(obj) {
_attentionManager.setActiveEye(obj);
}
function setOutsideEye(obj) {
_attentionManager.setActiveEye(obj.shape);
}
function initHeadEye() {
new DelayedEvent(this, 10, "runHeadEye");
}
function runHeadEye() {
setActiveEye(_headEye.eyeball);
_headEye.rollSound.play();
_headEye.forward();
}
function open(num) {
_headEye.eyeShape.reverse(num, null, "close");
}
function close(num) {
_headEye.eyeShape.forward(num, null, "close");
}
function initClose() {
_headEye.eyeShape.gotoEndOfPath("close");
}
var eyeRad = 14;
var isRolledOver = false;
var eyeControl = 0;
var pupilSpectrum = [];
var _surpriseAmt = 0;
}
Symbol 925 MovieClip [__Packages.CoughProcess] Frame 0
class CoughProcess extends Process
{
var _head, _coughSpot, _eyeManager, isCoughing;
function CoughProcess (coord) {
super(coord);
}
function init(head, coughSpot, eyeManager) {
_head = head;
_coughSpot = coughSpot;
_eyeManager = eyeManager;
var o = this;
_coughSpot.onPress = function () {
if (o.isCoughing) {
return(undefined);
}
var _local1 = new Sound();
_local1.attachSound("cough");
_local1.start();
o.isCoughing = true;
_local1.onSoundComplete = function () {
};
o.coughFrame = 0;
o._eyeManager.close(3);
};
}
function onCoughComplete() {
isCoughing = false;
_head.mouthFrame(1);
coughFrame = 0;
_eyeManager.open(2);
}
function run() {
if (isCoughing) {
coughFrame++;
if (coughFrame == (coughFrames.length - 1)) {
onCoughComplete();
} else {
_head.mouthFrame(coughFrames[coughFrame]);
}
}
}
var coughFrames = [4, 10, 14, 15, 15, 16, 17, 16, 15, 16, 17, 18, 17, 18, 19, 18, 17, 16, 17, 16, 14, 10];
var coughFrame = 0;
}
Symbol 926 MovieClip [__Packages.WindowProcess] Frame 0
class WindowProcess extends Process
{
var _contentData, _ballTracker, _window, _coordinator, reportEvent, _filmFading, _filmPlaying;
function WindowProcess (coord) {
super(coord);
}
function init(window, ballTracker) {
_contentData = {};
_ballTracker = ballTracker;
_ballTracker.parentProcess = this;
_window = window;
_window.setParentProcess(this);
}
function setActive(boo) {
_window.active = boo;
}
function setWindowState(stateName) {
_window.setContent(stateName, _contentTypeData[stateName].clip, _contentTypeData[stateName].maskType);
}
function setCurrentWindowType(name) {
_currWindowState = name;
}
function getWindowContentData(stateName) {
if (stateName == "tentBalls") {
return({bgColor:24720, shadowColor:"005080", configName:"tentBalls", configData:_coordinator.getTentBallStates()});
}
if (stateName == "tentNested") {
var o = this;
var _local7 = function (ballMc) {
var _local3 = _root.getGlobalCoords(ballMc);
var _local2 = ballMc.getBounds(_root);
var _local5 = _local2.xMax - _local2.xMin;
var _local4 = o._ballTracker.instantiateDraggableBall(_local3.x, _local3.y, 0, 0, _local5 / 2, 3407871, "fishTank");
_local4.onPress();
o.forceClose();
};
return({bgColor:23337, shadowColor:"004013", configName:"tentNested", configData:_coordinator.getNestedBallState(), onComplete:_local7});
}
if (stateName == "beachBallToss") {
return(_coordinator.getCurrBeachBallData());
}
}
function forceOpen() {
_window.forceOpen();
}
function forceClose() {
_window.content.shutDown();
}
function onEvent(evtName, evtData) {
if (evtName == "filmBegin") {
reportEvent("projectorStart");
_filmFading = false;
_filmPlaying = true;
if (_currWindowState == "tentBalls") {
_ballTracker.begin();
}
} else if (evtName == "filmEnd") {
_filmPlaying = false;
if (_currWindowState == "tentBalls") {
_ballTracker.conclude(_window.contentClip.getContent().getBalls(), _window.contentClip.getContent().getBallColors());
}
} else if (evtName == "filmFade") {
_filmFading = true;
} else if (evtName == "ballEjected") {
_coordinator.addBeachBall(evtData.x, evtData.y, evtData.vx, evtData.vy, evtData.shapeData);
}
}
function removeBall(o) {
_window.contentClip.getContent().removeBall(o);
}
function run() {
if (_currWindowState == "tentBalls") {
if (_filmPlaying) {
_ballTracker.run(_window.contentClip.getContent().getBalls(), _window.contentClip.getContent().getBallColors());
}
}
}
function forceAppear() {
_window._onRollOver();
}
function get rolledOver() {
return(_window.rolledOver);
}
function get isOpening() {
return(_window.isOpening);
}
function get isOpen() {
return(_window.isOpen);
}
function fakeKnock() {
_window.showKnock();
}
function saveContentData(name, data) {
if (name == "tentBalls") {
_coordinator.saveTentBallStates(data);
} else {
_contentData[name] = data;
}
}
function getContentClip() {
return(_window.contentClip);
}
var _currWindowState = "beachBallToss";
var _contentTypeData = {projector:{clip:"projector", maskType:"static"}, beachBallToss:{clip:"beachBallToss", maskType:"static"}};
}
Symbol 927 MovieClip [__Packages.CryProcess] Frame 0
class CryProcess extends Process
{
var _eyeManager, _tearDropMaker, active;
function CryProcess (coord) {
super(coord);
}
function init(eyeManager, tearDropMaker) {
_eyeManager = eyeManager;
_tearDropMaker = tearDropMaker;
}
function run() {
if (_eyeManager.isRolledOver || (forceActive)) {
cry();
}
}
function setActive(boo) {
active = boo;
}
function forceCry() {
forceActive = true;
new DelayedEvent(this, 180, "endCry");
cry();
}
function endCry() {
forceActive = false;
}
function cry() {
if (active) {
_tearDropMaker.active = true;
}
}
function kickOff() {
_eyeManager.isRolledOver = true;
}
var forceActive = false;
}
Symbol 928 MovieClip [__Packages.YawnProcess] Frame 0
class YawnProcess extends Process
{
var active, _head, _ear, _lobe, _lobeShadow, _lobeBall, _flaps, _coordinator, yawnSnd, playSound, isClosing, fadeOutSound, fireSound, fadeInSound, fireClip;
function YawnProcess (coord) {
super(coord);
}
function setActive(boo) {
active = boo;
}
function init(head, ear) {
_head = head;
_ear = ear;
_lobe = ear.lobe;
_lobeShadow = ear.earShadow;
_lobeBall = _lobe.lobeBall;
_flaps = head.flapShellArr;
var _local3 = _head.top.scales;
var o = this;
_lobeBall.onPress = function () {
if (o.active) {
o.doYawn();
}
};
_lobeBall.onMouseUp = function () {
o.endYawn();
};
_lobeBall.onRollOver = function () {
if (o.active) {
o._coordinator.reportEvent("earLobeRolledOver");
}
};
_lobeBall.onRollOut = function () {
if (o.active) {
o._coordinator.reportEvent("earLobeRolledOut");
}
};
}
function doYawn() {
if (isOpen) {
return(undefined);
}
_coordinator.reportEvent("beginYawn");
isOpen = true;
_head.yawn(null, yawnState == "fire");
if (yawnState == "fire") {
new DelayedEvent(this, 5, "startFire");
} else {
_head.closeEyes(1);
yawnSnd = playSound("yawn");
}
}
function endYawn() {
if ((!isOpen) || (isClosing)) {
return(undefined);
}
isClosing = true;
fadeOutSound(yawnSnd, 5);
if (yawnState == "fire") {
endFire();
} else {
_head.openEyes(1);
}
var o = this;
var _local2 = function () {
o._coordinator.reportEvent("endYawn");
o.isOpen = false;
o.isClosing = false;
};
_head.closeYawn(_local2);
}
function startFire() {
if (isClosing) {
return(undefined);
}
_coordinator.reportEvent("startFire");
_coordinator.eyeManager.setSurprise(1);
fireSound = playSound("blaze2", 100, 999);
fadeInSound(fireSound, 5);
fireClip = _root.attachMovie("fire", "fire" + (dpthCounter--), dpthCounter);
updateFireY();
fireClip._x = _head._x + 180;
fireClip._rotation = 270;
fireClip._xscale = (fireClip._yscale = 130);
_coordinator.setAttentionTarget(fireClip);
}
function updateFireY() {
fireClip._y = _head._y + 328;
}
function endFire() {
_coordinator.eyeManager.setSurprise(0);
var o = this;
var _local2 = function () {
o.fireClip.removeMovieClip();
o.snd.stop();
};
fireClip.active = false;
fadeOutSound(fireSound, 5);
_coordinator.clearAttentionTarget(fireClip, 30);
_coordinator.reportEvent("endFire");
}
function kickOff() {
}
function run() {
}
var dpthCounter = -999;
var yawnState = "regular";
var isOpen = false;
}
Symbol 929 MovieClip [__Packages.TuftProcess] Frame 0
class TuftProcess extends Process
{
var tufts, tuftActive, countDownToNext, _coordinator, numTufts, tuftsComplete;
function TuftProcess (coord) {
super(coord);
tufts = [];
}
function init(animForm) {
addTuft([animForm.top.ear.tuft]);
addTuft([animForm.jaw.beard]);
addTuft([animForm.top.hairTuft]);
addTuft([animForm.top.hairTuft2]);
addTuft([animForm.top.ear.tuft]);
addTuft([animForm.jaw.beard, animForm.top.hairTuft, animForm.top.hairTuft2, animForm.top.hairTuft3, animForm.top.hairTuft4, animForm.top.hatch.hatchTufts.tuft1, animForm.top.hatch.hatchTufts.tuft2]);
tuftActive = false;
}
function setActive(boo) {
active = boo;
}
function kickOff() {
setActive(true);
}
function run() {
if (!active) {
return(undefined);
}
if (!tuftActive) {
countDownToNext--;
if (countDownToNext <= 0) {
tuftIndex++;
if (tuftIndex == tufts.length) {
tuftIndex = -1;
_coordinator.reportEvent("tuftsDone");
active = false;
return(undefined);
}
tuftActive = true;
var _local4 = tufts[tuftIndex];
numTufts = _local4.length;
var _local2 = 0;
while (_local2 < numTufts) {
_local4[_local2].manager = this;
_local4[_local2].grow();
var _local3 = 90 / numTufts;
var _local5 = (_local2 * _local3) + 5;
new DelayedEvent(this, _local5, "setAttentionTarget", [_local4[_local2], _local3]);
_local2++;
}
SoundManager.playSound("whoosh", 10);
tuftsComplete = 0;
}
}
}
function shutDown() {
if (tuftActive) {
var _local3 = tufts[tuftIndex];
var _local4 = _local3.length;
var _local2 = 0;
while (_local2 < _local4) {
_local3[_local2].checkForSnip(true);
_local2++;
}
}
setActive(false);
}
function addTuft(obj) {
tufts.push(obj);
}
function doNextTuft() {
countDownToNext = 12;
}
function onTuftComplete() {
tuftsComplete++;
if (tuftsComplete == numTufts) {
tuftActive = false;
doNextTuft();
}
}
var tuftIndex = -1;
var active = false;
}
Symbol 179 MovieClip [__Packages.KickManager] Frame 0
class KickManager
{
var myId, _parentObj, _ball, _kickers, hitHistory, _currInt, _timeCounter, _nextKicker;
function KickManager (p, ball, kickers) {
id = id + 1;
myId = id;
_parentObj = p;
_ball = ball;
_kickers = kickers;
_ball.passiveMode = true;
hitHistory = [];
}
function initBall() {
_currInt = initNewArc();
_timeCounter = _currInt.timeToHit;
}
function initNewArc() {
var _local4 = getBestKicker(_ball);
if (_local4 == undefined) {
_ball.markedForRemoval = true;
} else {
_nextKicker = _local4;
}
var _local2 = getYIntersectionData(_ball, _local4.yThresh);
var _local8 = _ball.r;
var _local13 = ((random(2) == 1) ? "select" : "launch");
var _local3 = (Math.sqrt((_local2.vx * _local2.vx) + (_local2.vy * _local2.vy)) + (random(100) / 20)) - 2.5;
if (_local3 < 12) {
_local3 = 12;
}
if (_local3 > 18) {
_local3 = 18;
}
var _local11 = Math.atan2(_local2.vy, _local2.vx);
var _local6;
if (_local13 == "select") {
var _local14 = random(_kickers.length);
var _local10 = _kickers[_local14];
_local6 = getDirToTarget(_local10, _local2.x, _local2.y, _local2.vx, _local2.vy);
} else {
var _local9 = _local2.x - _parentObj.midX;
var _local7 = Math.abs(_local9);
var _local15 = _local7 / _local9;
var _local16 = _parentObj.xMax - _parentObj.xMin;
var _local12 = 240;
_local6 = (((((-_local15) * Math.sqrt(_local7)) / ((30 * _local12) / _local16)) * (15 / _local3)) * (15 / _local3)) - (Math.PI/2);
}
if (_local4 != undefined) {
var _local5 = (((_local11 + Math.PI) + _local6) / 2) + Math.PI;
_local4.doKick(_local2.x - (_local8 * Math.cos(_local5)), _local2.y - (_local8 * Math.sin(_local5)), _local5, _local3, _local2.timeToHit);
hitHistory.push(_local4);
if (hitHistory.length > 6) {
hitHistory.splice(0, 1);
}
}
_local2.launchAngle = _local6;
_local2.launchSpeed = _local3;
return(_local2);
}
function getDirToTarget(targ, x, y, vx, vy) {
var _local7 = Math.sqrt((vx * vx) + (vy * vy));
var _local13 = targ.yThresh;
var _local3 = -1.5707963267949;
var _local2 = getHitDistance(targ, x, y, _local7, _local3);
var _local6 = (-Math.abs(_local2)) / _local2;
var _local4 = 0;
var _local5 = (Math.PI/4);
while ((Math.abs(_local2) > 5) && (_local4 < 100)) {
_local4++;
_local3 = _local3 + (_local5 * _local6);
_local2 = getHitDistance(targ, x, y, _local7, _local3);
_local6 = (-Math.abs(_local2)) / _local2;
_local5 = _local5 / 2;
}
return(_local3);
}
function matchBallDepth(obj, side) {
_ball.swapDepths(obj.getDepth() + (myId * side));
}
function getHitDistance(targ, x, y, vTot, ang) {
var _local6 = vTot * Math.cos(ang);
var _local4 = vTot * Math.sin(ang);
var _local2 = {px:x, py:y, vx:_local6, vy:_local4, grav:_ball.grav};
var _local3 = getYIntersectionData(_local2, targ.yThresh);
return(_local3.x - targ.getX());
}
function getBestKicker(ball) {
var _local5;
var _local9;
var _local4 = 0;
while (_local4 < _kickers.length) {
var _local2 = _kickers[_local4];
if (_local2.isReadyToKick()) {
var _local8 = _local2.yThresh;
var _local7 = getYIntersectionData(ball, _local8);
var _local6 = _local7.x;
var _local3 = Math.abs(_local2.getX() - _local6);
if (((_local5 == undefined) || (_local3 < _local5)) && (_local3 < _local2.kickRange)) {
_local5 = _local3;
_local9 = _local2;
}
}
_local4++;
}
return(_local9);
}
function cancelKicks() {
_nextKicker.cancelKick();
}
function step() {
_timeCounter--;
var _local5 = 1;
if (_timeCounter < 0) {
var _local2 = -_timeCounter;
var _local4 = _currInt.launchAngle;
var _local3 = _currInt.launchSpeed;
_ball.vx = _local3 * Math.cos(_local4);
_ball.vy = _local3 * Math.sin(_local4);
_ball.setPos(_currInt.x, _currInt.y);
_ball.onKick(_local2);
_currInt = initNewArc();
depthSet = false;
_timeCounter = _currInt.timeToHit - _local2;
ballStep(_local2);
} else {
ballStep(1);
if (_ball.markedForRemoval && (_ball.vy > 0)) {
_parentObj.removeBall(_ball);
}
if (((!depthSet) && (Math.round(_timeCounter) <= Math.round(_currInt.timeToHit / 2))) && (!_parentObj.doesBallOverlap(_ball))) {
matchBallDepth(_nextKicker._legObj, 1);
depthSet = true;
}
}
}
function ballStep(timeFrac) {
_ball.vy = _ball.vy + ((_ball.grav * timeFrac) / 2);
_ball.setPos(_ball.px + (_ball.vx * timeFrac), _ball.py + (_ball.vy * timeFrac));
_ball.vy = _ball.vy + ((_ball.grav * timeFrac) / 2);
}
function getYIntersectionData(obj, yVal) {
var _local10 = obj.px;
var _local9 = obj.py;
var _local7 = obj.grav;
var _local12 = obj.vy;
var _local14 = obj.vx;
var _local4 = 0.5 * _local7;
var _local2 = _local12;
var _local11 = -(yVal - _local9);
var _local8 = Math.sqrt((_local2 * _local2) - ((4 * _local4) * _local11));
var _local3 = ((-_local2) + _local8) / (2 * _local4);
var _local6 = ((-_local2) - _local8) / (2 * _local4);
var _local1;
if ((_local3 > 0) && (_local6 > 0)) {
_local1 = Math.max(_local3, _local6);
} else {
_local1 = ((_local3 > 0) ? (_local3) : (_local6));
}
return({x:_local10 + (_local14 * _local1), y:yVal, vx:_local14, vy:_local12 + (_local1 * _local7), timeToHit:_local1});
}
static var id = 0;
var hitSequence = [0, 4, 3, 5, 6, 2, 1];
var hitIndex = 0;
var depthSet = false;
}
Symbol 181 MovieClip [__Packages.KickSpirit] Frame 0
class KickSpirit
{
var _legObj, kickRange, initPt, kickPt, kickStep, kickMax, isRelaxing, initRelaxPt, initRelaxAngles;
function KickSpirit (legObj) {
_legObj = legObj;
kickRange = (_legObj._calfLength + _legObj._thighLength) * 0.5;
_legObj.controller = this;
isActive = _legObj.isActive;
}
function setInitPt() {
initPt = {x:_legObj.tipX, y:_legObj.tipY, footAngle:_legObj.tipAngle};
}
function doKick(x, y, ang, v, tMax) {
while (ang > Math.PI) {
ang = ang - (Math.PI*2);
}
kickPt = {x:x, y:y, hitAngle:ang, hitV:v / 2};
setInitPt();
kickStep = 0;
kickMax = tMax;
isKicking = true;
_legObj.controlled = true;
}
function getX() {
return(_legObj._x);
}
function getY() {
return(_legObj._y);
}
function isReadyToKick() {
return(((isActive && (!isKicking)) ? true : false));
}
function cancelKick() {
isKicking = false;
}
function step() {
if (isKicking) {
kickStep++;
if (kickStep > kickMax) {
kickStep = kickMax;
}
var _local2;
if (kickStep > (kickMax / 2)) {
_local2 = Curves.scurve((kickStep - (kickMax / 2)) / (kickMax / 2));
isRelaxing = false;
isRelaxed = false;
} else {
_local2 = 0;
checkRelax();
return(undefined);
}
if (_local2 >= 1) {
_local2 = 1;
isKicking = false;
}
var _local3 = {x:kickPt.x - ((kickPt.hitV * (kickMax - kickStep)) * Math.cos(kickPt.hitAngle)), y:kickPt.y - ((kickPt.hitV * (kickMax - kickStep)) * Math.sin(kickPt.hitAngle))};
_legObj.setTip((_local3.x * _local2) + (initPt.x * (1 - _local2)), (_local3.y * _local2) + (initPt.y * (1 - _local2)), (kickPt.hitAngle * _local2) + (initPt.footAngle * (1 - _local2)));
} else {
checkRelax();
}
}
function checkRelax() {
if (isRelaxed) {
if (!isKicking) {
releaseControl();
}
return(undefined);
}
if (isRelaxing != true) {
isRelaxing = true;
relaxStep = 0;
}
doRelax();
}
function releaseControl() {
_legObj.controlled = false;
_legObj.osc = 0;
_legObj.oscCounter.reset();
}
function doRelax() {
relaxStep++;
if (relaxStep <= driftTime) {
_legObj.drift();
if (relaxStep == driftTime) {
setInitRelaxAngles();
}
} else {
var _local3 = _legObj.getRelaxAngles();
var _local2 = Curves.scurve((relaxStep - driftTime) / (relaxMax - driftTime));
_legObj.thigh._x = initRelaxPt.x * (1 - _local2);
_legObj.thigh._y = initRelaxPt.y * (1 - _local2);
_legObj._baseRad = (initRelaxAngles[0] * (1 - _local2)) + (_local3[0] * _local2);
_legObj._kneeRad = (initRelaxAngles[1] * (1 - _local2)) + (_local3[1] * _local2);
_legObj._ankleRad = (initRelaxAngles[2] * (1 - _local2)) + (_local3[2] * _local2);
_legObj.draw();
}
setInitPt();
if (relaxStep > relaxMax) {
isRelaxed = true;
if (!isKicking) {
releaseControl();
}
}
}
function setInitRelaxAngles() {
initRelaxPt = {x:_legObj.thigh._x, y:_legObj.thigh._y};
initRelaxAngles = [_legObj._baseRad, _legObj._kneeRad, _legObj._ankleRad];
}
function get yThresh() {
return(_legObj.yThresh + _legObj._y);
}
var isKicking = false;
var isActive = false;
var relaxStep = 99;
var relaxMax = 20;
var driftTime = 5;
var isRelaxed = true;
}
Symbol 182 MovieClip [__Packages.Legs] Frame 0
class Legs extends MovieClip
{
var _xscale, _yscale, initFlag, fullyOpen, ballCount, attachMovie, kickSpiritArr, kickManagers, parentProcess, yThreshMin, xMin, xMax, midX;
function Legs () {
super();
_xscale = (_yscale = 100 * scale);
for (var _local3 in legData) {
this[_local3]._visible = false;
}
initFlag = false;
fullyOpen = true;
ballCount = 0;
}
function reset() {
for (var _local1 in legData) {
legData[_local1].present = false;
}
}
function getBalls() {
return(_root.processCoordinator.getEdibles());
}
function addLeg(name) {
legData[name].present = true;
if (initFlag) {
introduceLeg(name);
} else {
this[name].isActive = true;
}
}
function addBall(x, y, vx, vy, ballData) {
var _local3 = attachMovie("simpleBall", "simpleBall" + ballCount, ballCount);
_local3.dataObj = ballData;
_local3.setPos(x, y);
_local3.vx = vx / scale;
_local3.vy = vy / scale;
_local3.grav = _local3.grav / scale;
_local3._visible = true;
if (ballData.shapeName != undefined) {
_local3.initShapeData(ballData.shapeName, ballData.shapeData);
if (ballData.shapeName == "eyeForm") {
_root.processCoordinator.setActiveEye(_local3.shape);
}
} else {
_local3.initShapeData("circle");
}
_local3.radius = ballData.r / scale;
if ((ballData.colr != undefined) && (ballData.colr != false)) {
new Color(_local3).setRGB(ballData.colr);
}
var o = this;
_local3.onPress = function () {
o.removeBall(this, true);
};
var _local5 = new KickManager(this, _local3, kickSpiritArr);
_local5.ballTag = ballData.tag;
kickManagers.push(_local5);
_local5.initBall();
ballCount++;
}
function doesBallOverlap(obj) {
var _local10 = kickManagers.length;
var _local9 = obj.r;
var _local3 = 0;
while (_local3 < _local10) {
var _local2 = kickManagers[_local3]._ball;
if (obj != _local2) {
var _local8 = _local2.r;
var _local5 = obj.px - _local2.px;
var _local4 = obj.py - _local2.py;
var _local7 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local7 < (_local9 + _local8)) {
return(true);
}
}
_local3++;
}
return(false);
}
function removeBall(obj, dragFlag) {
var _local9 = kickManagers.length;
var _local4 = 0;
while (_local4 < _local9) {
if (kickManagers[_local4]._ball == obj) {
var _local5 = kickManagers.splice(_local4, 1)[0];
_local5.cancelKicks();
var _local7 = _local5.ballTag;
var _local6 = _root.getGlobalCoords(obj);
var _local8 = obj.dataObj.shapeName == "eyeForm";
parentProcess.activateBall(_local7, _local6.x, _local6.y, obj.vx, obj.vy, dragFlag, _local8, obj.getShapeData());
obj.removeMovieClip();
return(undefined);
}
_local4++;
}
}
function introduceLeg(name) {
var _local2 = this[name];
_local2._xscale = (_local2._yscale = 100);
_local2.init(((random(6) * 2) * Math.PI) / 6, legData[name].initOsc, name + "Sound", legData[name].volume, true);
_local2._visible = true;
var _local5 = _local2._x;
var _local4 = _local2._y;
var _local8 = 0;
var _local7 = _local4 + 100;
var _local9 = 0;
introStep({obj:_local2, count:_local9, ox:_local8, oy:_local7, dx:_local5, dy:_local4});
}
function introStep(params) {
params.count++;
var _local3 = Math.sin(((params.count / 20) * Math.PI) / 2);
params.obj._x = (_local3 * params.dx) + ((1 - _local3) * params.ox);
params.obj._y = (_local3 * params.dy) + ((1 - _local3) * params.oy);
params.obj._xscale = (params.obj._yscale = (_local3 * 100) + ((1 - _local3) * 70));
if (params.count < 20) {
new DelayedEvent(this, 1, "introStep", [params]);
} else {
params.obj.isActive = true;
}
}
function onEnterFrame() {
if (!initFlag) {
initFlag = true;
kickSpiritArr = [];
kickManagers = [];
var _local8 = 0;
var _local18 = 1;
for (var _local5 in legData) {
if (legData[_local5].present) {
this[_local5]._visible = true;
this[_local5].init(((_local8 * 2) * Math.PI) / 6, legData[_local5].initOsc, _local5 + "Sound", legData[_local5].volume, true);
this[_local5].isActive = true;
} else {
this[_local5]._visible = false;
this[_local5]._width = (this[_local5]._height = 1);
}
this[_local5].swapDepths((legData[_local5].depth + 1) * 1000);
_local18++;
kickSpiritArr.push(new KickSpirit(this[_local5]));
_local8++;
}
} else if (fullyOpen) {
setLimits();
var _local17 = kickManagers.length;
var _local5 = 0;
while (_local5 < _local17) {
kickManagers[_local5].step();
_local5++;
}
if (_local17 > 0) {
parentProcess.reportEvent("hatchBallsArePresent");
}
var _local16 = getBalls();
_local17 = _local16.length;
_local5 = 0;
while (_local5 < _local17) {
var _local3 = _local16[_local5];
var _local7 = _root.getLocalCoords(this, {x:_local3.px, y:_local3.py});
var _local4 = _local7.x;
var _local6 = _local7.y;
if (((((!_local3.hidden) && (!_local3.drag)) && (_local6 < yThreshMin)) && (_local4 > xMin)) && (_local4 < xMax)) {
var _local9 = parentProcess.deactivateBall(_local3);
addBall(_local4, _local6, _local3.vx, _local3.vy, {r:_local3.r, colr:_local3.colr, tag:_local9, shapeName:_local3.shapeLinkageName, shapeData:_local3.getShapeData()});
}
_local5++;
}
} else {
shutDown();
}
}
function setLimits() {
midX = 0;
xMin = 999;
xMax = 0;
yThreshMin = 0;
var _local7 = kickSpiritArr.length;
var _local5 = 0;
while (_local5 < _local7) {
var _local2 = kickSpiritArr[_local5];
if (_local2.isActive) {
var _local3 = _local2.getX();
var _local6 = _local2.getY();
var _local4 = _local2.kickRange;
midX = midX + _local3;
if ((_local3 - _local4) < xMin) {
xMin = _local3 - _local4;
}
if ((_local3 + _local4) > xMax) {
xMax = _local3 + _local4;
}
if ((_local2.yThresh + _local6) < yThreshMin) {
yThreshMin = _local2.yThresh + _local6;
}
}
_local5++;
}
midX = (xMin + xMax) / 2;
}
function shutDown() {
var _local3 = kickManagers.length;
var _local2 = _local3 - 1;
while (_local2 >= 0) {
removeBall(kickManagers[_local2]._ball);
_local2--;
}
}
var scale = 1.1;
static var legData = {elephant:{present:false, initOsc:0.14, volume:10, depth:3}, horse:{present:false, initOsc:0.2, volume:20, depth:6}, bear:{present:false, initOsc:0.16, volume:20, depth:1}, tentacle:{present:false, initOsc:0.18, volume:30, depth:5}, robot:{present:false, initOsc:0.15, volume:20, depth:2}, lady:{present:false, initOsc:0.16, volume:30, depth:7}, duck:{present:false, initOsc:0.16, volume:20, depth:4}};
}
Symbol 183 MovieClip [__Packages.SimpleBall] Frame 0
class SimpleBall extends MovieClip
{
var r, shape, _height, px, _x, py, _y, _width, attachMovie;
function SimpleBall () {
super();
init();
}
function init() {
r = (shape.fixedRadius ? (shape.radius) : (_height / 2));
px = _x;
py = _y;
}
function initShapeData(shapeName, dataObj) {
attachShape(shapeName);
shape.setState(dataObj);
init();
}
function getShapeData() {
return(shape.getState());
}
function set radius(num) {
r = num;
_height = (_width = r * 2);
//return(radius);
}
function get radius() {
return(r);
}
function attachShape(linkageId) {
shape = attachMovie(linkageId, "shape", 0);
}
function setPos(x, y) {
px = x;
py = y;
_x = x;
_y = y;
updateAfterEvent();
}
var grav = 1;
var vx = 0;
var vy = 0;
}
Symbol 186 MovieClip [__Packages.Counter] Frame 0
class Counter
{
var _minVal, _maxVal, _currVal;
function Counter (minVal, maxVal, initVal) {
_minVal = minVal;
_maxVal = maxVal;
_currVal = initVal;
}
function add(val) {
_currVal = _currVal + val;
if (_currVal > _maxVal) {
_currVal = _maxVal;
}
if (_currVal < _minVal) {
_currVal = _minVal;
}
}
function getVal(curveType) {
if (curveType == undefined) {
return(_currVal);
}
return(_minVal + ((_maxVal - _minVal) * Curves[curveType]((_currVal - _minVal) / (_maxVal - _minVal))));
}
function reset() {
_currVal = 0;
}
}
Symbol 188 MovieClip [__Packages.Leg] Frame 0
class Leg extends SuperClip
{
var _thighLength, getBetween, calf, thigh, _calfLength, foot, _footLength, heel, controller, osc, oscCounter, _mySound, _myVolume, setUpRollFlag, _soundPlaying, _soundCounter, isRolledOver, _baseRad, _kneeRad, _ankleRad, sin, PI, cos, _x, _y, segArr;
function Leg () {
super();
_thighLength = getBetween(calf, thigh).getDistance();
_calfLength = getBetween(foot, calf).getDistance();
_footLength = getBetween(heel, foot).getDistance();
foot.stop();
}
function set isActive(boo) {
_isActive = boo;
controller.isActive = boo;
//return(isActive);
}
function get isActive() {
return(_isActive);
}
function init(initOsc, maxVal, mySound, myVolume, initRoll) {
osc = initOsc;
oscCounter = new Counter(0.0001, maxVal, maxVal);
_mySound = mySound;
_myVolume = myVolume;
setUpRollFlag();
new DelayedEvent(this, random(5) + 1, "rollIn", [true]);
}
function rollIn() {
if (_soundPlaying) {
return(undefined);
}
_soundPlaying = true;
_soundCounter = 0;
var o = this;
var _local2 = function () {
o._soundPlaying = false;
};
var _local3 = SoundManager.playSound(_mySound, _myVolume);
_local3.onSoundComplete = _local2;
}
function onEnterFrame() {
if (controlled) {
controller.step();
return(undefined);
}
if (isRolledOver) {
oscCounter.add(0.1);
} else {
oscCounter.add(-0.002);
}
var _local2 = oscCounter.getVal("scurve");
if (_local2 > 0.002) {
osc = osc + _local2;
_baseRad = _baseRange[0] + ((_baseRange[1] - _baseRange[0]) * getOsc(osc));
_kneeRad = (_baseRad + _kneeRange[0]) + ((_kneeRange[1] - _kneeRange[0]) * getOsc(osc + _kneeOffset));
_ankleRad = (_kneeRad + _ankleRange[0]) + ((_ankleRange[1] - _ankleRange[0]) * getOsc(osc + _ankleOffset));
draw();
}
}
function getOsc(num) {
return((sin(num) + 1) / 2);
}
function draw() {
thigh._rotation = (_baseRad / PI) * 180;
calf._x = thigh._x + (_thighLength * cos(_baseRad));
calf._y = thigh._y + (_thighLength * sin(_baseRad));
calf._rotation = (_kneeRad / PI) * 180;
foot._x = calf._x + (_calfLength * cos(_kneeRad));
foot._y = calf._y + (_calfLength * sin(_kneeRad));
var _local2 = (_ankleRad / PI) * 180;
while (_local2 < 1) {
_local2 = _local2 + 360;
}
foot._rotation = _local2;
setFoot(_local2);
}
function setFoot(rotVal) {
foot.gotoAndStop(Math.round(rotVal));
}
function setTip(x, y, footAngle, kneeDir) {
_ankleRad = footAngle;
var _local7 = tipX;
var _local6 = tipY;
var _local10 = x - _x;
var _local9 = y - _y;
var _local4 = {x:_local10 - xTipDist(footAngle), y:_local9 - yTipDist(footAngle), rotation:_ankleRad};
var _local3 = {x:calf._x, y:calf._y, rotation:_baseRad, span:_calfLength};
var _local2 = {x:thigh._x, y:thigh._y, rotation:_kneeRad, span:_thighLength};
segArr = [_local3, _local2];
_local3.x = _local3.x - _local2.x;
_local3.y = _local3.y - _local2.y;
_local2.x = 0;
_local2.y = 0;
var _local5 = reach(segArr[0], _local4.x, _local4.y);
reach(segArr[1], _local5.tx, _local5.ty);
position(_local4, segArr[0]);
position(segArr[0], segArr[1]);
thigh._x = _local2.x;
thigh._y = _local2.y;
_baseRad = Math.atan2(_local3.y - _local2.y, _local3.x - _local2.x);
_kneeRad = Math.atan2(_local4.y - _local3.y, _local4.x - _local3.x);
if (kneeDir != undefined) {
popKnee(kneeDir, _local4, _local2);
}
draw();
footVx = tipX - _local7;
footVy = tipY - _local6;
}
function popKnee(kneeDir, footObj, thighObj) {
var _local3 = _kneeRad - _baseRad;
var _local4 = (-(Math.ceil(Math.sin(_local3)) - 0.5)) * 2;
if (_local4 != kneeDir) {
var _local2 = Math.atan2(footObj.y - thighObj.y, footObj.x - thighObj.x);
_baseRad = _local2 - (_baseRad - _local2);
_kneeRad = _local2 - (_kneeRad - _local2);
}
}
function position(segA, segB) {
var _local2 = segB.rotation;
segB.x = segA.x - (Math.cos(_local2) * segB.span);
segB.y = segA.y - (Math.sin(_local2) * segB.span);
}
function reach(seg, x, y) {
var _local4 = x - seg.x;
var _local3 = y - seg.y;
var _local1 = Math.atan2(_local3, _local4);
if (_local1 > Math.PI) {
_local1 = _local1 - (Math.PI*2);
}
seg.rotation = _local1;
var _local6 = x - (Math.cos(_local1) * seg.span);
var _local5 = y - (Math.sin(_local1) * seg.span);
return({tx:_local6, ty:_local5});
}
function drift() {
footVx = footVx * 0.8;
footVy = footVy * 0.8;
setTip(tipX + footVx, tipY + footVy, _ankleRad);
draw();
}
function gotoRelaxPosition() {
_baseRad = _baseRange[1];
_kneeRad = _baseRad + _kneeRange[0];
_ankleRad = _kneeRad + _ankleRange[1];
}
function getRelaxAngles() {
var _local2 = 0;
var _local3 = _baseRange[0] + ((_baseRange[1] - _baseRange[0]) * getOsc(_local2));
var _local4 = (_local3 + _kneeRange[0]) + ((_kneeRange[1] - _kneeRange[0]) * getOsc(_local2 + _kneeOffset));
var _local5 = (_local4 + _ankleRange[0]) + ((_ankleRange[1] - _ankleRange[0]) * getOsc(_local2 + _ankleOffset));
return([_local3, _local4, _local5]);
}
function xTipDist(ang) {
return((tipOffX * Math.cos(ang)) - (tipOffY * Math.sin(ang)));
}
function yTipDist(ang) {
return((tipOffY * Math.cos(ang)) + (tipOffX * Math.sin(ang)));
}
function get tipX() {
return((foot._x + _x) + xTipDist(_ankleRad));
}
function get tipY() {
return((foot._y + _y) + yTipDist(_ankleRad));
}
function get tipAngle() {
return((foot._rotation / 180) * Math.PI);
}
var _baseRange = [-1.5707963267949, -0.785398163397448];
var _kneeRange = [-1.0471975511966, 0];
var _ankleRange = [-0.392699081698724, 0.261799387799149];
var _kneeOffset = -1.0471975511966;
var _ankleOffset = -2.0943951023932;
var tipOffX = 11.4;
var tipOffY = 0;
var yThresh = -90;
var controlled = false;
var _isActive = false;
var footVx = 0;
var footVy = 0;
}
Symbol 189 MovieClip [__Packages.LadyLeg] Frame 0
class LadyLeg extends Leg
{
var giggleCounter, isRolledOver, calf, foot;
function LadyLeg () {
super();
giggleCounter = new Counter(0.0001, 1, 1);
}
function onEnterFrame() {
if (isRolledOver) {
giggleCounter.add(1);
} else {
giggleCounter.add(-0.04);
}
giggleOsc = giggleOsc + giggleCounter.getVal("scurve");
super.onEnterFrame();
}
function setFoot() {
var _local2 = -(foot._rotation - calf._rotation);
while (_local2 <= 0) {
_local2 = _local2 + 360;
}
while (_local2 > 360) {
_local2 = _local2 - 360;
}
foot.gotoAndStop(Math.round(_local2));
}
var giggleOsc = 0;
var tipOffX = 3;
var tipOffY = 3;
var yThresh = -120;
}
Symbol 190 MovieClip [__Packages.HorseLeg] Frame 0
class HorseLeg extends Leg
{
function HorseLeg () {
super();
}
var _baseRange = [-1.17809724509617, -0.392699081698724];
var tipOffX = 21.6;
var tipOffY = -12.2;
}
Symbol 191 MovieClip [__Packages.Tentacle] Frame 0
class Tentacle extends Leg
{
var lineMc, newClip, _calfLength, _kneeRad, _ankleRad, cos, calf, midPtA, _thighLength, midPtB, _baseRad, thigh, sin, foot;
function Tentacle () {
super();
lineMc = newClip(this);
}
function draw() {
super.draw();
var _local26 = _calfLength;
var _local10 = -(_ankleRad - _kneeRad);
if (_local10 > Math.PI) {
_local10 = _local10 - (Math.PI*2);
}
if (_local10 < -3.14159265358979) {
_local10 = _local10 + (Math.PI*2);
}
if (_local10 < -0.785398163397448) {
_local10 = -0.785398163397448;
}
if (_local10 > (Math.PI/4)) {
_local10 = (Math.PI/4);
}
var _local22 = _local10 + Math.PI;
var _local20 = (_local26 / 2) / cos(_local22);
var _local25 = _local22 + _kneeRad;
var _local23 = _local20 * Math.cos(_local25);
var _local21 = _local20 * Math.sin(_local25);
var _local9 = calf._x + _local23;
var _local8 = calf._y + _local21;
midPtA = {x:_local9, y:_local8};
var _local24 = _thighLength / _calfLength;
midPtB = {x:calf._x - (_local23 * _local24), y:calf._y - (_local21 * _local24)};
var _local11 = 5.5;
var _local17 = 10.5;
var _local18 = (_local11 + (_local17 * 2)) / 3;
var _local19 = _local11 / 1.5;
var _local16 = (_kneeRad + _ankleRad) / 2;
var _local15 = new Between({x:calf._x, y:calf._y}, midPtA).getAngle();
var _local14 = (_kneeRad + _baseRad) / 2;
var _local13 = new Between({x:thigh._x, y:thigh._y}, midPtB).getAngle();
var _local12 = [_local16, _local15, _local14, _local13];
var _local7 = [{x:midPtA.x + (_local19 * sin(_local16)), y:midPtA.y - (_local19 * cos(_local16))}, {x:calf._x + (_local11 * sin(_local15)), y:calf._y - (_local11 * cos(_local15))}, {x:midPtB.x + (_local18 * sin(_local14)), y:midPtB.y - (_local18 * cos(_local14))}, {x:thigh._x + (_local17 * sin(_local13)), y:thigh._y - (_local17 * cos(_local13))}];
var _local6 = [{x:midPtA.x - (_local19 * sin(_local16)), y:midPtA.y + (_local19 * cos(_local16))}, {x:calf._x - (_local11 * sin(_local15)), y:calf._y + (_local11 * cos(_local15))}, {x:midPtB.x - (_local18 * sin(_local14)), y:midPtB.y + (_local18 * cos(_local14))}, {x:thigh._x - (_local17 * sin(_local13)), y:thigh._y + (_local17 * cos(_local13))}];
var _local5 = [];
var _local3 = 0;
while (_local3 < 4) {
var _local4 = 1 - ((Math.cos(_local12[_local3] / 2) + 1) / 2);
_local5[_local3] = {x:(_local7[_local3].x * _local4) + (_local6[_local3].x * (1 - _local4)), y:(_local7[_local3].y * _local4) + (_local6[_local3].y * (1 - _local4))};
_local3++;
}
lineMc.clear();
lineMc.lineStyle(2, lightColor);
lineMc.beginFill(lightColor);
lineMc.moveTo(foot._x, foot._y);
lineMc.curveTo(_local6[0].x, _local6[0].y, _local6[1].x, _local6[1].y);
lineMc.curveTo(_local6[2].x, _local6[2].y, _local6[3].x, _local6[3].y);
lineMc.lineTo(_local5[3].x, _local5[3].y);
lineMc.curveTo(_local5[2].x, _local5[2].y, _local5[1].x, _local5[1].y);
lineMc.curveTo(_local5[0].x, _local5[0].y, foot._x, foot._y);
lineMc.lineStyle(2, darkColor);
lineMc.beginFill(darkColor);
lineMc.moveTo(foot._x, foot._y);
lineMc.curveTo(_local7[0].x, _local7[0].y, _local7[1].x, _local7[1].y);
lineMc.curveTo(_local7[2].x, _local7[2].y, _local7[3].x, _local7[3].y);
lineMc.lineTo(_local5[3].x, _local5[3].y);
lineMc.curveTo(_local5[2].x, _local5[2].y, _local5[1].x, _local5[1].y);
lineMc.curveTo(_local5[0].x, _local5[0].y, foot._x, foot._y);
}
var darkColor = 26163;
var lightColor = 3381606;
var _baseRange = [-2.0943951023932, -1.0471975511966];
var _kneeRange = [-0.785398163397448, (Math.PI/4)];
var _ankleRange = [-0.628318530717959, 0.628318530717959];
var tipOffX = -5;
var tipOffY = 0;
var yThresh = -110;
}
Symbol 192 MovieClip [__Packages.DuckLeg] Frame 0
class DuckLeg extends Leg
{
var foot;
function DuckLeg () {
super();
}
function setFoot(rotVal) {
rotVal = rotVal / 2;
while (rotVal > 180) {
rotVal = rotVal - 180;
}
var _local3 = 181 - Math.floor(rotVal);
foot.gotoAndStop(_local3);
}
var _baseRange = [-2.35619449019234, -1.30899693899575];
var _kneeRange = [0.392699081698724, 1.17809724509617];
var _ankleRange = [-1.5707963267949, -0.785398163397448];
var tipOffX = -15;
var tipOffY = 15;
var yThresh = -70;
}
Symbol 193 MovieClip [__Packages.BearLeg] Frame 0
class BearLeg extends Leg
{
var lineMc, newClip, _calfLength, _kneeRad, _ankleRad, cos, calf, midPtA, _thighLength, midPtB, foot, thigh;
function BearLeg () {
super();
lineMc = newClip(this);
}
function draw() {
super.draw();
var _local10 = _calfLength;
var _local3 = -(_ankleRad - _kneeRad);
if (_local3 > Math.PI) {
_local3 = _local3 - (Math.PI*2);
}
if (_local3 < -3.14159265358979) {
_local3 = _local3 + (Math.PI*2);
}
if (_local3 < -0.785398163397448) {
_local3 = -0.785398163397448;
}
if (_local3 > (Math.PI/4)) {
_local3 = (Math.PI/4);
}
var _local6 = _local3 + Math.PI;
var _local4 = (_local10 / 2) / cos(_local6);
var _local9 = _local6 + _kneeRad;
var _local7 = _local4 * Math.cos(_local9);
var _local5 = _local4 * Math.sin(_local9);
var _local12 = calf._x + _local7;
var _local11 = calf._y + _local5;
midPtA = {x:_local12, y:_local11};
var _local8 = _thighLength / _calfLength;
midPtB = {x:calf._x - (_local7 * _local8), y:calf._y - (_local5 * _local8)};
lineMc.clear();
lineMc.lineStyle(30, 13434879, 100, false, "normal", "none");
lineMc.moveTo(foot._x, foot._y);
lineMc.curveTo(midPtA.x, midPtA.y, calf._x, calf._y);
lineMc.curveTo(midPtB.x, midPtB.y, thigh._x, thigh._y);
lineMc.endFill();
}
var _baseRange = [-1.96349540849362, -1.17809724509617];
var _kneeRange = [-0.523598775598299, 0.523598775598299];
var _ankleRange = [-0.392699081698724, 0.392699081698724];
var tipOffX = -10;
var tipOffY = 0;
var yThresh = -90;
}
Symbol 194 MovieClip [__Packages.RobotLeg] Frame 0
class RobotLeg extends Leg
{
var soundArr, _soundPlaying, _soundCounter, foot;
function RobotLeg () {
super();
soundArr = [];
soundArr[2] = true;
soundArr[17] = true;
soundArr[33] = true;
soundArr[50] = true;
soundArr[67] = true;
soundArr[84] = true;
}
function draw() {
super.draw();
if (_soundPlaying) {
_soundCounter++;
if (soundArr[_soundCounter - 1]) {
foot.eye.play();
}
}
}
var tipOffX = 14;
var tipOffY = 7;
var yThresh = -135;
}
Symbol 197 MovieClip [__Packages.MotionSpirit] Frame 0
class MotionSpirit
{
var _legObj, _dir, _kneeDir, _yOff, _baseSwingRadius, _osc, _legOy, currMode, _addOsc, _touchY, _strideFactor, _swingRadius, _groundArcRad, _swingArcRad, _swingOffsetY, _swingArcLength, _groundLength, _totalWalkLength, _currWalkDist;
function MotionSpirit (legObj, dir, kneeDir, yOff, swingR, initFrac) {
_legObj = legObj;
_dir = dir;
_kneeDir = kneeDir;
_yOff = yOff;
_legObj._xscale = 100 * _dir;
_baseSwingRadius = swingR;
_osc = initFrac;
_legOy = _legObj._y;
}
function get legX() {
return(_legObj._x);
}
function get legY() {
return(_legObj._y);
}
function get legOffsetY() {
return(_legObj._y - _legOy);
}
function tidyUp() {
_legObj._y = _legOy;
}
function getMode() {
return(currMode);
}
function getModeProgress() {
}
function setModeAndProgress(modeName, progFrac) {
currMode = modeName;
}
function getCycleOsc() {
return(_osc);
}
function getOsc() {
return(_osc);
}
function getAddOsc() {
return(_addOsc);
}
function setYTouch(num) {
_touchY = (num - _legOy) + _yOff;
}
function setStrideFactor(num) {
_strideFactor = num;
_swingRadius = _baseSwingRadius * num;
initStride();
}
function initStride() {
_groundArcRad = 2.0943951023932;
_swingArcRad = (Math.PI*2) - _groundArcRad;
_swingOffsetY = _touchY - (_swingRadius / 2);
_swingArcLength = ((Math.PI*2) * _swingRadius) * (1 - (_groundArcRad / (Math.PI*2)));
_groundLength = (Math.sin(_groundArcRad) * _swingRadius) * 2;
_totalWalkLength = _swingArcLength + _groundLength;
_currWalkDist = _totalWalkLength * _osc;
}
function setFootPos(x, y, footAngle) {
_legObj.setTip(x, y, (Math.PI/2) + footAngle, _kneeDir);
}
var newCycle = false;
}
Symbol 198 MovieClip [__Packages.WalkSpirit] Frame 0
class WalkSpirit extends MotionSpirit
{
var _osc, _totalWalkLength, _groundLength, _addOsc, newCycle, _legObj, _currWalkDist, currMode, _dir, _swingArcRad, _legOy, _swingRadius, _swingArcLength, setFootPos, _swingOffsetY;
function WalkSpirit (legObj, dir, kneeDir, yOff, swingR, initFrac) {
super(legObj, dir, kneeDir, yOff, swingR, initFrac);
}
function jumpToMode(modeName) {
if (modeName == "air") {
_osc = _osc + (_groundLength / _totalWalkLength);
}
}
function step(spd, stepFrac, swingFactor) {
var _local9 = spd / _totalWalkLength;
_addOsc = _local9 * stepFrac;
newCycle = false;
_legObj._alpha = 100;
_osc = _osc + _addOsc;
_osc = _osc;
if (_osc > 1) {
_osc = _osc - 1;
}
_currWalkDist = _totalWalkLength * _osc;
if (_currWalkDist > _totalWalkLength) {
_currWalkDist = _currWalkDist - _totalWalkLength;
}
var _local3;
var _local2;
var _local4;
if (_currWalkDist < _groundLength) {
newCycle = true;
if (currMode == "air") {
SoundManager.playSound("clop" + random(11));
}
currMode = "ground";
var _local5 = _currWalkDist / _groundLength;
if (_dir == -1) {
_local5 = 1 - _local5;
}
var _local8 = ((-_swingArcRad) / 2) - (Math.PI/2);
var _local6 = 0;
var _local7 = _legOy + _local6;
_local3 = (Math.cos(_local8) * _swingRadius) + (_local5 * _groundLength);
_local2 = (Math.sin(_local8) * _swingRadius) - _local6;
_local4 = Math.atan2(_local2, _local3);
footD = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local4 = 0;
} else {
currMode = "air";
doAir();
var _local5 = (_currWalkDist - _groundLength) / _swingArcLength;
if (_dir == -1) {
_local5 = 1 - _local5;
}
_local4 = ((_swingArcRad / 2) - (Math.PI/2)) - (_swingArcRad * _local5);
var footD = _swingRadius;
_local3 = Math.cos(_local4) * footD;
_local2 = Math.sin(_local4) * footD;
_local4 = (-0.392699081698724 * Math.sin((_local5 * Math.PI) * 2)) * swingFactor;
var _local7 = _legOy;
}
_legObj._y = _local7;
setFootPos(_legObj._x + _local3, (_local7 + _local2) + _swingOffsetY, _local4);
}
function getHeightVal() {
return(Math.sin(((_osc * Math.PI) * 2) + 1.0471975511966) * 10);
}
function doGround() {
}
function doAir() {
}
}
Symbol 199 MovieClip [__Packages.JumpSpirit] Frame 0
class JumpSpirit extends MotionSpirit
{
var _jumpTimeLength, _totalWalkLength, _addOsc, _groundLength, _totalOsc, newCycle, _osc, currMode, _legObj, _swingArcRad, _legOy, _swingRadius, setFootPos, _dir, _swingOffsetY, __get__legOffsetY;
function JumpSpirit (legObj, dir, kneeDir, yOff, swingR, initFrac) {
super(legObj, dir, kneeDir, yOff, swingR, initFrac);
_jumpTimeLength = Math.abs((_jumpV * 2) / _grav);
}
function step(spd, stepFrac, swingFactor) {
var _local6 = spd / _totalWalkLength;
_addOsc = _local6 * stepFrac;
var _local2 = _groundLength / _totalWalkLength;
var _local17 = _jumpTimeLength * _local6;
_totalOsc = (_local2 * 2) + _local17;
newCycle = false;
_osc = _osc + _addOsc;
_osc = _osc;
if (_osc > _totalOsc) {
_osc = _osc - _totalOsc;
}
if ((_osc > 0) && (_osc < _local2)) {
if (currMode == "recover") {
newCycle = true;
return(undefined);
}
currMode = "crouchLaunch";
} else if ((_osc > 0) && (_osc < (_totalOsc - _local2))) {
currMode = "leap";
} else {
if (_legObj._name == "lady") {
if (currMode == "leap") {
SoundManager.playSound("clop" + random(11));
}
}
currMode = "recover";
}
var _local7;
var _local4;
var _local3;
var _local5;
if (currMode == "crouchLaunch") {
var _local9 = _osc / _local2;
var _local10 = ((-_swingArcRad) / 2) - (Math.PI/2);
var _local13 = (_local2 - _osc) / _local6;
var _local15 = Curves.easeOut(_local9);
var _local16 = (-_jumpV) * _local13;
var _local11 = _local16 * _local15;
_local7 = _legOy + _local11;
_local4 = (Math.cos(_local10) * _swingRadius) + (_local9 * _groundLength);
_local3 = (Math.sin(_local10) * _swingRadius) - _local11;
_local5 = Math.atan2(_local3, _local4);
footD = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
_local5 = 0;
} else if (currMode == "leap") {
var _local9 = (_osc - _local2) / (_totalOsc - (_local2 * 2));
_local5 = ((_swingArcRad / 2) - (Math.PI/2)) - (_swingArcRad * _local9);
var footD = _swingRadius;
_local4 = Math.cos(_local5) * footD;
_local3 = Math.sin(_local5) * footD;
_local5 = (-0.392699081698724 * Math.sin((_local9 * Math.PI) * 2)) * swingFactor;
var _local8 = _jumpTimeLength * _local9;
_local7 = ((((0.5 * _grav) * _local8) * _local8) + (_jumpV * _local8)) + _legOy;
} else if (currMode == "recover") {
var _local12 = _osc - (_totalOsc - _local2);
var _local9 = _local12 / _local2;
var _local10 = ((-_swingArcRad) / 2) - (Math.PI/2);
var _local14 = _local12 / _local6;
var _local15 = Curves.easeOut(1 - _local9);
var _local16 = (-_jumpV) * _local14;
var _local11 = _local16 * _local15;
_local7 = _legOy + _local11;
_local4 = (Math.cos(_local10) * _swingRadius) + (_local9 * _groundLength);
_local3 = (Math.sin(_local10) * _swingRadius) - _local11;
_local5 = Math.atan2(_local3, _local4);
footD = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
_local5 = 0;
}
_legObj._y = _local7;
setFootPos(_legObj._x + (_local4 * _dir), (_local7 + _local3) + _swingOffsetY, _local5);
}
function getHeightVal() {
return(__get__legOffsetY() - (50 * Curves.scurve((_osc / _totalOsc) * 2)));
}
var _jumpV = -10;
var _grav = 0.5;
}
Symbol 200 MovieClip [__Packages.WalkingLegs] Frame 0
class WalkingLegs extends MovieClip
{
var _xscale, _yscale, transitionQueue, _currWalkState, inTransition, transitionIndex, waitingForCycles, legNamesByIndex, legSpirits, _queuedCyclesByLegIndex, launchOsc, gotoAndStop, currTransition, transVal, maxTransVal, _lastWalkState, _nextWalkState;
function WalkingLegs () {
super();
_xscale = (_yscale = 100 * scale);
transitionQueue = [];
transitionQueue[0] = {name:"crouch", maxVal:0.0001};
_currWalkState = _walkStateData.crouch;
inTransition = false;
transitionIndex = 0;
waitingForCycles = false;
}
function initLegs() {
legNamesByIndex = [];
legSpirits = [];
_queuedCyclesByLegIndex = [];
var _local3 = 0;
for (var _local4 in legNames) {
legNamesByIndex.push(_local4);
var _local2 = getLegSpirit(_local4, WalkSpirit, _local3 / 10);
setStateValues(_local2, _currWalkState);
legSpirits.push(_local2);
_queuedCyclesByLegIndex.push([]);
_local3++;
}
}
function getLegSpirit(n, spiritClass, initFrac) {
var _local3 = this[n];
_local3._rotation = 0;
return(new spiritClass[undefined](_local3, legNames[n].dir, legNames[n].kneeDir, legNames[n].yOff, legNames[n].swingR, initFrac));
}
function getWaitingCycles() {
var _local3 = _queuedCyclesByLegIndex.length;
var _local2 = 0;
while (_local2 < _local3) {
if (_queuedCyclesByLegIndex[_local2].length > 0) {
return(true);
}
_local2++;
}
return(false);
}
function run() {
var _local5 = legSpirits.length;
var _local2 = 0;
while (_local2 < _local5) {
legSpirits[_local2].step(_currWalkState.speed, 1, _currWalkState.strideFactor);
var _local6 = getWaitingCycles();
if (_local6) {
if (!readyForCycles) {
if (_local2 == (_local5 - 1)) {
if (legSpirits[_local2].newCycle) {
readyForCycles = true;
}
}
}
var _local7 = _queuedCyclesByLegIndex[_local2];
var _local4 = _local7[0];
var _local3;
if (_local4 == "gallop") {
_local3 = true;
} else if (_local4 == "jump") {
if (_local2 == (_local5 - 1)) {
_local3 = true;
launchOsc = legSpirits[_local2].getOsc();
} else {
var _local10 = legSpirits[_local2].getOsc();
var _local8 = legSpirits[_local2].getAddOsc();
_local3 = (_local10 - launchOsc) < _local8;
}
}
if (((_local3 && (legSpirits[_local2].newCycle)) && (readyForCycles)) && (_queuedCyclesByLegIndex[_local2].length > 0)) {
var _local9 = _queuedCyclesByLegIndex[_local2].splice(0, 1)[0];
legSpirits[_local2] = swapCycles(legSpirits[_local2], legNamesByIndex[_local2], _local9);
}
} else {
readyForCycles = false;
waitingForCycles = false;
}
_local2++;
}
osc = legSpirits[0].getOsc();
}
function getTilt() {
var _local3 = legSpirits[0];
var _local2 = legSpirits[legSpirits.length - 1];
var _local4 = Math.atan2(_local3.getHeightVal() - _local2.getHeightVal(), _local3.legX - _local2.legX);
return((_local4 * standFrac) * _currWalkState.strideFactor);
}
function getLift() {
return((-(legSpirits[3].getHeightVal() - 95)) * standFrac);
}
function swapCycles(legSpirit, legName, type) {
var _local3 = legSpirit.getCycleOsc();
legSpirit.tidyUp();
var _local2 = getLegSpirit(legName, ((type == "jump") ? (JumpSpirit) : (WalkSpirit)), _local3);
setStateValues(_local2, _currWalkState);
if (type == "gallop") {
_local2.jumpToMode("air");
}
_local2.step(_currWalkState.speed, 0.001, _currWalkState.strideFactor);
return(_local2);
}
function setState(boo) {
gotoAndStop((boo ? 2 : 1));
active = boo;
if (boo) {
initLegs();
}
}
function addTransition(name, maxVal) {
transitionQueue.push({name:name, val:0, maxVal:maxVal});
if (!inTransition) {
transitionIndex++;
initNextTransition(0);
}
}
function initNextTransition(initFrac) {
inTransition = true;
var _local2 = transitionIndex;
currTransition = transitionQueue[_local2];
transVal = currTransition.maxVal * initFrac;
maxTransVal = currTransition.maxVal;
_lastWalkState = _walkStateData[transitionQueue[_local2 - 1].name];
_nextWalkState = _walkStateData[currTransition.name];
}
function insertCycles(typeArr) {
if (waitingForCycles) {
return(undefined);
}
waitingForCycles = true;
var _local6 = legSpirits.length;
var _local3 = 0;
while (_local3 < _local6) {
var _local4 = _queuedCyclesByLegIndex[_local3];
var _local2 = 0;
while (_local2 < typeArr.length) {
_local4.push(typeArr[_local2]);
_local2++;
}
_local3++;
}
}
function incrementTransition(amt) {
if ((amt < 0) && (waitingForCycles)) {
return(undefined);
}
var _local3 = _lastWalkState;
var _local5 = _nextWalkState;
transVal = transVal + amt;
if (transVal > maxTransVal) {
transVal = maxTransVal;
}
if (transVal < 0) {
transVal = 0;
}
var _local7 = transVal;
var _local8 = maxTransVal;
var _local4 = Curves.scurve(_local7 / _local8);
_currWalkState = {};
for (var _local2 in _local3) {
_currWalkState[_local2] = (_local3[_local2] * (1 - _local4)) + (_local5[_local2] * _local4);
}
var _local6 = legSpirits.length;
var _local2 = 0;
while (_local2 < _local6) {
setStateValues(legSpirits[_local2], _currWalkState);
_local2++;
}
if (_local7 >= _local8) {
if (transitionIndex < (transitionQueue.length - 1)) {
transitionIndex++;
initNextTransition(0);
} else {
inTransition = false;
}
} else if (_local7 <= 0) {
if (transitionIndex > 1) {
transitionIndex--;
initNextTransition(1);
} else {
inTransition = false;
}
}
}
function setStateValues(legSpirit, walkState) {
legSpirit.setYTouch(walkState.yTouch);
legSpirit.setStrideFactor(walkState.strideFactor);
}
function getTransitionState() {
return([transitionIndex, transVal]);
}
function getSpeed() {
return(_currWalkState.speed);
}
function get yTouch() {
return(_currWalkState.yTouch);
}
function get standFrac() {
return(_currWalkState.standFrac);
}
var scale = 1.1;
var _walkStateData = {crouch:{speed:0, strideFactor:0.0001, yTouch:50, standFrac:0}, stand:{speed:0, strideFactor:0.0001, yTouch:90, standFrac:0.85}, walk:{speed:4, strideFactor:0.8, yTouch:90, standFrac:0.9}, gallop:{speed:10, strideFactor:1.2, yTouch:90, standFrac:0.8}, jump:{speed:10, strideFactor:1.2, yTouch:90, standFrac:0.8}};
var legNames = {duck:{dir:1, kneeDir:-1, yOff:-16, swingR:20}, tentacle:{dir:-1, kneeDir:1, yOff:0, swingR:20}, elephant:{dir:1, kneeDir:1, yOff:1, swingR:20}, horse:{dir:-1, kneeDir:1, yOff:5, swingR:20}, bear:{dir:1, kneeDir:1, yOff:-5, swingR:20}, lady:{dir:1, kneeDir:1, yOff:0, swingR:20}, robot:{dir:1, kneeDir:1, yOff:0, swingR:20}};
var osc = 0;
var readyForCycles = false;
var active = false;
}
Symbol 209 MovieClip [__Packages.EventStack] Frame 0
class EventStack extends MovieClip
{
static var rootForm;
var eventArray, evtClip;
function EventStack (evtArr) {
super();
eventArray = [];
var _local4 = evtArr.length;
var _local3 = 0;
while (_local3 < _local4) {
eventArray[_local3] = evtArr[_local3];
_local3++;
}
var _local6 = rootForm.getNextHighestDepth();
evtClip = (rootForm.evtClip = rootForm.createEmptyMovieClip("evtClip" + _local6, _local6));
}
function begin() {
nextEvent();
}
function nextEvent() {
var _local2 = eventArray.splice(0, 1)[0];
var target = _local2.target;
var action = _local2.action;
var waitTime = _local2.wait;
var easeType = _local2.ease;
var paramObj = _local2.params;
paramObj.totalTime = waitTime;
if (paramObj == undefined) {
paramObj = {};
}
if (target[action + "Init"] != undefined) {
target[action + "Init"](paramObj);
}
target.state = action;
var counter = 0;
var o = this;
if (_local2 == undefined) {
nextEvent = undefined;
evtClip.onEnterFrame = function () {
};
} else if (waitTime != undefined) {
evtClip.onEnterFrame = function () {
if (EventStack.isPaused) {
return(undefined);
}
counter++;
var _local1 = o.ease(easeType, counter / waitTime);
target[action](_local1, paramObj);
if (counter >= waitTime) {
o.nextEvent();
}
};
if (waitTime == 0) {
evtClip.onEnterFrame();
}
} else {
var rtnFunc = function () {
o.nextEvent();
};
evtClip.onEnterFrame = function () {
if (EventStack.isPaused) {
return(undefined);
}
target[action](rtnFunc, paramObj);
};
}
}
function ease(type, frac) {
if (type == "in") {
return(1 - Math.sin(((1 - frac) * Math.PI) / 2));
}
if (type == "out") {
return(Math.sin((frac * Math.PI) / 2));
}
if (type == "scurve") {
return(((-Math.cos(frac * Math.PI)) + 1) / 2);
}
return(frac);
}
static function setPause(boo, key) {
if (boo) {
var _local4 = pauseKeys.length;
var _local3 = false;
var _local1 = 0;
while (_local1 < _local4) {
if (pauseKeys[_local1] == key) {
_local3 = true;
}
_local1++;
}
if (!_local3) {
pauseKeys.push(key);
}
} else {
var _local4 = pauseKeys.length;
var _local1 = _local4 - 1;
while (_local1 >= 0) {
if (pauseKeys[_local1] == key) {
pauseKeys.splice(_local1, 1);
}
_local1--;
}
}
isPaused = pauseKeys.length > 0;
}
static function resetStack() {
pauseKeys.length = 0;
isPaused = false;
}
static var isPaused = false;
var waiting = false;
static var pauseKeys = [];
}
Symbol 210 MovieClip [__Packages.Vp3dObject] Frame 0
class Vp3dObject
{
function Vp3dObject () {
}
function pyt(n1, n2) {
return(Math.sqrt((n1 * n1) + (n2 * n2)));
}
function piWrap(num) {
if (num > PI) {
num = num - (PI * 2);
} else if (num < (-PI)) {
num = num + (PI * 2);
}
return(num);
}
function sCurve(n) {
return(((-cos(n * PI)) + 1) / 2);
}
var PI = Math.PI;
var sqrt = Math.sqrt;
var abs = Math.abs;
var atan2 = Math.atan2;
var sin = Math.sin;
var cos = Math.cos;
}
Symbol 211 MovieClip [__Packages.Point] Frame 0
class Point extends Vp3dObject
{
var vData, _g, _ak, _p, _home, ix, iy, iz, pvx, pvy, depth, vx, vy, sc, vys, sq, cR, sR, cY, sY, cT, sT;
function Point (p, ix, iy, iz) {
super();
vData = (_roteSwitch ? (vDataRote) : (vDataFixed));
_g = _global;
_ak = _g.anchor;
_p = p;
_home = _p.home;
if (ix != undefined) {
ix = (x = ix);
}
if (iy != undefined) {
iy = (y = iy);
}
if (iz != undefined) {
iz = (z = iz);
}
}
function XYZ(a, b, c) {
if (a != undefined) {
x = a;
}
if (b != undefined) {
y = b;
}
if (c != undefined) {
z = c;
}
}
function iXYZ(a, b, c) {
ix = (x = a);
iy = (y = b);
iz = (z = c);
}
function zero() {
XYZ(0, 0, 0);
}
function locate() {
px = x + _p.px;
py = y + _p.py;
pz = z + _p.pz;
vData();
}
function locateRote(a) {
var _local2 = sn(a);
var _local3 = cs(a);
px = ((x * _local3) - (y * _local2)) + _p.px;
py = ((y * _local3) + (x * _local2)) + _p.py;
pz = z + _p.pz;
vData();
}
function locateRoteTilt(a, t) {
var _local2 = (x * cs(t)) - (z * sn(t));
var _local5 = (z * cs(t)) + (x * sn(t));
px = ((_local2 * cs(a)) - (y * sn(a))) + _p.px;
py = ((y * cs(a)) + (_local2 * sn(a))) + _p.py;
pz = _local5 + _p.pz;
vData();
}
function locateRoteYaw(a, y) {
var _local3 = (y * cs(y)) - (z * sn(y));
var _local5 = (z * cs(y)) + (y * sn(y));
px = ((x * cs(a)) - (_local3 * sn(a))) + _p.px;
py = ((_local3 * cs(a)) + (x * sn(a))) + _p.py;
pz = _local5 + _p.pz;
vData();
}
function locateRoteTiltYaw(a, t, y) {
var _local3 = (y * cs(y)) - (z * sn(y));
var _local7 = (z * cs(y)) + (y * sn(y));
var _local4 = (x * cs(t)) - (_local7 * sn(t));
var _local8 = (_local7 * cs(t)) + (x * sn(t));
px = ((_local4 * cs(a)) - (_local3 * sn(a))) + _p.px;
py = ((_local3 * cs(a)) + (_local4 * sn(a))) + _p.py;
pz = _local8 + _p.pz;
vData();
}
function get home() {
return(_home);
}
function set home(obj) {
_home = obj;
//return(home);
}
function vDataFixed() {
pvx = px;
pvy = py;
depth = _home.perspex / py;
var _local2 = depth * 10;
vx = px * _local2;
vy = (-pz) * _local2;
sc = 100 * _local2;
vys = (-_home.pz) * _local2;
sq = _home.pz / py;
}
function vDataRote() {
var _local4 = px - _ak.px;
var _local3 = py - _ak.py;
pvx = (_ak.px + (_local4 * _g.cr)) + (_local3 * _g.sr);
pvy = (_ak.py + (_local3 * _g.cr)) - (_local4 * _g.sr);
depth = _home.perspex / pvy;
var _local2 = depth * 10;
vx = pvx * _local2;
vy = (-pz) * _local2;
vys = (-_home.pz) * _local2;
sq = _home.pz / pvy;
sc = (100 * depth) * 10;
}
function fullMatch(s) {
px = s.px;
py = s.py;
pz = s.pz;
pvx = s.pvx;
pvy = s.pvy;
depth = s.depth;
sc = s.sc;
vx = s.vx;
vy = s.vy;
vys = s.vys;
sq = s.sq;
}
function roteSet(a) {
cR = cs(a);
sR = sn(a);
}
function yawSet(y) {
cY = cs(y);
sY = sn(y);
}
function tiltSet(t) {
cT = cs(t);
sT = sn(t);
}
function angleSet(a, t, y) {
cR = cs(a);
sR = sn(a);
cY = cs(y);
sY = sn(y);
cT = cs(t);
sT = sn(t);
}
function locateRoteSrc(pts) {
var _local4 = pts.length;
var _local3 = 0;
while (_local3 < _local4) {
var _local2 = pts[_local3];
_local2.px = ((_local2.x * cR) - (_local2.y * sR)) + _local2._p.px;
_local2.py = ((_local2.y * cR) + (_local2.x * sR)) + _local2._p.py;
_local2.pz = _local2.z + _local2._p.pz;
_local2.vData();
_local3++;
}
}
function locateRoteTiltSrc(pts) {
var _local4 = pts.length;
var _local3 = 0;
while (_local3 < _local4) {
var _local2 = pts[_local3];
_local2.px = ((((_local2.x * cT) - (_local2.z * sT)) * cR) - (_local2.y * sR)) + _local2._p.px;
_local2.py = ((_local2.y * cR) + (((_local2.x * cT) - (_local2.z * sT)) * sR)) + _local2._p.py;
_local2.pz = ((_local2.z * cT) + (_local2.x * sT)) + _local2._p.pz;
_local2.vData();
_local3++;
}
}
function locateRoteYawSrc(pts) {
var _local4 = pts.length;
var _local3 = 0;
while (_local3 < _local4) {
var _local2 = pts[_local3];
_local2.px = ((_local2.x * cR) - (((_local2.y * cY) - (_local2.z * sY)) * sR)) + _local2._p.px;
_local2.py = ((((_local2.y * cY) - (_local2.z * sY)) * cR) + (_local2.x * sR)) + _local2._p.py;
_local2.pz = ((_local2.z * cY) + (_local2.y * sY)) + _local2._p.pz;
_local2.vData();
_local3++;
}
}
function locateRoteTiltYawSrc(pts) {
var _local8 = pts.length;
var _local3 = 0;
while (_local3 < _local8) {
var _local2 = pts[_local3];
var _local4 = (_local2.y * cY) - (_local2.z * sY);
var _local6 = (_local2.z * cY) + (_local2.y * sY);
var _local5 = (_local2.x * cT) - (_local6 * sT);
var _local7 = (_local6 * cT) + (_local2.x * sT);
_local2.px = ((_local5 * cR) - (_local4 * sR)) + _local2._p.px;
_local2.py = ((_local4 * cR) + (_local5 * sR)) + _local2._p.py;
_local2.pz = _local7 + _local2._p.pz;
_local2.vData();
_local3++;
}
}
var x = 0;
var y = 0;
var z = 0;
var px = 0;
var py = 0;
var pz = 0;
var sn = Math.sin;
var cs = Math.cos;
static var _roteSwitch = false;
}
Symbol 212 MovieClip [__Packages.Part] Frame 0
class Part extends Point
{
var _p, name, __set__home, id, shadow, _palette, form, vx, vy, __get__home, sc, vys, sq, colr, __get__visible, blendColors, depth;
function Part (p, s, kolr, palette) {
super();
if (p != undefined) {
register("Part", p, s, palette);
if (kolr != undefined) {
setColor(kolr);
}
}
}
function register(nme, p, shad, pal) {
if (p.length == 2) {
_p = p[0];
var _local2 = p[1];
} else {
_p = p;
var _local2 = p;
}
name = nme;
__set__home(_p.home);
partCount = partCount + 1;
id = partCount;
makeForm(name, _local2, id);
if (shad == 1) {
makeShadow(name, _local2);
} else if ((shad == 0) or (shad == undefined)) {
shadow = 0;
} else if (shad == -1) {
makeEmptyShadow(name, _local2);
}
if (_palette == undefined) {
if (pal == undefined) {
_palette = _p.palette;
} else {
_palette = pal;
}
}
}
function get palette() {
return(((_palette == undefined) ? (_p.palette) : (_palette)));
}
function attachTo(path) {
_p = path;
_palette = palette;
}
function makeForm(name, base, level) {
form = base.form.createEmptyMovieClip("f" + id, level);
}
function makeShadow(name, base) {
shadow = base.shadow.createEmptyMovieClip("s" + id, id);
}
function makeEmptyShadow(name, base) {
shadow = base.shadow.createEmptyMovieClip("s" + id, id);
}
function simpleDraw() {
form._x = vx;
form._y = vy;
form._xscale = (form._yscale = sc / __get__home().scale);
}
function shadowDraw() {
shadow._x = vx;
shadow._y = vys;
shadow._xscale = sc / __get__home().scale;
shadow._yscale = (sc * sq) / __get__home().scale;
}
function assignColor(num, path) {
colr = new Color(path);
if (num.length == 6) {
colr.setRGB("0x" + num);
} else {
colr.setRGB("0x" + _palette[num].hex);
}
}
function setColor(kolr) {
assignColor(kolr, form);
}
function set visible(boo) {
form._visible = boo;
shadow._visible = boo;
//return(__get__visible());
}
function lineStyle(thk, rgb) {
form.lineStyle(thk, rgb);
}
function beginFill(rgb) {
form.beginFill(rgb);
}
function moveTo(pt) {
form.moveTo(pt.vx, pt.vy);
}
function clear() {
form.clear();
}
function lineTo(pt) {
form.lineTo(pt.vx, pt.vy);
}
function curveTo(pt1, pt2) {
form.curveTo(pt1.vx, pt1.vy, pt2.vx, pt2.vy);
}
function SbeginFill(rgb) {
form.beginFill(rgb);
shadow.beginFill(rgb);
}
function SmoveTo(pt) {
form.moveTo(pt.vx, pt.vy);
shadow.moveTo(pt.vx, pt.vys);
}
function Sclear() {
form.clear();
shadow.clear();
}
function SlineTo(pt) {
form.lineTo(pt.vx, pt.vy);
shadow.lineTo(pt.vx, pt.vys);
}
function ScurveTo(pt1, pt2) {
form.curveTo(pt1.vx, pt1.vy, pt2.vx, pt2.vy);
shadow.curveTo(pt1.vx, pt1.vys, pt2.vx, pt2.vys);
}
function swapDepths(dpth) {
form.swapDepths(dpth);
}
function pointSet(num, path) {
var _local2 = new Array();
var _local1 = 0;
while (_local1 < num) {
_local2.push(new Point(path));
_local1++;
}
return(_local2);
}
function pointMerge(src) {
var _local4 = new Array();
var _local2 = 0;
while (_local2 < src.length) {
if (src[_local2].length != undefined) {
var _local1 = 0;
while (_local1 < src[_local2].length) {
_local4.push(src[_local2][_local1]);
_local1++;
}
} else {
_local4.push(src[_local2]);
}
_local2++;
}
return(_local4);
}
function assignHex(hex, path) {
var _local1 = new Color(path);
_local1.setRGB("0x" + hex);
}
function iColorBlend(colr1, colr2) {
blendColors = new Array(_palette[colr1], _palette[colr2]);
_palette[colr1].kolorBreak();
_palette[colr2].kolorBreak();
}
function colorBlend(frac) {
if (frac < 0) {
frac = 0;
} else if (frac > 1) {
frac = 1;
}
var _local5 = 100 * (1 - frac);
var _local2 = new Object();
var _local3 = frac;
_local2.ra = (_local2.ga = (_local2.ba = 0));
_local2.rb = (blendColors[1].rgb[0] * _local3) + (blendColors[0].rgb[0] * (1 - _local3));
_local2.gb = (blendColors[1].rgb[1] * _local3) + (blendColors[0].rgb[1] * (1 - _local3));
_local2.bb = (blendColors[1].rgb[2] * _local3) + (blendColors[0].rgb[2] * (1 - _local3));
colr.setTransform(_local2);
}
function setDepth(src) {
if (src != undefined) {
form.swapDepths(src.depth * depthFactor);
} else {
form.swapDepths(depth * depthFactor);
}
}
function setDepthNum(num) {
form.swapDepths(num * depthFactor);
}
function fore(src, num) {
if (num == undefined) {
num = 1;
}
form.swapDepths((src.depth * depthFactor) + num);
}
static var partCount = 1;
static var depthFactor = 1000000;
}
Symbol 213 MovieClip [__Packages.Cell] Frame 0
class Cell extends Part
{
var layout, filmspace, scale, __set__home, _p, id, perspex, px, py, pz, makeForm, form, shadow, assignHex;
function Cell (baseForm, ly, fs, shadowHex) {
super();
layout = ly;
filmspace = fs;
scale = layout.scale;
__set__home(this);
_p = this;
Part.partCount = Part.partCount + 1;
id = Part.partCount;
perspex = filmspace.perspex;
px = filmspace.px;
py = filmspace.py;
pz = filmspace.pz;
trace("baseForm: " + baseForm.form);
makeForm("Cell", baseForm, id);
form.createEmptyMovieClip("CellS" + id, id);
shadow = eval (((form + ".") + "CellS") + id);
form._xscale = (form._yscale = scale);
form._x = layout.ox;
form._y = layout.oy + filmspace.offset;
assignHex(shadowHex, shadow);
}
function destroy() {
removeMovieClip(form);
}
}
Symbol 214 MovieClip [__Packages.Kolor] Frame 0
class Kolor
{
var hex, rgb;
function Kolor (num) {
hex = num;
var _local5 = new Array(hex.substr(0, 2), hex.substr(2, 2), hex.substr(4, 2));
rgb = new Array();
var _local2 = 0;
while (_local2 < 3) {
var _local4 = hexDigit(_local5[_local2].substr(0, 1));
var _local3 = hexDigit(_local5[_local2].substr(1, 1));
rgb[_local2] = (_local4 * 16) + _local3;
_local2++;
}
}
function hexDigit(num) {
if (num < 10) {
num = Number(num);
} else if ((num == "A") || (num == "a")) {
num = 10;
} else if ((num == "B") || (num == "b")) {
num = 11;
} else if ((num == "C") || (num == "c")) {
num = 12;
} else if ((num == "D") || (num == "d")) {
num = 13;
} else if ((num == "E") || (num == "e")) {
num = 14;
} else if ((num == "F") || (num == "f")) {
num = 15;
}
return(num);
}
}
Symbol 215 MovieClip [__Packages.Palette] Frame 0
class Palette extends Array
{
var __get__colors;
function Palette (src) {
super();
if (src != undefined) {
colors = (src);
}
}
function set colors(src) {
var _local2 = 0;
while (_local2 < src.length) {
this[_local2] = new Kolor(src[_local2]);
_local2++;
}
//return(__get__colors());
}
}
Symbol 216 MovieClip [__Packages.Shape] Frame 0
class Shape extends Part
{
var register, sideFace, iSideFace, colors, setColor, lw, pts, form, __get__home, depth, shadow;
function Shape (p, colr, ptset, shadow, lnwt) {
super();
register("Shape", p, shadow);
sideFace = (iSideFace = 0);
switch (typeof(colr)) {
case "object" :
colors = colr;
break;
case "number" :
case "string" :
setColor(colr);
}
lw = lnwt;
if ((ptset != undefined) and (ptset != null)) {
pts = ptset;
} else {
pts = new Array();
}
}
function locate() {
var _local3 = pts.length;
var _local2 = 0;
while (_local2 < _local3) {
pts[_local2].locate();
_local2++;
}
}
function locateRote(angle) {
var _local3 = pts.length;
var _local2 = 0;
while (_local2 < _local3) {
pts[_local2].locateRote(angle);
_local2++;
}
}
function draw() {
form.clear();
form.beginFill(16777215);
if (lw != undefined) {
form.lineStyle((lw * depth) * __get__home().scale, 16777215);
}
if (colors.length == 2) {
if (sideCheck() != iSideFace) {
iSideFace = sideFace;
setColor(colors[(sideFace / 2) + 0.5]);
}
if (colors[(sideFace / 2) + 0.5] != null) {
drawCircuit(pts);
}
} else {
drawCircuit(pts);
}
if (shadow != undefined) {
shadow.clear();
shadow.beginFill(16777215);
drawShadowCircuit(pts);
}
}
function drawCircuit(pts) {
depth = 0;
var _local4 = pts.length;
var _local2 = pts[_local4 - 1];
form.moveTo(_local2.vx, _local2.vy);
var _local3 = 0;
while (_local3 < _local4) {
_local2 = pts[_local3];
form.lineTo(_local2.vx, _local2.vy);
depth = depth + (_local2.depth / _local4);
_local3++;
}
}
function drawShadowCircuit(pts) {
var _local4 = pts.length;
var _local3 = pts[_local4 - 1];
shadow.moveTo(_local3.vx, _local3.vys);
var _local2 = 0;
while (_local2 < _local4) {
_local3 = pts[_local2];
shadow.lineTo(_local3.vx, _local3.vys);
_local2++;
}
}
function sideCheck() {
var _local2 = Math.atan2(pts[1].vy - pts[0].vy, pts[1].vx - pts[0].vx) - Math.atan2(pts[2].vy - pts[0].vy, pts[2].vx - pts[0].vx);
if (Math.sin(_local2) > 0) {
sideFace = 1;
} else {
sideFace = -1;
}
return(sideFace);
}
function set points(ptset) {
pts = ptset;
//return(points);
}
function get points() {
return(pts);
}
function pointPick(src, arr) {
var _local2 = 0;
while (_local2 < arr.length) {
pts[_local2] = src[arr[_local2]];
_local2++;
}
}
}
Symbol 217 MovieClip [__Packages.Circle] Frame 0
class Circle extends Part
{
var r, register, setColor, form, shadow, simpleDraw, shadowDraw, __get__home;
function Circle (p, radius, colr, shad) {
super();
if (p != undefined) {
r = radius;
register("circle", p, shad);
setColor(colr);
}
}
function makeForm(name, base, level) {
super.makeForm(name, base, level);
form.attachMovie("tentCircle", "CircleShape", level);
radius = (r);
}
function makeShadow(name, base, level) {
super.makeShadow(name, base);
shadow.attachMovie("tentCircle", "CircleShape", level);
radius = (r);
}
function draw() {
simpleDraw();
if (shadow != 0) {
shadowDraw();
}
}
function set radius(num) {
r = num;
shadow.CircleShape._xscale = (shadow.CircleShape._yscale = (10 * r) * __get__home().scale);
form.CircleShape._xscale = (form.CircleShape._yscale = (10 * r) * __get__home().scale);
//return(radius);
}
function get radius() {
return(r);
}
}
Symbol 218 MovieClip [__Packages.Disc] Frame 0
class Disc extends Circle
{
var r, register, colors, sideFace, setColor, normal, subForm, form, subShadow, shadow, shadowDraw, vx, vy, pz, pvy, pvx, squish;
function Disc (p, radius, colr1, colr2, shad, formBase) {
super();
r = radius;
register("Disc", p, shad, formBase);
if ((colr2 != null) and (colr2 != undefined)) {
colors = new Array(colr1, colr2);
sideFace = -1;
setColor(colors[1]);
} else {
colors = 0;
sideFace = -1;
setColor(colr1);
}
normal = new Point(this, 1);
subForm = form.CircleShape;
subShadow = shadow.CircleShape;
}
function baseDraw(face, tilt) {
super.simpleDraw();
normal.locateRoteTilt(face, tilt);
squash();
sideCheck();
}
function draw(face, tilt) {
if (tilt == undefined) {
tilt = 0;
}
baseDraw(face, tilt);
shadowDraw();
subShadow._xscale = subShadow._xscale * Math.sin(tilt);
subShadow._rotation = face / (Math.PI/180);
}
function squash() {
var _local3 = normal.vx - vx;
var _local2 = normal.vy - vy;
var _local5 = Math.sqrt(((normal.pvx * normal.pvx) + (normal.pvy * normal.pvy)) + (normal.pz * normal.pz));
var _local4 = Math.sqrt(((pvx * pvx) + (pvy * pvy)) + (pz * pz));
squish = _local5 - _local4;
form._rotation = Math.atan2(_local2, _local3) / (Math.PI/180);
form._xscale = form._xscale * squish;
}
function sideCheck() {
if ((sideFace * form._xscale) < 0) {
sideFace = sideFace * -1;
if (colors.length > 0) {
setColor(colors[((-sideFace) / 2) + 0.5]);
} else {
form._visible = ((-sideFace) + 1) / 2;
}
}
}
}
Symbol 219 MovieClip [__Packages.Tent] Frame 0
class Tent extends Part
{
var eventArray, x, y, z, _palette, register, sides, baseSides, pts, basePts, tipPts, eyes, _scl, r2, baseTilt, flapLength, locate, setDepth, osc, eventStack, bottom, tip, pz, hoverFlag, hoverParams, state;
function Tent (p, ix, iy) {
super();
eventArray = [{wait:60}, {action:"rise", wait:50, ease:"scurve", params:{z:30}}, {action:"hover", wait:1, params:{state:true, magnitude:0.2, waveLength:60}}, {action:"update", wait:30}, {action:"open", wait:30, ease:"out"}, {action:"update", wait:30}, {action:"spin", wait:90, ease:"scurve", params:{dir:1}}, {action:"update", wait:30}, {action:"close", wait:30, ease:"in"}, {action:"update", wait:30}, {action:"hover", wait:1, params:{state:false}}, {action:"rise", wait:50, ease:"scurve", params:{z:0}}];
x = ix;
y = iy;
z = 0.2;
_palette = new Palette(tentColors);
register("Tent", p, 1);
sides = [];
baseSides = [];
pts = [];
basePts = [];
tipPts = [];
eyes = [];
}
function pyt(a, b) {
return(sqrt((a * a) + (b * b)));
}
function applyScale(scl) {
height = height * scl;
baseHeight = baseHeight * scl;
r = r * scl;
eyeR = eyeR * scl;
}
function init(scl) {
_scl = scl;
applyScale(scl);
var _local2 = sin(PI / numSides) * r;
r2 = sqrt((r * r) - (_local2 * _local2));
baseTilt = atan2(height, r2);
flapLength = pyt(r2, height);
buildMe();
locate();
setDepth();
osc = 0;
drawAll();
}
function begin() {
for (var _local2 in eventArray) {
eventArray[_local2].target = this;
}
eventStack = new EventStack(eventArray);
eventStack.begin();
}
function buildMe() {
var _local2 = 0;
while (_local2 < numSides) {
if (_local2 == (Math.round(_local2 / 2) * 2)) {
var _local5 = 1;
var _local6 = 5;
} else {
var _local5 = 2;
var _local6 = 6;
}
sides[_local2] = new Shape(this, "0xffffff", null, 1, 0.4);
sides[_local2].iColorBlend(_local6, _local5);
baseSides[_local2] = new Shape(this, [11, 4]);
_local2++;
}
_local2 = 0;
while (_local2 < numSides) {
pts[_local2] = new Point(this);
basePts[_local2] = new Point(this);
tipPts[_local2] = new Point(pts[_local2]);
_local2++;
}
var _local4 = 0;
var _local7 = sin(PI / numSides) * r;
_local2 = 0;
while (_local2 < numSides) {
pts[_local2].z = baseHeight;
var _local3 = ((_local2 > 0) ? (_local2 - 1) : (numSides - 1));
_local4 = _local4 + (PI / (numSides / 2));
tipPts[_local2].y = _local7;
tipPts[_local2].x = flapLength;
basePts[_local2].x = (pts[_local2].x = r * cos(baseAngle + _local4));
basePts[_local2].y = (pts[_local2].y = r * sin(baseAngle + _local4));
sides[_local2].pts = [pts[_local3], pts[_local2], tipPts[_local2]];
sides[_local2].face = (baseAngle + _local4) - (PI / numSides);
sides[_local2].angle = baseTilt;
baseSides[_local2].pts = [pts[_local2], pts[_local3], basePts[_local3], basePts[_local2]];
_local2++;
}
bottom = new Shape(this, bottomColor, basePts, 1);
pts[numSides].z = height;
_local2 = 0;
while (_local2 < numSides) {
eyes[_local2] = new Disc(this, eyeR, 0, 0);
eyes[_local2].x = (r * cos(PI / numSides)) + 0.01;
eyes[_local2].z = baseHeight / 2;
eyes[_local2].face = (baseAngle + (PI / numSides)) + (((_local2 * 2) * PI) / numSides);
eyes[_local2].iColorBlend(0, 12);
_local2++;
}
tip = new Point(this);
tip.z = baseHeight + height;
}
function setBaseAngle(newBaseAngle) {
baseAngle = newBaseAngle;
var _local3 = 0;
var _local2 = 0;
while (_local2 < numSides) {
_local3 = _local3 + (PI / (numSides / 2));
basePts[_local2].x = (pts[_local2].x = r * cos(baseAngle + _local3));
basePts[_local2].y = (pts[_local2].y = r * sin(baseAngle + _local3));
sides[_local2].face = (baseAngle + _local3) - (PI / numSides);
eyes[_local2].face = (baseAngle + (PI / numSides)) + (((_local2 * 2) * PI) / numSides);
_local2++;
}
}
function update() {
locate();
var _local2 = pz;
drawAll(true);
pz = _local2;
}
function pause(frac, paramObj) {
EventStack.setPause(true, paramObj.key);
}
function open(frac, paramObj) {
if (paramObj.openAngle != undefined) {
openAngle = paramObj.openAngle;
}
osc = PI * frac;
setOpen(osc + extraFlapOsc);
update();
}
function setLights(frac) {
var _local2 = 0;
while (_local2 < numSides) {
eyes[_local2].colorBlend(frac);
_local2++;
}
}
function flutterOpen(frac, paramObj) {
var _local4 = Math.floor(frac * numSides);
var _local2 = 0;
while (_local2 < numSides) {
if (_local2 < _local4) {
var _local7 = PI;
var _local3 = ((-cos(_local7)) / 2) + 0.5;
var _local6 = ((1 - _local3) * baseTilt) + (openAngle * _local3);
sides[_local2].angle = _local6;
} else if (_local2 == _local4) {
frac = (frac * numSides) - _local4;
var _local7 = PI * frac;
var _local3 = ((-cos(_local7)) / 2) + 0.5;
var _local6 = ((1 - _local3) * baseTilt) + (openAngle * _local3);
sides[_local2].angle = _local6;
}
_local2++;
}
osc = PI;
update();
}
function close(frac, paramObj) {
if (paramObj.openAngle != undefined) {
openAngle = paramObj.openAngle;
}
osc = PI * (1 - frac);
extraFlapOsc = extraFlapOsc * 0.95;
setOpen(osc + extraFlapOsc);
update();
}
function riseInit(paramObj) {
paramObj.iZ = z;
return(paramObj);
}
function rise(frac, paramObj) {
z = (paramObj.iZ * (1 - frac)) + (paramObj.z * frac);
update();
}
function spinInit(initObj) {
return((initObj.iAngle = baseAngle));
}
function spin(frac, paramObj) {
var _local3 = (paramObj.iAngle * (1 - frac)) + ((paramObj.iAngle + paramObj.addAngle) * frac);
setBaseAngle(_local3);
update();
}
function hoverInit(params) {
hoverFlag = params.state;
hoverParams = params;
hoverParams.osc = -0.5;
hoverParams.flapMag = 0;
}
function backgroundMod() {
if (hoverFlag) {
var _local3 = 1 / hoverParams.waveLength;
hoverParams.osc = hoverParams.osc + _local3;
var _local4 = sin((hoverParams.osc * Math.PI) * 2);
pz = pz + (_local4 * hoverParams.magnitude);
if (((!hoverParams.noFlap) and (state != "open")) and (state != "close")) {
if (hoverParams.flapMag < 30) {
hoverParams.flapMag++;
}
var _local2 = -sin((hoverParams.osc * Math.PI) + 2.74889357189107);
extraFlapOsc = (((_local2 * Math.PI) / 12) * hoverParams.flapMag) / 30;
setOpen(osc + extraFlapOsc);
}
}
}
function setOpen(currOsc) {
var _local4 = ((-cos(currOsc)) / 2) + 0.5;
var _local3 = ((1 - _local4) * baseTilt) + (openAngle * _local4);
var _local2 = 0;
while (_local2 < 6) {
sides[_local2].angle = _local3;
_local2++;
}
}
function drawTop(forceDraw) {
var _local2 = 0;
while (_local2 <= numSides) {
pts[_local2].locate();
tipPts[_local2].locateRoteTilt(sides[_local2].face + PI, sides[_local2].angle + 0.001);
_local2++;
}
_local2 = 0;
while (_local2 < numSides) {
if (((sides[_local2].angle != undefined) and (sides[_local2].angle != sides[_local2].oangle)) or forceDraw) {
sides[_local2].draw();
var _local3 = sides[_local2].sideCheck();
sides[_local2].colorBlend(((cos(sides[_local2].angle) * _local3) + 1) / 2);
if ((baseSides[_local2].sideCheck() == -1) and (osc < 1)) {
sides[_local2].fore(baseSides[_local2], _local2 + numSides);
} else {
sides[_local2].fore(sides[_local2].pts[2], _local2);
}
sides[_local2].oangle = sides[_local2].angle;
}
_local2++;
}
}
function drawAll(forceDraw) {
tip.locate();
locateBasePoints();
drawBaseSides();
drawTop(forceDraw);
drawEyes();
bottom.draw();
}
function locateBasePoints() {
var _local2 = 0;
while (_local2 <= numSides) {
basePts[_local2].locate();
pts[_local2].locate();
_local2++;
}
}
function drawBaseSides() {
var _local2 = 0;
while (_local2 < numSides) {
baseSides[_local2].draw();
baseSides[_local2].setDepth();
_local2++;
}
}
function drawEyes() {
var _local2 = 0;
while (_local2 < numSides) {
eyes[_local2].locateRote(eyes[_local2].face);
eyes[_local2].draw(eyes[_local2].face);
if (eyes[_local2].sideFace == 1) {
eyes[_local2].form._visible = 0;
} else {
eyes[_local2].form._visible = 1;
eyes[_local2].fore(baseSides[_local2]);
}
_local2++;
}
}
var sqrt = Math.sqrt;
var sin = Math.sin;
var cos = Math.cos;
var atan2 = Math.atan2;
var PI = Math.PI;
var height = 21;
var baseHeight = 22;
var r = 36;
var eyeR = 4.4;
var numSides = 6;
var openAngle = 2.51327412287183;
var baseAngle = -0.349065850398866;
var bottomColor = "001620";
var tentColors = ["0099ee", "00aaff", "0090c0", "0090c0", "003040", "0060a0", "005090", "004080", "ffbb44", "33FFCC", "88bbff", "002630", "66ccff", "580317"];
var extraFlapOsc = 0;
}
Symbol 220 MovieClip [__Packages.TentBall] Frame 0
class TentBall extends Circle
{
var _a, _vhi, _hi, _tmax, sqrt, _t, _h, _hit;
function TentBall (p, r, colr) {
super(p, r, colr);
}
function dropInit(hi, vhi, a) {
_a = a;
_vhi = vhi;
_hi = hi;
dropStart();
}
function dropStart(t) {
var _local3 = 0.5 * _a;
var _local2 = _vhi;
var _local4 = _hi;
_tmax = ((-_local2) - sqrt((_local2 * _local2) - ((4 * _local3) * _local4))) / (2 * _local3);
if (t == undefined) {
_t = 0;
}
}
function dropFall(inc) {
_t = _t + inc;
if ((_t >= _tmax) and (!_nohit)) {
_h = 0;
_vhi = -(_vhi + (_a * _tmax));
_hi = 0;
_t = _t - _tmax;
dropStart(_t);
_hit = true;
} else {
_h = (_hi + (_vhi * _t)) + (((0.5 * _a) * _t) * _t);
_hit = false;
}
}
var _nohit = false;
}
Symbol 221 MovieClip [__Packages.BallTent] Frame 0
class BallTent extends Tent
{
var srcBallExists, eventArray, balls, ballExists, _collectFlag, _home, tentColors, sides, drawTop, pyt, atan2, flapLength, sin, openAngle, cos, baseHeight, r2, PI;
function BallTent (p, ix, iy, ballsExistArr) {
super(p, ix, iy);
srcBallExists = ballsExistArr;
eventArray = [{action:"open", wait:40, ease:"out"}, {wait:15}, {action:"juggle", wait:900}, {action:"collect", wait:null}, {action:"close", wait:40, ease:"in"}, {action:"end", wait:1}];
}
function removeBall(o) {
var _local2 = 0;
while (_local2 < 3) {
if (balls[_local2].form == o) {
ballExists[_local2] = false;
srcBallExists[_local2] = false;
balls[_local2].marked = true;
balls[_local2].form.marked = true;
balls[_local2].ballState = "dead";
balls[_local2].visible = false;
}
_local2++;
}
o.removeMovieClip();
}
function juggleInit(initObj) {
ballExists = [srcBallExists[0], srcBallExists[1], srcBallExists[2]];
_collectFlag = false;
balls = [(ballExists[0] ? (new TentBall(this, ballR, _ballColors[0])) : null), (ballExists[1] ? (new TentBall(this, ballR, _ballColors[1])) : null), (ballExists[2] ? (new TentBall(this, ballR, _ballColors[2])) : null)];
var _local2 = 0;
while (_local2 < 3) {
balls[_local2].y = balls[_local2].y + (_local2 / 100);
balls[_local2].locate();
balls[_local2].form._visible = false;
balls[_local2].age = 0;
_local2++;
}
initObj.launchTimer = 0;
return(initObj);
}
function endInit() {
_home.form._parent.onEnd();
}
function getBalls() {
var _local3 = [];
var _local2 = 0;
while (_local2 < 3) {
if (ballExists[_local2] == false) {
_local3[_local2] = false;
} else {
_local3[_local2] = balls[_local2].form;
}
_local2++;
}
return(_local3);
}
function getBallColors() {
var _local3 = [];
var _local2 = 0;
while (_local2 < 3) {
_local3[_local2] = "0x" + tentColors[_ballColors[_local2]];
_local2++;
}
return(_local3);
}
function juggle(rtnFunc, paramObj) {
var _local2 = paramObj.launchTimer;
if (_local2 == 0) {
ballInit(balls[0], sides[2], sides[5]);
}
if (_local2 == t1) {
ballInit(balls[1], sides[3], sides[0]);
}
if (_local2 == t2) {
ballInit(balls[2], sides[4], sides[1]);
}
bounceBall(balls[0]);
if (_local2 > t1) {
bounceBall(balls[1]);
}
if (_local2 > t2) {
bounceBall(balls[2]);
}
drawTop();
drawBalls();
paramObj.launchTimer++;
}
function collectInit(paramObj) {
_collectFlag = true;
paramObj.endTimer = 0;
}
function collect(rtnFunc, paramObj) {
for (var _local2 in balls) {
bounceBall(balls[_local2]);
}
drawTop();
drawBalls();
var _local3 = true;
var _local2 = 0;
while (_local2 < 3) {
if (ballExists[_local2] != false) {
_local3 = false;
}
_local2++;
}
if (_local3) {
rtnFunc();
}
}
function bounceBall(o) {
o.age++;
o.form.age = o.age;
switch (o.ballState) {
case "dead" :
break;
case "airborn" :
o.dropFall(1);
if (!o._hit) {
flapOsc(o, 1);
flapSet(o, o.aflap);
airDraw(o, o.baseAlt);
if (o.marked and (o.z < 0)) {
o.form.removeMovieClip();
for (var _local3 in balls) {
if (balls[_local3] == o) {
ballExists[_local3] = false;
}
}
return(undefined);
}
break;
}
o.ballState = "bounce";
var _local7 = o.xdist / o._tmax;
var _local6 = o._vhi;
var _local12 = pyt(_local6, _local7);
var _local13 = o.bounceAngle - atan2(_local6, _local7);
o.flapV = (sin(_local13) * _local12) / ((flapLength * 2) / 3);
o.flapA = -0.0333;
o.flapTmax = (-(2 * o.flapV)) / o.flapA;
o.flapT = o._t - 1;
case "bounce" :
o.flapT = o.flapT + 1;
if (o.flapT > o.flapTmax) {
o.xi = -o.xrad;
o.xdist = (-o.xi) + o.xrad;
if (o.marked) {
o.xdist = o.xdist * (limpFlapFactor * limpFlapFactor);
o._vhi = o._vhi * limpFlapFactor;
o._nohit = true;
}
o.dir = o.dir * -1;
o._t = 0;
var _local11 = o.flapT - o.flapTmax;
o.dropStart();
o.dropFall(_local11);
flapSwitch(o, o.dir);
airDraw(o, o.baseAlt);
o.ballState = "airborn";
o.fOsc = 0;
o.fMag = 1;
flapOsc(o, o._t);
} else {
if (_collectFlag) {
if ((o.marked != true) and (o.flapT > (o.flapTmax / 2))) {
o.marked = true;
o.form.marked = true;
var _local9 = o.flapT - (o.flapTmax / 2);
var _local5 = limpFlapFactor;
o.flapV = o.flapV * _local5;
o.flapTmax = o.flapTmax * (1 / _local5);
o.flapA = (-(2 * o.flapV)) / o.flapTmax;
o.flapT = (o.flapTmax / 2) + ((_local9 * 1) / _local5);
}
}
var _local4 = o.flapT;
var _local10 = o.flapA;
var _local8 = o.flapV;
o.aflap.angle = (o.bounceAngle + ((0.5 * _local10) * (_local4 * _local4))) + (_local8 * _local4);
flapSet(o, o.aflap);
}
}
}
function ballInit(o, side1, side2) {
o.form._visible = true;
o.y = 0;
o.xi = 0;
o.fMag = 0;
o.fOsc = 0;
o.ballState = "airborn";
o.dropInit(-33.4, 7, -0.35);
o.angle = side2.face;
o.dir = -1;
o.flapSet = new Array(side1, side2);
flapSwitch(o, o.dir);
o.bounceAngle = openAngle;
o.ext = 0.666666666666667 * flapLength;
o.baseAlt = (baseHeight - (cos(o.bounceAngle) * o.r)) + (sin(o.bounceAngle) * o.ext);
o.xrad = (((-cos(o.bounceAngle)) * o.ext) - (sin(o.bounceAngle) * o.r)) + r2;
o.xdist = o.xrad;
}
function airDraw(o, alt) {
o.x = (o.xi + (o.xdist * (o._t / o._tmax))) * o.dir;
o.z = alt + o._h;
o.locateRote(o.angle);
}
function flapSet(o, flap) {
o.x = (r2 - (o.ext * cos(flap.angle))) - (o.r * sin(flap.angle));
o.z = (baseHeight + (o.ext * sin(flap.angle))) - (o.r * cos(flap.angle));
o.locateRote((o.angle - (PI / 2)) + ((o.dir * PI) / 2));
}
function flapOsc(o, inc) {
o.fOsc = o.fOsc - (0.5 * inc);
o.fMag = ((o.fMag * 0.9) * inc) + (o.fMag * (1 - inc));
o.pFlap.angle = o.bounceAngle + (((PI / 16) * sin(o.fOsc)) * o.fMag);
}
function flapSwitch(o, num) {
o.aflap = o.flapSet[(num + 1) / 2];
o.pFlap = o.flapSet[(-(num - 1)) / 2];
}
function drawBalls() {
var _local3 = 0;
while (_local3 <= 3) {
var _local2 = balls[_local3];
_local2.draw();
switch (_local2.ballState) {
case "airborn" :
_local2.setDepth();
break;
case "bounce" :
if (_local2.aflap.sideFace == 1) {
_local2.fore(_local2.aflap.pts[2], -10);
} else {
_local2.fore(_local2.aflap.pts[2], 10);
}
}
_local3++;
}
}
var ballR = 8;
var limpFlapFactor = 0.666666666666667;
var t1 = 14;
var t2 = 28;
var _ballColors = [8, 9, 10];
}
Symbol 222 MovieClip [__Packages.util.MovieClipUtil] Frame 0
class util.MovieClipUtil
{
function MovieClipUtil () {
}
static function loadMovie(mc, url, initFunc, recursiveFlag) {
var _local2 = {};
_local2.onLoadInit = function (target_mc, httpStatus) {
trace("onLoadInit");
initFunc(target_mc, httpStatus);
};
_local2.onLoadError = function (target, code, status) {
trace("error");
};
var _local1 = new MovieClipLoader();
_local1.addListener(_local2);
_local1.loadClip(url, mc);
return(_local1);
}
static function newDepth() {
return(dpthMeter++);
}
static function newClip(mc, paramsObj) {
var _local1 = dpthMeter++;
return(mc.createEmptyMovieClip("mc" + _local1, _local1, paramsObj));
}
static function attachClip(host_mc, linkageName, params) {
var _local1 = dpthMeter++;
return(host_mc.attachMovie(linkageName, "mc" + _local1, _local1, params));
}
static function drawRect(mc, x1, y1, x2, y2, colr) {
mc.beginFill(colr);
mc.moveTo(x1, y1);
mc.lineTo(x1, y2);
mc.lineTo(x2, y2);
mc.lineTo(x2, y1);
mc.lineTo(x1, y1);
mc.endFill();
}
static var dpthMeter = 0;
}
Symbol 223 MovieClip [__Packages.SwfPart] Frame 0
class SwfPart extends Part
{
var form;
function SwfPart (p) {
super(p);
}
function loadSwf(imgPath, scalar) {
var o = this;
var _local2 = function () {
o.isLoaded = true;
};
util.MovieClipUtil.loadMovie(form, imgPath, _local2);
}
function draw(scalar) {
super.simpleDraw();
form._xscale = form._xscale * scalar;
form._yscale = form._yscale * scalar;
}
var isLoaded = false;
}
Symbol 224 MovieClip [__Packages.FireTent] Frame 0
class FireTent extends Tent
{
var flame;
function FireTent (p, ix, iy) {
super(p, ix, iy);
}
function fireInit(paramObj) {
if (flame != undefined) {
flame.form.removeMovieClip(flame.form);
}
flame = new SwfPart(this);
flame.loadSwf("fire.swf");
flame.locate();
flame.setDepth();
flame.draw(paramObj.scale);
}
function fire(frac) {
if (frac == 1) {
flame.form._root.openFlame = false;
}
}
var eventArray = [{wait:60}, {action:"open", wait:30, ease:"out"}, {action:"fire", wait:180, params:{scale:11}}, {action:"close", wait:30, ease:"in"}];
}
Symbol 225 MovieClip [__Packages.NestedBall] Frame 0
class NestedBall extends Circle
{
var x, y, z, register, _completionCallBack, form, locate, setDepth, draw, eventStack;
function NestedBall (p, r, colr, ix, iy, iz, completionCallBack) {
super(p, r, colr);
x = ix;
y = iy;
z = iz;
register("NestedBall", p, 1);
_completionCallBack = completionCallBack;
begin();
}
function clickEventsInit() {
var o = this;
form.onPress = function () {
EventStack.setPause(false, "ball");
o._completionCallBack(this);
removeMovieClip(this);
};
}
function riseInit(paramObj) {
paramObj.iZ = z;
return(paramObj);
}
function rise(frac, paramObj) {
z = (paramObj.iZ * (1 - frac)) + (paramObj.z * frac);
locate();
setDepth();
draw();
}
function begin() {
for (var _local2 in eventArray) {
eventArray[_local2].target = this;
}
eventStack = new EventStack(eventArray);
eventStack.begin();
}
function pause(frac, paramObj) {
EventStack.setPause(true, paramObj.key);
}
var eventArray = [{wait:0}, {action:"rise", wait:40, ease:"scurve", params:{z:30}}, {action:"clickEvents", wait:0}, {action:"pause", wait:0, params:{key:"ball"}}];
}
Symbol 226 MovieClip [__Packages.NestingTent] Frame 0
class NestingTent extends FireTent
{
var _completionCallBack, PI, eventArray, baseHeight, riseInit, spinInit, z, setBaseAngle, setLights, update, ball, child, baseAngle, y, _scl;
function NestingTent (p, ix, iy, completionCallBack) {
super(p, ix, iy);
_completionCallBack = completionCallBack;
}
function init(scl) {
var _local13 = ((generation % 2) - 0.5) * 2;
var _local3 = (PI + (PI / 6)) - (((PI / 12) * generation) / maxGeneration);
var _local4 = 0.523598775598299;
if (generation == 0) {
eventArray = [{action:"birth", wait:10}, {action:"open", wait:40, ease:"out", params:{openAngle:_local3}}];
} else if (generation == maxGeneration) {
eventArray = [{wait:5}, {action:"riseAndSpin", wait:40, ease:"scurve", params:{z:baseHeight * Math.pow(0.7, generation), addAngle:-_local4}}, {action:"pause", wait:0, params:{key:"root"}}, {action:"createBall", wait:0}, {action:"open", wait:40, ease:"out", params:{openAngle:_local3}}];
} else {
eventArray = [{wait:5}, {action:"riseAndSpin", wait:40, ease:"scurve", params:{z:baseHeight * Math.pow(0.7, generation), addAngle:-_local4}}, {action:"pause", wait:0, params:{key:"root"}}, {action:"birth", wait:10}, {action:"open", wait:40, ease:"out", params:{openAngle:_local3}}];
}
super.init(scl);
eventArray[1].params.z = baseHeight * 2;
}
function riseAndSpinInit(params) {
params = riseInit(params);
params = spinInit(params);
return(params);
}
function riseAndSpin(frac, params) {
z = (params.iZ * (1 - frac)) + (params.z * frac);
var _local4 = (params.iAngle * (1 - frac)) + ((params.iAngle + params.addAngle) * frac);
setBaseAngle(_local4);
setLights(frac);
update();
}
function createBallInit() {
ball = new NestedBall(this, 8, 13, 0, 0, 4, _completionCallBack);
new Color(ball.form).setRGB(3407871);
}
function birthInit() {
child = new NestingTent(this, 0, 0, _completionCallBack);
child.baseAngle = baseAngle + 0.01;
child.generation = generation + 1;
child.z = 0;
child.y = y + 0.01;
child.init(_scl * 0.7);
child.drawTop(true);
child.begin();
}
function birth() {
update();
}
function destroy() {
update();
}
function destroyInit() {
child.form.removeMovieClip();
}
var bottomColor = "001513";
var tentColors = ["66aa99", "00782c", "00a84b", "0090c0", "00210b", "003319", "004323", "004080", "ffbb44", "aaff88", "88bbff", "001513", "88ffdb", "580317"];
var generation = 0;
var openAngle = 3.53429173528852;
var maxGeneration = 2;
}
Symbol 227 MovieClip [__Packages.TreeTent] Frame 0
class TreeTent extends Tent
{
var planType, eventArray, tree;
function TreeTent (p, ix, iy, type) {
super(p, ix, iy);
planType = type;
eventArray = [{action:"open", wait:30, ease:"out"}, {action:"growTree", wait:100}, {action:"pause", params:{key:"tree"}, wait:0}, {action:"close", wait:30, ease:"in"}];
}
function growTreeInit() {
tree = new SwfPart(this);
tree.loadSwf("resources/tree.swf");
tree.locate();
tree.setDepth();
tree.draw(7);
}
function growTree(frac) {
if (((frac > 0) and (!beginFlag)) and tree.isLoaded) {
beginFlag = true;
tree.form.start(planType);
}
}
var beginFlag = false;
}
Symbol 228 MovieClip [__Packages.TentFilm] Frame 0
class TentFilm extends MovieClip
{
var contentData, tentType, completionCallBack, bg, shadowColor, waitingClick, form, _lockroot, fader, tent;
function TentFilm () {
super();
}
function setContentData(dataObj) {
contentData = dataObj.configData;
tentType = dataObj.configName;
completionCallBack = dataObj.onComplete;
new Color(bg).setRGB(dataObj.bgColor);
shadowColor = dataObj.shadowColor;
}
function begin() {
waitingClick = false;
EventStack.resetStack();
EventStack.rootForm = this;
var _local4 = {px:0, py:500, pz:-200, perspex:500, offset:-580};
var _local3 = {ox:120, oy:450, scale:14, level:1};
form = this;
_lockroot = true;
var _local2 = new Cell(this, _local3, _local4, shadowColor);
fader.swapDepths(999);
var _local5 = 0;
var _local15;
var o = this;
bg.onPress = function () {
if (!o.isRunning) {
o.isRunning = true;
o.tent.begin();
} else if (EventStack.isPaused) {
EventStack.setPause(false, "root");
o.waitingClick = false;
} else {
o.waitingClick = true;
}
};
bg.onRollOver = function () {
o.isRolledOver = true;
o.setLights(true);
};
bg.onRollOut = function () {
o.isRolledOver = false;
if (!o.isRunning) {
o.setLights(false);
}
};
bg.onDragOut = function () {
o.isRolledOver = false;
if (!o.isRunning) {
o.setLights(false);
}
};
if (tentType == "tentBalls") {
tent = new BallTent(_local2, 0, 0, contentData);
} else if (tentType == "tentNested") {
tent = new NestingTent(_local2, 0, 0, completionCallBack);
} else if (tentType == "tentTree") {
tent = new TreeTent(_local2, 0, 0, "foot");
}
tent.init(1);
}
function onEnd() {
isRunning = false;
if (!isRolledOver) {
setLights(false);
}
}
function onFaderEnd() {
onEnterFrame = undefined;
}
function removeBall(o) {
tent.removeBall(o);
}
function setLights(boo) {
lightMeterDest = (boo ? 10 : 0);
}
function onEnterFrame() {
if (waitingClick && (tentType == "tentNested")) {
bg.onPress();
}
adjustLights();
}
function adjustLights() {
var _local2 = lightMeter;
if (lightMeter < lightMeterDest) {
lightMeter = lightMeter + 1;
}
if (lightMeter > lightMeterDest) {
lightMeter = lightMeter - 1;
}
if (lightMeter != _local2) {
tent.setLights(lightMeter / 10);
}
}
function getBalls() {
return(tent.getBalls());
}
function getBallColors() {
return(tent.getBallColors());
}
function getData() {
return(tent.srcBallExists);
}
var isRunning = false;
var isRolledOver = false;
var lightMeter = 0;
var lightMeterDest = 0;
}
Symbol 757 MovieClip [__Packages.BirdGrouper] Frame 0
class BirdGrouper extends MovieClip
{
var birdMarkers, points, twistors, map, attachMovie, _visible, completionCallBack, birds;
function BirdGrouper () {
super();
birdMarkers = [];
points = [];
twistors = [];
map = attachMovie("shapeMap", "shapeMap", dpth++);
map._visible = false;
new DelayedEvent(this, 1, "groupPoints");
_visible = false;
}
function doIntro(callBack) {
_visible = true;
fadeIn(callBack);
}
function activate(callBack) {
completionCallBack = callBack;
var _local3 = birds.length;
var _local2 = 0;
while (_local2 < _local3) {
birds[_local2].activate();
_local2++;
}
_local2 = 0;
while (_local2 < _local3) {
birds[_local2].determineNeighbors();
_local2++;
}
}
function onFlyAway(obj) {
var _local3 = birds.length;
var _local2 = 0;
while (_local2 < _local3) {
if (birds[_local2].isFlying == false) {
if (birds[_local2].countOpenSides() == 4) {
birds[_local2].onRollOver();
}
}
_local2++;
}
}
function fadeIn(callBack) {
fadeCounter++;
var _local3 = birdMarkers.length;
var _local2 = 0;
while (_local2 < _local3) {
birds[_local2].setFade(fadeCounter / 9);
_local2++;
}
if (fadeCounter < 9) {
new DelayedEvent(this, 1, "fadeIn", [callBack]);
} else {
callBack();
}
}
function onMouseDown() {
}
function addBird(obj) {
birdMarkers.push(obj);
}
function addPoint(obj) {
points.push(obj);
}
function addTwistor(obj) {
twistors.push(obj);
}
function returnNearest(centerObj, numToFind, srcArr) {
var _local6 = [];
var _local10 = srcArr.length;
var _local2 = 0;
while (_local2 < _local10) {
var _local5 = srcArr[_local2];
var _local4 = _local5._x - centerObj._x;
var _local3 = _local5._y - centerObj._y;
var _local8 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
_local6.push({point:_local5, d:_local8});
_local2++;
}
_local6.sortOn("d", Array.NUMERIC);
_local6.length = numToFind;
var _local1 = 0;
while (_local1 < numToFind) {
var _local5 = _local6[_local1].point;
_local5.addMember(centerObj);
_local6[_local1] = _local5;
_local1++;
}
return(_local6);
}
function groupPoints() {
birds = [];
var _local5 = birdMarkers.length;
var _local3 = 0;
while (_local3 < _local5) {
var _local4 = birdMarkers[_local3];
var _local2 = attachMovie("birdShape", "birdShape" + _local3, dpth++);
_local2._x = _local4._x;
_local2._y = _local4._y;
_local2.setPointArray(returnNearest(_local2, 4, points), returnNearest(_local2, 4, twistors));
birds.push(_local2);
_local3++;
}
map.removeMovieClip();
}
function removeBird(obj) {
var _local3 = birds.length;
var _local2 = 0;
while (_local2 < _local3) {
if (birds[_local2] == obj) {
birds.splice(_local2, 1);
}
_local2++;
}
obj.removeMovieClip();
if (_local3 == 1) {
completionCallBack();
}
}
var dpth = 0;
var fadeCounter = 0;
}
Symbol 758 MovieClip [__Packages.BirdPointMarker] Frame 0
class BirdPointMarker extends MovieClip
{
var members, _parent, myId;
function BirdPointMarker () {
super();
members = [];
_parent._parent.addPoint(this);
myId = id++;
}
function addMember(obj) {
members.push(obj);
}
var type = "point";
static var id = 0;
}
Symbol 759 MovieClip [__Packages.BirdPlaceHolder] Frame 0
class BirdPlaceHolder extends MovieClip
{
var _parent;
function BirdPlaceHolder () {
super();
_parent._parent.addBird(this);
}
}
Symbol 760 MovieClip [__Packages.BirdTwistor] Frame 0
class BirdTwistor extends MovieClip
{
var _parent;
function BirdTwistor () {
super();
_parent._parent.addTwistor(this);
}
var type = "twistor";
}
Symbol 761 MovieClip [__Packages.BirdShape] Frame 0
class BirdShape extends MovieClip
{
var myTilt, colorTrans, marker, isActive, shapeAlpha, lineAlpha, initialPointState, swapDepths, flapCounter, transformCounter, flightCounter, flightDir, srcPtArr, idealPointState, dirVariance, _parent, _x, _y, getBounds, neighbors, mySides, sinTilt, cosTilt, clear, lineStyle, beginFill, endFill, moveTo, lineTo, curveTo;
function BirdShape () {
super();
myColor = colorArr[colorIndex];
colorIndex++;
if (colorIndex == colorArr.length) {
colorIndex = 0;
}
myTilt = 0;
colorTrans = new flash.geom.Transform(this);
marker._visible = false;
isActive = false;
setColorTransform(0);
}
function onRollOver() {
if (isActive) {
flyAway();
}
}
function activate() {
isActive = true;
}
function setFade(frac) {
shapeAlpha = 100 * Math.sqrt(frac);
lineAlpha = ((100 * frac) * frac) * frac;
drawPointState(initialPointState, 0, 0);
}
function flyAway() {
if (isRolledOver) {
return(undefined);
}
maxBirdDepth--;
swapDepths(maxBirdDepth);
var _local2 = getFlightDirInfo();
if (_local2 == false) {
return(undefined);
}
isRolledOver = true;
isFlying = true;
flapCounter = 0;
transformCounter = 0;
flightCounter = 0;
flightDir = _local2[1];
initialPointState = determineInitialPointState(srcPtArr, _local2[0]);
idealPointState = getIdealPointState(initialPointState);
dirVariance = (-0.785398163397448 * random(100)) / 100;
_parent.onFlyAway(this);
}
function onEnterFrame() {
dirOscCounter++;
var _local5 = Math.sin(dirOscCounter / 30);
if (isFlying && (isActive)) {
if (transformCounter < transformCounterMax) {
transformCounter++;
}
var _local3;
if (transformCounter > (transformCounterMax / 3)) {
if (flightCounter < 40) {
flightCounter++;
}
var _local7 = Curves.scurve(flightCounter / 40);
_local3 = blendAngles(flightDir + (dirVariance * _local5), dirVariance * _local5, _local7);
} else {
_local3 = flightDir + (dirVariance * _local5);
}
idealPointState.axisAngle = _local3;
var _local4 = Curves.scurve(transformCounter / transformCounterMax);
var _local8 = doTransform(initialPointState, idealPointState, Curves.scurve(transformCounter / transformCounterMax));
flapCounter++;
var _local6 = (flapCounter / 10) * Math.PI;
var _local9 = Math.sin(_local6);
var _local11 = (Math.PI/4);
myTilt = _local4 * _local11;
drawPointState(_local8, (_local9 * Math.PI) / 4, myTilt);
setColorTransform(_local4);
v = _local4 * vMax;
var _local10 = (-Math.cos(_local6 - 0.392699081698724)) * 2;
_x = _x + (Math.cos(_local3) * v);
_y = _y + (((Math.sin(_local3) * v) * Math.cos(myTilt)) + _local10);
if (getBounds(_parent).xMin > _root.xMax) {
isActive = false;
_parent.removeBird(this);
}
}
}
function determineNeighbors() {
var _local6 = {};
neighbors = [];
var _local5 = 0;
while (_local5 < 4) {
var _local7 = srcPtArr[_local5 * 4];
var _local4 = _local7.members;
var _local3 = 0;
while (_local3 < _local4.length) {
var _local2 = _local4[_local3];
if (_local2 != this) {
if (_local6[_local2] == undefined) {
_local6[_local2] = 0;
} else {
neighbors.push(_local2);
}
}
_local3++;
}
_local5++;
}
}
function getOpenSides() {
var _local5 = [true, true, true, true];
var _local6 = neighbors.length;
var _local4 = 0;
while (_local4 < _local6) {
var _local3 = neighbors[_local4];
if ((_local3.isFlying == false) && (_local3.isActive)) {
var _local2 = 0;
while (_local2 < 4) {
if (_local3.shareSide(mySides[_local2])) {
_local5[_local2] = false;
}
_local2++;
}
}
_local4++;
}
return(_local5);
}
function countOpenSides() {
var _local4 = getOpenSides();
var _local3 = 0;
var _local2 = 0;
while (_local2 < 4) {
if (_local4[_local2]) {
_local3++;
}
_local2++;
}
return(_local3);
}
function getFlightDirInfo() {
var _local5 = getOpenSides();
var _local3 = [];
var _local2 = 0;
while (_local2 < 4) {
if (_local5[_local2]) {
_local3.push(_local2);
}
_local2++;
}
var _local9 = function (num) {
while (num > 3) {
num = num - 4;
}
return(num);
};
var _local6;
var _local14;
var _local4;
if (_local3.length == 4) {
_local6 = 0;
_local4 = [0, 1];
} else if (_local3.length == 1) {
_local6 = _local3[0];
_local4 = [_local3[0], _local9(_local3[0] + 1)];
} else if (_local3.length > 0) {
if ((_local3.length == 2) && (Math.abs(_local3[1] - _local3[0]) == 2)) {
_local6 = _local3[0];
_local4 = [_local3[0], _local9(_local3[0] + 1)];
} else {
var _local7 = returnConsecutiveArr(_local3);
if (_local3.length == 2) {
_local6 = _local7[1];
_local4 = [_local7[1], _local9(_local7[1])];
} else if (_local3.length == 3) {
_local6 = _local7[1];
_local4 = [_local7[1], _local9(_local7[1] + 1)];
}
}
} else {
return(false);
}
var _local8 = [srcPtArr[_local4[0] * 4], srcPtArr[_local4[1] * 4]];
var _local10 = {x:(_local8[0].x + _local8[1].x) / 2, y:(_local8[0].y + _local8[1].y) / 2};
var _local11 = Math.atan2(_local10.y, _local10.x);
return([_local6, _local11]);
}
function returnConsecutiveArr(indexArr) {
var _local2 = indexArr.length - 1;
while (((indexArr[0] - indexArr[_local2]) == 1) || ((indexArr[0] - indexArr[_local2]) == -3)) {
var _local3 = indexArr.splice(_local2, 1)[0];
indexArr.splice(0, 0, _local3);
}
return(indexArr);
}
function setColorTransform(fac) {
var _local3 = new flash.geom.ColorTransform(fac, fac, fac, 1, 0, 53 * (1 - fac), 83 * (1 - fac), 0);
colorTrans.colorTransform = _local3;
}
function doTransform(ptState1, ptState2, frac) {
var _local11 = [];
var _local13 = ptState1.wings;
var _local12 = ptState2.wings;
var _local6 = 0;
while (_local6 < 2) {
var _local10 = (_local11[_local6] = []);
var _local8 = _local13[_local6];
var _local9 = _local12[_local6];
var _local2 = 0;
while (_local2 < 8) {
var _local5 = _local8[_local2];
var _local4 = _local9[_local2];
var _local3 = {};
_local3.dx = blendNums(_local5.dx, _local4.dx, frac);
_local3.dy = blendNums(_local5.dy, _local4.dy, frac);
_local10[_local2] = _local3;
_local2++;
}
_local6++;
}
return({center:ptState1.center, axisAngle:blendAngles(ptState1.axisAngle, ptState2.axisAngle, frac), axisLength:blendNums(ptState1.axisLength, ptState2.axisLength, frac), wings:_local11});
}
function blendAngles(ang1, ang2, frac) {
var _local2 = getAngleDiff(ang2, ang1);
return(ang1 + (_local2 * frac));
}
function blendNums(num1, num2, frac) {
return((num1 * (1 - frac)) + (num2 * frac));
}
function drawPointState(ptState, flapAng, tilt) {
var _local2 = convertToCartesian(ptState, flapAng);
drawMe(_local2, tilt);
}
function setPointArray(pointArr, twistorArr) {
var _local2 = [];
var _local14 = new Array().concat(pointArr, twistorArr);
var _local15 = _local14.length;
var _local4 = 0;
while (_local4 < _local15) {
var _local3 = _local14[_local4];
_local2[_local4] = {x:_local3._x - _x, y:_local3._y - _y, members:_local3.members, id:_local3.myId};
_local2[_local4].angle = Math.atan2(_local2[_local4].y, _local2[_local4].x);
if (_local3.type == "twistor") {
_local2[_local4].type = "twistor";
_local2[_local4].twistR = (_local3._yscale / 100) * 25;
_local2[_local4].twistAngle = ((_local3._rotation / 180) * Math.PI) + (Math.PI/2);
}
_local4++;
}
_local2.sortOn("angle", Array.NUMERIC);
if (_local2[0].type == "twistor") {
_local2.push(_local2.splice(0, 1)[0]);
}
_local15 = _local2.length;
_local4 = 0;
while (_local4 < _local15) {
if (_local2[_local4].type == "twistor") {
var _local9 = ((_local4 < (_local15 - 1)) ? (_local2[_local4 + 1]) : (_local2[0]));
var _local6 = ((_local4 != 0) ? (_local2[_local4 - 1]) : (_local2[_local15 - 1]));
var _local8 = new Between(_local6, _local9).getAngle();
var _local7 = getAngleDiff(_local8, _local2[_local4].twistAngle);
if (Math.cos(_local7) > 0) {
_local2[_local4].twistAngle = _local2[_local4].twistAngle + Math.PI;
}
}
_local4++;
}
_local15 = _local2.length;
_local4 = _local15 - 1;
while (_local4 >= 0) {
if (_local2[_local4].type == "twistor") {
var _local5 = getTwistorCurvePoints(_local2[_local4]);
_local2.splice(_local4, 1, _local5[0], _local2[_local4], _local5[1]);
}
_local4--;
}
initialPointState = determineInitialPointState(_local2, 0);
drawPointState(initialPointState, 0, 0);
srcPtArr = _local2;
mySides = getSideIds();
}
function shareSide(sideId) {
var _local2 = 0;
while (_local2 < 4) {
if (mySides[_local2] == sideId) {
return(true);
}
_local2++;
}
return(false);
}
function getSideIds() {
var _local7 = [];
var _local2 = 0;
while (_local2 < 4) {
var _local3 = _local2 + 1;
if (_local3 == 4) {
_local3 = 0;
}
var _local5 = srcPtArr[_local2 * 4];
var _local6 = srcPtArr[_local3 * 4];
var _local4 = [_local5.id, _local6.id];
_local4.sort();
_local7[_local2] = _local4.toString();
_local2++;
}
return(_local7);
}
function getIdealPointState(initPtState) {
var _local13 = initPtState.axis;
var _local9 = initPtState.birdLength;
var _local1 = _local9 / 2;
var _local7 = [];
var _local3 = 0;
while (_local3 < 2) {
var _local2 = (_local3 - 0.5) * 2;
var _local4 = [{dx:(-_local1) * 0.75, dy:((-_local1) / 8) * _local2}, {dx:(-_local1) * 0.55, dy:(((-_local1) * 2) / 8) * _local2}, {dx:(-_local1) * 0.35, dy:((-3 * _local1) / 8) * _local2}, {dx:(-_local1) * 0.25, dy:(-_local1) * _local2}, {dx:_local1 * 0.25, dy:(((-_local1) * 7) / 8) * _local2}, {dx:_local1 * 0.5, dy:((-_local1) / 2) * _local2}, {dx:_local1 * 0.75, dy:((-_local1) / 8) * _local2}];
if (_local2 == -1) {
_local4.reverse();
}
_local7[_local3] = _local4;
_local3++;
}
return({center:initPtState.center, axisAngle:initPtState.axisAngle, axisLength:initPtState.birdLength, wings:_local7});
}
function determineInitialPointState(ptArr, dir) {
function wrapNum(num) {
if (num >= 16) {
num = num - 16;
} else if (num < 0) {
num = num + 16;
}
return(num);
}
var _local14 = dir * 4;
var _local26 = wrapNum(_local14 + 8);
var _local23 = wrapNum(_local14 + 4);
var _local24 = wrapNum(_local14 + 12);
var _local20 = [_local23, _local24];
var _local21 = [ptArr[_local14], ptArr[_local26]];
var _local25 = new Between(_local21[1], _local21[0]);
var _local22 = _local25.getDistance();
var _local33 = _local25.getAngle();
var _local16 = {x:(_local21[0].x + _local21[1].x) / 2, y:(_local21[0].y + _local21[1].y) / 2};
var _local27 = new Between(ptArr[_local23], ptArr[_local24]).getDistance();
var _local19 = [];
var _local4 = 0;
while (_local4 < 2) {
var _local9 = [];
var _local12 = _local20[_local4];
var _local18 = wrapNum(_local12 + 1);
var _local17 = wrapNum(_local12 - 1);
var _local7 = [];
var _local1 = 0;
while (_local1 < 8) {
_local7.push(ptArr[wrapNum(((_local14 + (_local4 * 8)) + _local1) + 1)]);
_local1++;
}
_local1 = 0;
while (_local1 < 7) {
var _local5 = _local7[_local1];
var _local6 = new Between(_local16, _local5);
var _local2 = _local6.getDistance();
var _local3 = _local6.getAngle() - _local33;
var _local11 = Math.cos(_local3) * _local2;
var _local10 = Math.sin(_local3) * _local2;
var _local8 = {dx:_local11, dy:_local10, type:_local5.type};
_local9[_local1] = _local8;
_local1++;
}
_local19[_local4] = _local9;
_local4++;
}
return({center:_local16, axisAngle:_local33, axisLength:_local22, wings:_local19, birdLength:(_local27 / 2) + (_local22 / 2)});
}
function convertToCartesian(srcPoints, flapAng) {
var _local18 = srcPoints.axisLength / 2;
var _local4 = srcPoints.axisAngle;
var _local16 = srcPoints.center;
var _local14 = _local16.x;
var _local13 = _local16.y;
var _local12 = [];
var _local3 = 0;
while (_local3 < 2) {
_local12[_local3] = [];
var _local10 = (flapAng * (_local3 - 0.5)) * 2;
var _local9 = srcPoints.wings[_local3];
var _local1 = 0;
while (_local1 < 7) {
var _local7 = _local10;
var _local2 = _local9[_local1];
var _local6 = _local2.dx;
var _local5 = _local2.dy * Math.cos(_local7);
var _local8 = {x:(_local14 + (_local6 * Math.cos(-_local4))) + (_local5 * Math.sin(-_local4)), y:(_local13 + (_local5 * Math.cos(-_local4))) - (_local6 * Math.sin(-_local4)), z:_local2.dy * Math.sin(_local7), type:_local2.type};
_local12[_local3][_local1] = _local8;
_local1++;
}
_local3++;
}
return({axis:[{x:_local16.x + (_local18 * Math.cos(_local4)), y:_local16.y + (_local18 * Math.sin(_local4)), z:0}, {x:_local16.x - (_local18 * Math.cos(_local4)), y:_local16.y - (_local18 * Math.sin(_local4)), z:0}], wings:_local12});
}
function getNum() {
return((random(90) + 10).toString());
}
function drawMe(ptState, tilt) {
sinTilt = Math.sin(tilt);
cosTilt = Math.cos(tilt);
var _local4 = ptState.axis;
var _local2 = ptState.wings;
clear();
doMove(_local4[0], tilt);
lineStyle(0.5, myColor, lineAlpha);
beginFill(myColor, shapeAlpha);
drawCurve(_local2[0][0], _local2[0][1], tilt, 1);
drawCurve(_local2[0][2], _local2[0][3], tilt, 1);
drawCurve(_local2[0][4], _local2[0][5], tilt, 1);
drawCurve(_local2[0][6], _local4[1], tilt, 1);
drawLine(_local4[0], tilt);
endFill();
beginFill(myColor, shapeAlpha);
lineStyle(0.5, myColor, lineAlpha);
_local2[1].reverse();
drawCurve(_local2[1][0], _local2[1][1], tilt, 1);
drawCurve(_local2[1][2], _local2[1][3], tilt, 1);
drawCurve(_local2[1][4], _local2[1][5], tilt, 1);
drawCurve(_local2[1][6], _local4[1], tilt, 1);
drawLine(_local4[0], tilt);
endFill();
}
function convertPoint(pt, tilt) {
return({x:pt.x, y:(pt.y * cosTilt) - (pt.z * sinTilt)});
}
function doMove(pt, tilt) {
pt = convertPoint(pt, tilt);
moveTo(pt.x, pt.y);
}
function drawLine(pt, tilt) {
pt = convertPoint(pt, tilt);
lineTo(pt.x, pt.y);
}
function drawCurve(cvPt, pt, tilt, dir) {
cvPt = convertPoint(cvPt, tilt);
pt = convertPoint(pt, tilt);
curveTo(cvPt.x, cvPt.y, pt.x, pt.y);
}
function getTwistorCurvePoints(twistor) {
var _local1 = twistor.twistR;
var _local6 = twistor.twistAngle;
var _local4 = twistor.x;
var _local2 = twistor.y;
var _local5 = Math.cos(_local6);
var _local3 = Math.sin(_local6);
return([{type:"curve", x:(_local1 * _local5) + _local4, y:(_local1 * _local3) + _local2}, {type:"curve", x:((-_local1) * _local5) + _local4, y:((-_local1) * _local3) + _local2}]);
}
function getAngleDiff(ang1, ang2) {
while ((ang1 - ang2) > Math.PI) {
ang1 = ang1 - (Math.PI*2);
}
while ((ang2 - ang1) > Math.PI) {
ang1 = ang1 + (Math.PI*2);
}
return(ang1 - ang2);
}
static var maxBirdDepth = 1000;
static var colorIndex = 0;
var colorArr = [3368550, 26163, 3355392, 6697728, 13421721, 16737843, 13158, 16777215];
var myColor = 13651;
var isRolledOver = false;
var isFlying = false;
var transformCounterMax = 20;
var v = 0;
var vMax = 8;
var dirOscCounter = 0;
}
Symbol 800 MovieClip [__Packages.NavEngine] Frame 0
class NavEngine
{
var x, y, _v, face, _turnRate, parentObj, _pushMotion;
function NavEngine (p, ix, iy, f, tr, v, pm) {
x = ix;
y = iy;
_v = v;
face = f;
_turnRate = tr;
parentObj = p;
_pushMotion = pm;
}
function limitRange(num) {
while (num > pi) {
num = num - (pi * 2);
}
while (num < (-pi)) {
num = num + (pi * 2);
}
return(num);
}
function getSwitch(num) {
if (num > 0) {
return(1);
}
if (num < 0) {
return(-1);
}
if (num == 0) {
return(0);
}
}
function getTargetDir(pt) {
var _local3 = atan2(pt.y - y, pt.x - x);
var _local2 = limitRange(_local3 - face);
return(_local2);
}
function distanceFrom(obj) {
var _local3 = obj.x - x;
var _local2 = obj.y - y;
var _local4 = (sqrt((_local3 * _local3) + (_local2 * _local2)) - obj.r) - r;
return(_local4);
}
function get pushMotion() {
return(_pushMotion);
}
function get turn() {
return(_turnRate);
}
function set turn(num) {
_turnRate = num;
//return(turn);
}
function get v() {
return(_v);
}
function set v(num) {
_v = num;
//return(v);
}
function get vmax() {
return(_vmax);
}
function getGravity(waterY) {
var _local2 = 0.5;
var _local3 = ((waterY - y) / 20) * _local2;
if (_local3 > _local2) {
_local3 = _local2;
}
return(_local3);
}
var _vmax = 2.2;
var _turnA = 0.02;
var _a = 10;
var _turnBrake = 0.7;
var cos = Math.cos;
var sin = Math.sin;
var atan2 = Math.atan2;
var sqrt = Math.sqrt;
var pi = Math.PI;
var _brake = 0;
var _brakeRate = 0.005;
var r = 10;
}
Symbol 801 MovieClip [__Packages.CrowdEngine] Frame 0
class CrowdEngine extends NavEngine
{
var _ticker, _targetPoint, _checkSet, _avoidClip, y, _avoidSwitch, _brake, getSwitch, getTargetDir, _turnA, _turnBrake, _dAvoidTotal, face, _v, _a, _brakeRate, _vmax, _pushMotion, x, cos, sin, getGravity, _members, atan2, limitRange, pi, _dCongruency, sqrt, _avoidTargets, _dAvoids, distanceFrom;
function CrowdEngine (p, ix, iy, f, tr, v, pm, checkSet) {
super(p, ix, iy, f, tr, v, pm);
_ticker = 0;
_targetPoint = {x:210, y:170};
_checkSet = checkSet;
_avoidClip = p.MC.createEmptyMovieClip("av", 10);
}
function run(waterY) {
_targetPoint = {x:210, y:waterY + 170};
var _local3 = inWater;
inWater = y > waterY;
var _local4 = _turnRate;
if (inWater) {
_ticker = _ticker + 1;
if (_ticker == _checkFreq) {
_ticker = 0;
}
if (_ticker == _checkSet) {
_avoidSwitch = ScanForAvoid();
}
_brake = 0;
if (!_avoidSwitch) {
_bank = getSwitch(getTargetDir(_targetPoint));
_turnRate = _turnRate + (_turnA * _bank);
_turnRate = _turnRate * _turnBrake;
} else {
Avoid();
_turnRate = _turnRate + ((_turnA * _bank) * (1 + (_turnBoost * _dAvoidTotal)));
_turnRate = _turnRate * _turnBrake;
}
_turnRate = (_turnRate + _local4) / 2;
face = face + _turnRate;
if (_brakeFlag) {
if (_brake == 0) {
_v = _v + (_brakeRate * _a);
if (_v > _vmax) {
if ((_v - _vmax) > 0.4) {
_v = _v - 0.4;
} else {
_v = _vmax;
}
}
} else {
_v = _v - _brake;
if (_v < 0.4) {
_v = 0.4;
}
}
} else if (_v > _vmax) {
if ((_v - _vmax) > 0.4) {
_v = _v - 0.4;
} else {
_v = _vmax;
}
} else {
_v = _vmax;
}
_pushMotion.x = _pushMotion.x * 0.9;
_pushMotion.y = _pushMotion.y * 0.9;
x = x + (((_v * cos(face)) * cos(_turnRate)) + _pushMotion.x);
y = y + (((_v * sin(face)) * cos(_turnRate)) + _pushMotion.y);
_bank = 0;
} else {
if (_local3) {
_pushMotion.x = _pushMotion.x + (_v * Math.cos(face));
_pushMotion.y = _pushMotion.y + (_v * Math.sin(face));
_v = 0;
}
_pushMotion.y = _pushMotion.y + getGravity(waterY);
face = face + _turnRate;
x = x + _pushMotion.x;
y = y + _pushMotion.y;
}
}
function setMembers(members) {
_members = members;
}
function inRange(obj) {
if ((obj.x - x) > _dangerD) {
return(false);
}
if ((obj.y - y) > _dangerD) {
return(false);
}
return(true);
}
function dangerFactor(obj) {
var _local2 = 1;
var _local9 = face;
var _local11 = obj.face;
var _local5 = obj.x - x;
var _local4 = obj.y - y;
var _local7 = atan2(_local4, _local5);
var _local6 = limitRange(_local9 - _local7);
var _local8 = limitRange(_local11 + _local7);
_local2 = _local2 * (0.5 + ((0.5 * Math.abs(_local6)) / (pi / 2)));
_local2 = _local2 * (0.5 + ((0.5 * Math.abs(_local8)) / (pi / 2)));
var _local3 = Math.abs(limitRange(_local6 + _local8)) / (pi / 2);
_dCongruency = _local3;
if (_local3 > 2) {
return(_local3);
}
if (_local3 > 1) {
_local3 = 1;
}
_local2 = _local2 * (0.5 + (0.5 * _local3));
var _local12 = (sqrt((_local5 * _local5) + (_local4 * _local4)) - 20) / (_dangerD - 20);
_local2 = _local2 * (0.1 + (0.9 * _local12));
if (_local2 > 1) {
_local2 = 1;
}
return(_local2);
}
function ScanForAvoid() {
var _local5 = false;
_avoidTargets = [];
_dAvoids = [];
var _local2 = 0;
while (_local2 < _members.length) {
if ((_members[_local2] != this) and inRange(_members[_local2])) {
var _local4 = distanceFrom(_members[_local2]);
if (_local4 < _dangerD) {
var _local3 = dangerFactor(_members[_local2]);
if (_local3 < 1) {
_avoidTargets.push(_members[_local2]);
_dAvoids.push(_local3);
_local5 = true;
}
}
}
_local2++;
}
return(_local5);
}
function Avoid() {
_dAvoidTotal = 0;
var _local2 = 0;
while (_local2 < _avoidTargets.length) {
var _local4 = atan2(_avoidTargets[_local2].y - y, _avoidTargets[_local2].x - x);
var _local3 = limitRange(_local4 - face);
_bank = _bank + ((-getSwitch(_local3)) * (1 - _dAvoids[_local2]));
_dAvoidTotal = _dAvoidTotal + (1 - _dAvoids[_local2]);
_local2++;
}
_bank = _bank / _dAvoidTotal;
}
var _bank = 0;
var _dangerD = 70;
var _checkFreq = 6;
var _turnRate = 0;
var _turnBoost = 2;
var _brakeFlag = true;
var inWater = true;
}
Symbol 803 MovieClip [__Packages.ScatterEngine] Frame 0
class ScatterEngine extends NavEngine
{
var targetFace, _vInit, _v, face, _turnRate, x, y, parentObj;
function ScatterEngine (p, ix, iy, f, tr, v, pm) {
super(p, ix, iy, f, tr, v, pm);
targetFace = Math.atan2(-(p.fishTank.floatingBall._y - p._y), -(p.fishTank.floatingBall._x - p._x));
_vInit = v;
if (Math.sin(targetFace) < 0) {
var _local5 = Tools.getAngleDiff(targetFace, -1.5707963267949);
var _local4 = ((random(100) / 100) * Math.PI) / 4;
if (_local5 > 0) {
targetFace = _local4;
} else {
targetFace = Math.PI - _local4;
}
}
if (Math.cos(targetFace) > 0) {
targetFace = targetFace / 3;
} else {
targetFace = targetFace + (Tools.getAngleDiff(targetFace, Math.PI) / 2);
}
}
function run(waterY) {
if (timer < 15) {
timer++;
}
var _local3;
if (timer < 15) {
_local3 = Curves.scurve(timer / 15);
} else {
_local3 = 1;
}
_v = (_vInit * (1 - _local3)) + (10 * _local3);
var _local4 = Tools.getAngleDiff(targetFace, face);
_turnRate = _local4 / 4;
face = face + _turnRate;
x = x + (Math.cos(face) * _v);
y = y + (Math.sin(face) * _v);
var _local5 = _root.getGlobalCoords(parentObj);
}
var vy = 0;
var timer = 0;
}
Symbol 804 MovieClip [__Packages.EatEngine] Frame 0
class EatEngine extends NavEngine
{
var hasSwallowed, parentObj, face;
function EatEngine (p, ix, iy, f, tr, v, pm) {
super(p, ix, iy, f, tr, v, pm);
}
function doEatProgress(num, targetX, targetY) {
if ((num > 0) && (!hasSwallowed)) {
if (canSwallow(targetX, targetY)) {
parentObj.eatBall();
hasSwallowed = true;
} else {
parentObj.cancelNav();
}
}
parentObj.onEatProgress(num);
}
function canSwallow(tx, ty) {
var _local3 = new Between({x:tx, y:ty}, this);
var _local6 = _local3.getAngle();
var _local2 = _local3.getDistance();
var _local4 = Tools.getAngleDiff(_local6, face);
var _local5 = Math.cos(_local4) > 0.5;
return((_local2 < 5) || ((_local2 < 10) && (_local5 > 0.5)));
}
}
Symbol 805 MovieClip [__Packages.JumpEngine] Frame 0
class JumpEngine extends EatEngine
{
var parentObj, jumpData, getTargetDir, _turnRate, face, y, _v, doEatProgress, _pushMotion, _a, x, limitRange;
function JumpEngine (p, ix, iy, f, tr, v, pm) {
super(p, ix, iy, f, tr, v, pm);
}
function getProximityToApex(tx, ty, apex) {
var _local2 = tx - apex.x;
var _local1 = ty - apex.y;
return(Math.sqrt((_local2 * _local2) + (_local1 * _local1)));
}
function tryAngle(tx, ty, waterY, ang, v) {
var _local3 = getJumpData(waterY, v, ang);
var _local2 = getProximityToApex(tx, ty, _local3.apex);
return(_local2);
}
function refineAngle(targetX, targetY, waterY, v, initAngle, range, stepNums) {
var _local6 = 0.628318530717959;
var _local7 = 1;
var _local5 = 0;
while (_local5 < stepNums) {
var _local4 = tryAngle(targetX, targetY, waterY, initAngle - 1E-5, v);
var _local3 = tryAngle(targetX, targetY, waterY, initAngle + 1E-5, v);
_local7 = ((_local4 > _local3) ? 1 : -1);
initAngle = initAngle + (_local6 * _local7);
_local6 = _local6 / 2;
_local5++;
}
return(initAngle);
}
function refineVelocity(targetX, targetY, waterY, initAngle, initV, range, stepNums) {
var _local6 = range;
var _local7 = 1;
var _local5 = 0;
while (_local5 < stepNums) {
var _local4 = tryAngle(targetX, targetY, waterY, initAngle, initV - 0.0001);
var _local3 = tryAngle(targetX, targetY, waterY, initAngle, initV + 0.0001);
_local7 = ((_local4 > _local3) ? 1 : -1);
initV = initV + (_local6 * _local7);
_local6 = _local6 / 2;
_local5++;
}
return(initV);
}
function run(waterY, targetX, targetY) {
if (!isJumping) {
if (targetY > waterY) {
parentObj.cancelJump();
return(undefined);
}
var _local15 = getLaunchPoint(waterY, targetX, targetY);
var _local2 = -1.5707963267949;
var _local11 = tryAngle(targetX, targetY, waterY, _local2, _vmax);
var _local14 = _local11;
var _local6 = 10;
_local2 = refineAngle(targetX, targetY, waterY, _local6, _local2, (Math.PI/2), 10);
_local6 = refineVelocity(targetX, targetY, waterY, _local2, 15, 7.5, 10);
_local2 = refineAngle(targetX, targetY, waterY, _local6, _local2, (Math.PI/4), 10);
_local6 = refineVelocity(targetX, targetY, waterY, _local2, 15, 7.5, 10);
_vmax = _local6;
jumpData = getJumpData(waterY, _vmax, _local2);
if (jumpData != false) {
var _local12 = jumpData.pt;
var _local13 = getTargetDir(_local12);
_turnRate = _turnRate + (_turnA * _local13);
_turnRate = _turnRate * _turnBrake;
} else {
_turnRate = _turnRate + _turnA;
_turnRate = _turnRate * _turnBrake;
}
var _local8 = Math.cos(Tools.getAngleDiff(face, _local2));
if (_local8 < 0) {
_local8 = 0;
}
doSwim(1, _local8);
if ((y < waterY) && (jumpData != false)) {
var _local10 = Math.abs(_v - _vmax);
var _local9 = Math.abs(Tools.getAngleDiff(face, _local2));
if ((_local10 > 2) || (_local9 > 0.3)) {
jumpData = getJumpData(waterY, _v, face);
}
isJumping = true;
doJump((y - waterY) / vy);
doEatProgress(-1, targetX, targetY);
}
} else {
var _local7 = 1;
if ((jumpData.time - jumpData.counter) < 1) {
_local7 = jumpData.time - jumpData.counter;
}
doJump(_local7);
if (_local7 < 1) {
doSwim(1 - _local7, 0, true);
doEatProgress(1, targetX, targetY);
cancel();
parentObj.onEventComplete("jump");
} else {
doEatProgress(((jumpData.counter / jumpData.time) * 2) - 1, targetX, targetY);
}
}
}
function cancel() {
_v = 0;
_pushMotion = {x:vx, y:vy};
}
function doSwim(frac, accelFactor, noAccel) {
face = face + (_turnRate * frac);
if (noAccel != true) {
var _local2 = (_vCruise * (1 - accelFactor)) + (_vmax * accelFactor);
_v = _v + ((_a * _brakeRate) * frac);
if (_v > _local2) {
_v = _local2;
}
}
vx = Math.cos(face) * _v;
vy = Math.sin(face) * _v;
x = x + (vx * frac);
y = y + (vy * frac);
}
function doJump(addFrac) {
jumpData.counter = jumpData.counter + addFrac;
var _local3 = jumpData.counter / jumpData.time;
var _local6 = x;
var _local5 = y;
x = jumpData.pt.x + (jumpData.vx * jumpData.counter);
y = (jumpData.pt.y + (jumpData.vy * jumpData.counter)) + (((grav * jumpData.counter) * jumpData.counter) / 2);
var _local2 = face;
vx = jumpData.vx;
vy = jumpData.vy + (grav * jumpData.counter);
_v = Math.sqrt((vx * vx) + (vy * vy));
var _local4 = limitRange(jumpData.landFace - jumpData.launchFace);
face = jumpData.launchFace + (_local4 * Curves.easeIn(_local3));
_turnRate = face - _local2;
}
function getArcData(ix, iy, iface, iv) {
var _local4 = Math.cos(iface) * iv;
var _local3 = Math.sin(iface) * iv;
var _local2 = (-_local3) / grav;
var _local6 = ix + (_local2 * _local4);
var _local5 = (iy + (_local2 * _local3)) + (((grav * _local2) * _local2) / 2);
return({time:_local2 * 2, vx:_local4, vy:_local3, apex:{x:_local6, y:_local5}});
}
function getLaunchPoint(yInt, tx, ty) {
var _local2 = 1 - ((ty - yInt) / (ty - y));
return({x:x + ((tx - x) * _local2), y:yInt});
}
function getJumpData(yInt, vi, f) {
var _local6 = Math.cos(f) * vi;
var _local4 = Math.sin(f) * vi;
var _local5 = (-(y - yInt)) / _local4;
var _local14 = {x:x + (_local6 * _local5), y:y + (_local4 * _local5)};
var _local13 = f;
var _local12 = Math.atan2(-Math.sin(f), Math.cos(f));
var _local3 = getArcData(_local14.x, _local14.y, f, vi);
if (_local3.time < 0) {
return(false);
}
return({pt:_local14, counter:0, time:_local3.time, vx:_local6, vy:_local4, apex:_local3.apex, launchFace:_local13, landFace:_local12});
}
var _turnA = 0.02;
var _turnBrake = 0.85;
var _brakeRate = 0.2;
var _vmax = 12;
var _vCruise = 2.2;
var vx = 0;
var vy = 0;
var grav = 0.5;
var isJumping = false;
}
Symbol 806 MovieClip [__Packages.ChaseEngine] Frame 0
class ChaseEngine extends EatEngine
{
var hasSwallowed, face, y, x, _turnRate, _v, _a, _pushMotion, doEatProgress, parentObj;
function ChaseEngine (p, ix, iy, f, tr, v, pm) {
super(p, ix, iy, f, tr, v, pm);
}
function run(waterY, targetX, targetY) {
var _local4;
if (!hasSwallowed) {
_local4 = {x:targetX, y:targetY};
} else {
_local4 = {x:x + (20 * Math.cos(face)), y:y + (20 * Math.sin(face))};
}
var _local5 = new Between(this, _local4);
var _local7 = _local5.getAngle();
var _local3 = _local5.getDistance();
var _local2 = Tools.getAngleDiff(_local7, face);
var _local8 = ((_local2 > 0) ? 1 : -1);
_turnRate = _turnRate + ((_turnA * _local8) * _turnBrake);
if ((Math.sin(_turnRate) * _local2) < 0) {
_turnRate = _turnRate * 0.5;
}
face = face + _turnRate;
_v = _v + _a;
if (_v > _vmax) {
if ((_v - _vmax) > _a) {
_v = _v - _a;
} else {
_v = _vmax;
}
}
_pushMotion.x = _pushMotion.x * 0.9;
_pushMotion.y = _pushMotion.y * 0.9;
x = x + ((_v * Math.cos(face)) + _pushMotion.x);
y = y + ((_v * Math.sin(face)) + _pushMotion.y);
if (!hasSwallowed) {
if (_local3 < (_v * 20)) {
var _local9 = ((Math.cos(_local2) > 0) ? 1 : -1);
var _local6 = ((-_local9) * _local3) / (_v * 20);
doEatProgress(_local6, targetX, targetY);
}
} else {
postSwallowEatProgress = postSwallowEatProgress + 0.1;
doEatProgress(postSwallowEatProgress);
if (postSwallowEatProgress >= 1) {
parentObj.onEventComplete("chase");
}
}
}
var _turnA = 0.02;
var _vmax = 4;
var _turnBrake = 0.5;
var _brakeRate = 0.2;
var postSwallowEatProgress = 0;
}
Symbol 807 MovieClip [__Packages.DragEngine] Frame 0
class DragEngine extends NavEngine
{
var _v, _mOx, parentObj, _mOy, _turnRate, x, y, __get__pushMotion;
function DragEngine (p, ix, iy, f, tr, v, pm) {
super(p, ix, iy, f, tr, v, pm);
_v = 0;
_mOx = parentObj._xmouse;
_mOy = parentObj._ymouse;
}
function run(waterY, targetX, targetY) {
_turnRate = _turnRate / 2;
var _local3 = x;
var _local2 = y;
x = parentObj.fishTank._xmouse - _mOx;
y = parentObj.fishTank._ymouse - _mOy;
__get__pushMotion().x = x - _local3;
__get__pushMotion().y = y - _local2;
}
}
Symbol 809 MovieClip [__Packages.FishTank] Frame 0
class FishTank extends MovieClip
{
var edgeArr, splashLayer, balls, ballCoordsArr, _onEatCallBack, _ballReadyCallback, _ballGrabCallBack, headForm, fillEvent, waterTop, waterSurface, waterForm, floatingBall, backForms, hoop, foreLayer;
function FishTank () {
super();
fishByEngineHash = {crowd:{engine:CrowdEngine, navArr:[]}, scatter:{engine:ScatterEngine}, jump:{engine:JumpEngine}, chase:{engine:ChaseEngine}, drag:{engine:DragEngine}};
edgeArr = HeadShape.edgeArrNoNose;
splashLayer.splashClip.setMask(splashLayer.splashMask);
}
function setBalls(ballsArr) {
balls = ballsArr;
ballCoordsArr = [];
var _local6 = balls.length;
var _local2 = 0;
while (_local2 < _local6) {
ballCoordsArr[_local2] = {x:balls[_local2].x, y:balls[_local2].y, obj:balls[_local2]};
_local2++;
}
}
function begin(amt, counterMax, onEatCallBack, ballGrabCallBack, ballReadyCallBack) {
_onEatCallBack = onEatCallBack;
_ballReadyCallback = ballReadyCallBack;
_ballGrabCallBack = ballGrabCallBack;
fillWater(amt, counterMax);
}
function shutDown(counterMax, callBack) {
var evtWait = 2;
var _local2 = function () {
evtWait--;
if (evtWait == 0) {
callBack();
}
};
drainWater(counterMax, _local2);
waitForFishesToLeave(_local2);
}
function waitForFishesToLeave(callBack) {
var _local4;
var _local5 = fishArr.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local3 = fishArr[_local2];
if (headForm.hitTest(_local3)) {
_local4 = true;
}
_local2++;
}
if (_local4) {
new DelayedEvent(this, 1, "waitForFishesToLeave", [callBack]);
} else {
callBack();
}
}
function fillWater(amt, counterMax, callBack) {
fillEvent.cancel();
doFill(0, waterLevel, amt, counterMax, callBack);
}
function drainWater(counterMax, callBack) {
fillEvent.cancel();
doFill(0, waterLevel, 0, counterMax, callBack);
}
function onBallGrab() {
_ballGrabCallBack();
}
function onBallDry(ballObj) {
_ballReadyCallback(ballObj);
ballObj.backForm.removeMovieClip();
ballObj.removeMovieClip();
}
function doFill(counter, initAmt, finalAmt, counterMax, callBack) {
counter++;
var _local4 = ((initAmt < finalAmt) ? (Curves.easeOut) : (Curves.easeIn));
var _local6 = initAmt + ((finalAmt - initAmt) * _local4(counter / counterMax));
waterLevel = _local6;
setWaterLevel(525 * _local6);
if (counter < counterMax) {
fillEvent = new DelayedEvent(this, 1, "doFill", [counter, initAmt, finalAmt, counterMax, callBack]);
} else {
callBack();
}
}
function setWaterLevel(pxl) {
var _local18 = edgeArr.length;
var _local4 = 525;
var _local6 = (_local4 - pxl) / _local4;
var _local17 = _local18 - (_local18 * _local6);
var _local9 = Math.round(_local17);
var _local13 = _local17 - _local9;
var _local16;
if (_local13 > 0) {
_local6 = _local13;
_local16 = _local9 + 1;
} else {
_local6 = -_local13;
_local16 = _local9 - 1;
}
var _local5 = edgeArr[_local9];
if (_local5 == undefined) {
_local5 = [0, 0];
}
var _local7 = edgeArr[_local16];
if (_local7 == undefined) {
_local7 = _local5;
}
var _local15 = (_local5[0] * (1 - _local6)) + (_local7[0] * _local6);
var _local14 = (_local5[1] * (1 - _local6)) + (_local7[1] * _local6);
var _local11 = (_local15 + _local14) / 2;
var _local10 = _local14 - _local15;
var _local12 = _local10 * (0.05 + (0.1 * (1 - (pxl / 525))));
var _local19 = _root.yMax;
waterTop._y = _local4 - pxl;
waterTop._x = _local11;
waterTop._width = _local10;
waterTop._height = _local12;
waterSurface._y = _local4 - pxl;
waterSurface._x = _local11;
waterSurface._width = _local10;
waterSurface._height = _local12;
waterForm._height = pxl;
waterForm._y = _local4 - pxl;
waterForm._x = 0;
var _local8 = splashLayer.splashMask;
_local8._y = _local4 - pxl;
_local8._x = _local11;
_local8._width = _local10;
_local8._height = _local12;
waterSurface._visible = (waterTop._visible = pxl != 0);
waterY = ((pxl == 0) ? (_local4 + 100) : (_local4 - pxl));
}
function chaseAnyBall() {
var _local3 = balls.length;
var _local2 = 0;
while (_local2 < _local3) {
chaseBall(ballCoordsArr[_local2]);
_local2++;
}
}
function chaseBall(ballCoordsObj) {
var _local3 = ballCoordsObj.obj;
if (headForm.hitTest(_local3._x, _local3._y, true)) {
if (ballCoordsObj.y > waterY) {
var _local4 = getMiddleFish(ballCoordsObj, "crowd");
swapEngines(_local4, "chase", ballCoordsObj);
} else {
var _local4 = getMiddleFish(ballCoordsObj, "crowd");
swapEngines(_local4, "jump", ballCoordsObj);
}
}
}
function cancelNav(fish) {
}
function cancelJump(fish, ballCoords) {
swapEngines(fish, "chase", ballCoords);
}
function eatBall(obj, fish) {
new DelayedEvent(SoundManager, 10, "playSound", ["gulp", 50]);
if (fish.navType == "jump") {
eatenInAir = true;
}
var _local2 = 0;
while (_local2 < balls.length) {
if (balls[_local2] == obj) {
_eatCount++;
if (balls[_local2].vizForm != balls[_local2]) {
balls[_local2].vizForm.removeMovieClip();
}
balls[_local2].removeMovieClip();
balls.splice(_local2, 1);
ballCoordsArr.splice(_local2, 1);
new DelayedEvent(Mouse, 10, "show");
onLetGo();
_onEatCallBack();
return(undefined);
}
_local2++;
}
}
function getMiddleFish(pt, navType) {
var _local5 = [];
var _local2 = 0;
while (_local2 < fishArr.length) {
if ((fishArr[_local2].y > waterY) && (fishArr[_local2].navType == navType)) {
var _local3 = new Between(pt, fishArr[_local2]).getDistance();
_local5.push({d:_local3, fish:fishArr[_local2]});
}
_local2++;
}
_local5.sortOn("d", Array.NUMERIC);
var _local8 = _local5.length;
return(_local5.splice(Math.floor(_local8 / 2), 1)[0].fish);
}
function addFloatingObject(obj, objType) {
if (objType == "fish") {
return(addFish(obj));
}
if (objType == "ball") {
return(addBall(obj));
}
}
function addBall(obj) {
floatingBall = obj;
fishDepth++;
var _local2 = backForms.attachMovie("ballForm", "wf" + fishDepth, fishDepth);
return(_local2);
}
function addFish(fish) {
depthIndx++;
fish.swapDepths(depthIndx);
fish.init(waterY);
fishArr.push(fish);
new DelayedEvent(this, 1, "swapEngines", [fish, "crowd"]);
fishDepth++;
var _local3 = backForms.attachMovie("fishForm", "fb" + fishDepth, fishDepth, {_xscale:fish.form._xscale, _yscale:fish.form._yscale});
return(_local3);
}
function introduceFish() {
}
function scatterFish() {
scatterAllFish();
}
function onEventComplete(fish, evtType) {
if ((((evtType == "jump") || (evtType == "chase")) || (evtType == "scatter")) || (evtType == "drag")) {
swapEngines(fish, "crowd");
}
}
function ballOn(chosenBall) {
chosenBall.vizForm._visible = true;
}
function ballOff(chosenBall) {
chosenBall.vizForm._visible = false;
}
function onSplash(fish) {
splashIndx++;
var _local3 = splashLayer.splashClip.attachMovie("rippleCluster", "s" + splashIndx, splashIndx);
var _local5 = _root.getGlobalCoords(fish);
var _local4 = _root.getLocalCoords(this, _local5);
_local3._x = _local4.x;
_local3._y = waterY;
_local3._yscale = ((waterTop._height / waterTop._width) * 100) * 1.4;
}
function onDone(splash) {
splash.removeMovieClip();
}
function removeFromArr(fish, arr) {
var _local3 = arr.length;
var _local1 = 0;
while (_local1 < _local3) {
if (arr[_local1] == fish) {
arr.splice(_local1, 1);
}
_local1++;
}
}
function scatterAllFish() {
var _local2 = 0;
while (_local2 < fishArr.length) {
var _local3 = fishArr[_local2];
swapEngines(_local3, "scatter");
_local2++;
}
}
function doDrag(fish) {
swapEngines(fish, "drag");
}
function doScatter(fish) {
swapEngines(fish, "scatter");
}
function swapEngines(fish, newEngineType, initParam) {
fish.nav.cancel();
var _local6 = fish.navType;
var _local7 = fishByEngineHash[_local6];
var _local4 = fishByEngineHash[newEngineType];
var _local2 = fish.nav;
fish.endNavType();
removeFromArr(_local2, _local7.navArr);
if (_local2 == undefined) {
_local2 = {x:fish._x, y:fish._y, turn:0, face:Math.atan2(waterY - fish._y, -fish._x), v:0, pushMotion:{x:0, y:0}};
}
var _local5 = new _local4.engine(fish, _local2.x, _local2.y, _local2.face, _local2.turn, _local2.v, _local2.pushMotion, _local4.navArr.length);
fish.nav = _local5;
fish.initNavType(newEngineType, initParam);
_local4.navArr.push(_local5);
_local5.setMembers(_local4.navArr);
}
function onMouseMove() {
mouseMotionCounter = 0;
}
function onEnterFrame() {
mouseMotionCounter++;
mouseStill = true;
var _local9 = balls.length;
var _local5 = 0;
while (_local5 < _local9) {
var _local3 = ballCoordsArr[_local5];
var _local6 = _root.getLocalCoords(this, {x:balls[_local5].x, y:balls[_local5].y});
_local3.x = _local6.x;
_local3.y = _local6.y;
var _local4 = _local3.obj;
if (((mouseStill && (_local4.drag)) || (!_local4.drag)) && (getPursuer(_local4) == false)) {
chaseBall(_local3);
}
_local5++;
}
_local5 = 0;
while (_local5 < fishArr.length) {
fishArr[_local5].run();
_local5++;
}
}
function getPursuer(obj) {
var _local2 = 0;
while (_local2 < fishArr.length) {
if (obj == fishArr[_local2].getTargetBall()) {
return(fishArr[_local2]);
}
_local2++;
}
return(false);
}
function onBallEnterWater(obj) {
fishDepth++;
var _local2 = backForms.attachMovie("decoyBall", "ff" + fishDepth, fishDepth);
new Color(_local2).setRGB(16777215);
_local2._width = (_local2._height = obj.radius * 2);
obj._alpha = 0;
obj.vizForm = _local2;
var ft = this;
_local2.onEnterFrame = function () {
this._x = obj._x - ft._x;
this._y = obj._y - ft._y;
};
_local2.onEnterFrame();
}
function onBallLeaveWater(obj) {
obj.vizForm.removeMovieClip();
obj._alpha = 100;
obj.vizForm = obj;
}
function getBallCoordsObj(obj) {
var _local4 = balls.length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = ballCoordsArr[_local2];
if (_local3.obj == obj) {
return(_local3);
}
_local2++;
}
}
function onLetGo() {
if (!eatenInAir) {
return(undefined);
}
hoop.reverse(1);
}
function onPickup() {
if (eatenInAir) {
return(undefined);
}
hoop.forward(1);
}
function releaseBall() {
hoop.reverse(1);
ballReleased = true;
floatingBall = foreLayer.attachMovie("floatingBall", "fw", 99);
floatingBall._x = 220;
floatingBall._y = 600;
scatterFish();
}
var fishArr = [];
var fishByEngineHash = {};
var navArray = [];
var chkRate = 8;
var waterY = -300;
var colorArr = [3368550, 26163, 3355392, 6697728, 13421721, 16737843, 13158, 16777215];
var depthIndx = 0;
var fishDepth = 0;
var waterLevel = 0;
var _eatCount = 0;
var splashIndx = 0;
var mouseMotionCounter = 0;
var mouseStill = false;
var eatenInAir = false;
var ballReleased = false;
}
Symbol 811 MovieClip [__Packages.FloatingObject] Frame 0
class FloatingObject extends MovieClip
{
var x, _x, y, _y, fishTank, _parent, backForm, objType, form, maskForm, localToGlobal, globalToLocal;
function FloatingObject () {
super();
x = _x;
y = _y;
fishTank = _parent._parent;
backForm = fishTank.addFloatingObject(this, objType);
}
function onEnterFrame() {
setPos(_x, _y);
evalMask();
}
function getWaterY() {
return(fishTank.waterY);
}
function evalMask() {
var _local2 = getWaterY();
form.setMask(null);
maskForm._visible = true;
var _local5 = isWet;
var _local4 = form.getBounds(fishTank);
if (_local4.yMin >= _local2) {
form._visible = false;
maskForm._visible = false;
isWet = true;
} else if ((_local2 < _local4.yMax) && (_local2 >= _local4.yMin)) {
var _local3 = getXIntersection(_local2 - y);
if (_local3 != false) {
doMask(_local3);
form._visible = true;
maskForm._visible = true;
} else {
_local3 = [{x:0, y:_local2}, {x:0, y:_local2}];
doMask(_local3);
form._visible = true;
maskForm._visible = true;
}
isWet = true;
} else {
form._visible = true;
maskForm._visible = true;
releaseMask();
isWet = false;
}
}
function setPos(ix, iy) {
x = ix;
y = iy;
backForm._x = x;
backForm._y = y;
_x = x;
_y = y;
}
function doMask(edges) {
var _local2 = form.getBounds(this);
var _local3 = maskForm.disc;
var _local5 = maskForm.square;
_local5._x = _local2.xMin;
_local5._y = _local2.yMin;
_local5._width = _local2.xMax - _local2.xMin;
_local5._height = edges[0].y - _local2.yMin;
_local3._y = edges[0].y;
_local3._x = (edges[0].x + edges[1].x) / 2;
_local3._width = edges[1].x - edges[0].x;
_local3._height = 6;
form.setMask(maskForm);
}
function releaseMask() {
form.setMask(null);
maskForm._visible = false;
}
function getXIntersection(ty) {
var _local13 = [];
var _local16;
var _local14 = 0;
var _local3 = false;
var _local5 = 1;
var _local7 = 0;
var _local9 = 0;
var _local12 = {x:_local14, y:ty};
localToGlobal(_local12);
var _local6 = _local12.x;
var _local8 = _local12.y;
while ((_local3 == false) && (_local9 < 50)) {
_local9++;
if (form.hitTest(_local6, _local8, true) != true) {
_local5 = _local5 * -1;
_local7 = _local7 + 0.5;
_local6 = Math.round(_local12.x + (_local7 * _local5));
} else {
_local3 = true;
}
}
if (!_local3) {
_local6 = _local14;
}
var _local4 = 0;
while (_local4 < 2) {
_local5 = (_local4 - 0.5) * 2;
_local3 = true;
var _local2 = {x:_local6, y:_local8};
_local9 = 0;
while (_local3) {
if (form.hitTest(_local2.x, _local2.y, true)) {
_local2.x = _local2.x + (_local5 * 0.5);
} else {
_local3 = false;
}
}
globalToLocal(_local2);
_local13[_local4] = _local2;
_local4++;
}
return(_local13);
}
var isWet = true;
}
Symbol 812 MovieClip [__Packages.FloatingBall] Frame 0
class FloatingBall extends FloatingObject
{
var backForm, isWet, fishTank, setPos, ox, oy, _height, getWaterY, y, _x, _y, evalMask;
function FloatingBall () {
super();
var o = this;
backForm.onPress = function () {
o.isClicked = true;
o.fishTank.onBallGrab();
o.isDragging = true;
o.ox = o._xmouse;
o.oy = o._ymouse;
this.onMouseUp = function () {
this.onMouseUp = null;
o.isDragging = false;
};
};
}
function onEnterFrame() {
if (isDragging) {
if ((!isWet) && (!dryIsCalled)) {
dryIsCalled = true;
fishTank.onBallDry(this);
}
vx = 0;
vy = 0;
setPos(fishTank._xmouse - ox, fishTank._ymouse - oy);
} else {
var _local3 = ((y - getWaterY()) + (_height / 2)) / _height;
if (_local3 > 1) {
_local3 = 1;
}
if (_local3 < 0) {
_local3 = 0;
}
vy = vy + (bouancy * _local3);
vy = vy + grav;
vy = vy * ((waterDrag * _local3) + (1 - _local3));
setPos(_x + vx, _y + vy);
var _local5 = _root.getLocalCoords(fishTank, {x:_root.xMax, y:_root.yMax});
var _local4 = _local5.y - (_height / 2);
if (isClicked && (_y > _local4)) {
_y = _local4 - (_y - _local4);
vy = vy * -0.8;
if (Math.abs(vy) < 0.5) {
vy = 0;
_y = _local4;
}
setPos(_x, _y);
}
}
evalMask();
}
var vx = 0;
var vy = 0;
var bouancy = -1.8;
var waterDrag = 0.8;
var grav = 1;
var objType = "ball";
var isDragging = false;
var isClicked = false;
var dryIsCalled = false;
}
Symbol 815 MovieClip [__Packages.ComboForm] Frame 0
class ComboForm
{
var f1, f2;
function ComboForm (form1, form2) {
f1 = form1;
f2 = form2;
}
function hitTest(param1, param2, param3) {
var _local4;
var _local3;
if (param2 == undefined) {
_local4 = f1.hitTest(param1);
_local3 = f2.hitTest(param1);
} else {
_local4 = f1.hitTest(param1, param2, param3);
_local3 = f2.hitTest(param1, param2, param3);
}
return(_local4 && (_local3));
}
}
Symbol 816 MovieClip [__Packages.AntiForm] Frame 0
class AntiForm
{
var form;
function AntiForm (f) {
form = f;
}
function hitTest(param1, param2, param3) {
var _local4;
if (param2 == undefined) {
return(true);
}
if (param3) {
return(!form.hitTest(param1, param2, param3));
}
return(true);
}
}
Symbol 817 MovieClip [__Packages.FishFood] Frame 0
class FishFood extends Draggable
{
var vizForm, shapeCollision, dragSpeed, _managerObj, myHitForm, myAntiForm, drag, px, py, grav, airDrag, __get__x, __get__y, vy;
function FishFood () {
super();
vizForm = this;
shapeCollision = true;
dragSpeed = 10;
}
function extraInit(managerObj) {
_managerObj = managerObj;
myHitForm = new ComboForm(_managerObj.waterForm, _managerObj.headForm);
myAntiForm = new AntiForm(_managerObj.headForm);
}
function onPickup() {
_managerObj.onPickup();
}
function onLetGo() {
Mouse.show();
_managerObj.onLetGo();
}
function onEnterFrame(noRepeat) {
if (drag) {
if (!myAntiForm.hitTest(px, py, true)) {
Mouse.hide();
} else {
Mouse.show();
}
}
if (inWater) {
grav = 0;
airDrag = 0.8;
} else {
grav = baseGrav;
airDrag = 0.96;
}
var _local3 = inWater;
super.onEnterFrame();
inWater = myHitForm.hitTest(__get__x(), __get__y(), true);
if (_local3 && (!inWater)) {
_managerObj.onBallLeaveWater(this);
} else if ((!_local3) && (inWater)) {
_managerObj.onBallEnterWater(this);
}
if ((!_local3) && (inWater)) {
_managerObj.onSplash(this);
SoundManager.playSound("splashSound", (vy / 15) * 100);
}
if ((noRepeat != true) && (drag)) {
onEnterFrame(true);
}
}
function getHitForms() {
if (_managerObj.headForm.hitTest(__get__x(), __get__y(), true)) {
if (_managerObj.waterForm.hitTest(__get__x(), __get__y(), true)) {
return([myAntiForm]);
}
return([]);
}
return([myHitForm]);
}
var baseGrav = 1;
var inWater = false;
}
Symbol 818 MovieClip [__Packages.Fish] Frame 0
class Fish extends FloatingObject
{
var backForm, navType, _ballCoords, ballInWater, swallowMask, localBall, form, fishTank, getWaterY, y, nav, dir, spd, setPos, evalMask, _eatFrame;
function Fish () {
super();
var o = this;
backForm.onPress = function () {
o.cancelNav();
o.fishTank.doDrag(o);
this.onMouseUp = function () {
this.onMouseUp = undefined;
o.cancelNav();
};
};
}
function initNavType(newType, ballCoords) {
navType = newType;
if (navType == "jump") {
_ballCoords = ballCoords;
setBallForm(false);
} else if (navType == "chase") {
_ballCoords = ballCoords;
setBallForm(true);
}
}
function setBallForm(waterBoo) {
ballInWater = waterBoo;
var _local2 = swallowMask._visible;
var _local3 = localBall._visible;
localBall.removeMovieClip();
swallowMask.removeMovieClip();
if (waterBoo) {
initLocalBall(backForm);
initSwallowMask(backForm);
} else {
initLocalBall(form);
initSwallowMask(form);
}
localBall._visible = _local3;
swallowMask._visible = _local2;
}
function initLocalBall(baseForm) {
localBall = baseForm.head.attachMovie("fishBall", "b", 0);
new Color(localBall).setRGB(16777215);
localBall._visible = false;
baseForm.head.front.swapDepths(3);
localBall.swapDepths(2);
baseForm.head.back.swapDepths(1);
}
function initSwallowMask(baseMc) {
swallowMask = baseMc.head.attachMovie("swallowMask", "s", 5);
swallowMask._visible = false;
}
function endNavType() {
if ((navType == "jump") || (navType == "chase")) {
localBall.removeMovieClip();
swallowMask.removeMovieClip();
}
}
function cancelJump() {
onEventComplete("jump");
fishTank.cancelJump(this, _ballCoords);
}
function cancelNav() {
onEventComplete(navType);
}
function onEnterFrame() {
var _local4 = getWaterY();
var _local6 = y;
if (((navType == "jump") || (navType == "chase")) && (!nav.hasSwallowed)) {
var _local5 = _ballCoords.y > _local4;
if ((_local5 && (!ballInWater)) || ((!_local5) && (ballInWater))) {
cancelNav();
} else if (_ballCoords.obj._width == undefined) {
cancelNav();
}
}
nav.run(_local4, _ballCoords.x, _ballCoords.y);
dir = nav.face;
spd = nav.v;
var _local8 = nav.turn;
form._rotation = (dir / Math.PI) * 180;
backForm._rotation = (dir / Math.PI) * 180;
setPos(nav.x, nav.y);
var _local3 = _local8 / 0.1;
if (_local3 > 1) {
_local3 = 1;
}
if (_local3 < -1) {
_local3 = -1;
}
turnFrame = ((_local3 * 20) + turnFrame) / 2;
form.gotoAndStop(21 - Math.round(turnFrame));
backForm.gotoAndStop(21 - Math.round(turnFrame));
if (((navType == "jump") || (navType == "chase")) && (localBall._visible == true)) {
var _local9 = _root.getGlobalCoords(fishTank, {x:_ballCoords.x, y:_ballCoords.y});
var _local7 = _root.getLocalCoords(form.head, _local9);
localBall._x = _local7.x;
localBall._y = _local7.y;
}
evalMask();
if ((navType == "crowd") && (_eatFrame > 1)) {
setEatFrame(_eatFrame - 2);
}
if ((_local6 < _local4) && (y > _local4)) {
fishTank.onSplash(this);
SoundManager.playSound("splashSound", ((y - _local6) / 15) * 100);
}
}
function getTargetBall() {
if ((navType == "jump") || (navType == "chase")) {
return(_ballCoords.obj);
}
}
function onEventComplete(evtType) {
if ((evtType == "jump") || (evtType == "chase")) {
localBall._visible = true;
localBall.setMask(null);
ballOff();
swallowMask._visible = false;
fishTank.ballOn(_ballCoords.obj);
}
fishTank.onEventComplete(this, evtType);
}
function eatBall(obj) {
swallowMask._visible = true;
localBall.setMask(swallowMask);
fishTank.eatBall(_ballCoords.obj, this);
}
function setEatFrame(frm) {
if (frm < 1) {
frm = 1;
}
_eatFrame = frm;
form.head.front.gotoAndStop(frm);
backForm.head.front.gotoAndStop(frm);
form.head.back.gotoAndStop(frm);
backForm.head.back.gotoAndStop(frm);
}
function onEatProgress(num) {
var _local4 = form.head.front._totalFrames;
var _local2;
if (num < 0) {
_local2 = Math.floor((1 + num) * _local4) + 1;
} else {
var _local5 = ((navType == "jump") ? 5 : 1);
_local2 = Math.floor((1 - (num * _local5)) * _local4) + 1;
if (_local2 < 1) {
_local2 = 1;
}
}
setEatFrame(_local2);
if (num > 0) {
} else if (num > -0.75) {
ballOn();
fishTank.ballOff(_ballCoords.obj);
}
}
function isBusy() {
return((navType == "jump") || (navType == "chase"));
}
function ballOn() {
localBall._visible = true;
}
function ballOff() {
localBall._visible = false;
}
var objType = "fish";
var turnFrame = 0;
}
Symbol 238 MovieClip [fader] Frame 5
stop();
Symbol 239 MovieClip [smallHead0StretchNose] Frame 1
#initclip 308
Object.registerClass("smallHead0StretchNose", StretchShape);
#endinitclip
Symbol 268 MovieClip Frame 80
gotoAndPlay (1);
Symbol 269 MovieClip [smallHead1Crest] Frame 1
#initclip 209
Object.registerClass("smallHead1Crest", Crest);
#endinitclip
stop();
Symbol 269 MovieClip [smallHead1Crest] Frame 10
stop();
Symbol 272 MovieClip Frame 1
stop();
Symbol 272 MovieClip Frame 2
stop();
Symbol 275 MovieClip Frame 1
stop();
Symbol 283 MovieClip [smallHead1AnimForm] Frame 1
#initclip 210
Object.registerClass("smallHead1AnimForm", ReversibleClip);
#endinitclip
Symbol 284 MovieClip [smallHead1] Frame 1
#initclip 211
Object.registerClass("smallHead1", SmallHeadEagle);
#endinitclip
Symbol 294 MovieClip [smallHead1Shell] Frame 1
#initclip 212
Object.registerClass("smallHead1Shell", SmallHeadShellEagle);
#endinitclip
Symbol 297 MovieClip [eyeBallKidMouth] Frame 1
#initclip 213
Object.registerClass("eyeBallKidMouth", ReversibleClip);
#endinitclip
Symbol 317 MovieClip [smallHead2EyeShape] Frame 1
#initclip 214
Object.registerClass("smallHead2EyeShape", EyeShapeEyeBallKid);
#endinitclip
stop();
Symbol 322 MovieClip [smallHead2AnimForm] Frame 1
#initclip 215
Object.registerClass("smallHead2AnimForm", ReversibleClip);
#endinitclip
Symbol 323 MovieClip [smallHead2] Frame 1
#initclip 216
Object.registerClass("smallHead2", SmallHeadEyeBallKid);
#endinitclip
Symbol 325 MovieClip [smallHead2Shell] Frame 1
#initclip 217
Object.registerClass("smallHead2Shell", SmallHeadShell);
#endinitclip
Symbol 332 MovieClip [smallHead3EyeShape] Frame 1
#initclip 218
Object.registerClass("smallHead3EyeShape", MoonEyeShape);
#endinitclip
Symbol 333 MovieClip [smallHead3] Frame 1
#initclip 219
Object.registerClass("smallHead3", SmallHeadMoon);
#endinitclip
Symbol 335 MovieClip [smallHead3Shell] Frame 1
#initclip 220
Object.registerClass("smallHead3Shell", SmallHeadShell);
#endinitclip
Symbol 344 MovieClip Frame 1
stop();
Symbol 351 MovieClip [smallHead4Hatch] Frame 1
#initclip 221
Object.registerClass("smallHead4Hatch", ReversibleClip);
#endinitclip
stop();
Symbol 354 MovieClip [smallHead4] Frame 1
#initclip 222
Object.registerClass("smallHead4", SmallHeadWorm);
#endinitclip
Symbol 356 MovieClip [smallHead4Shell] Frame 1
#initclip 223
Object.registerClass("smallHead4Shell", SmallHeadShell);
#endinitclip
Symbol 373 MovieClip [smallHead5] Frame 1
#initclip 224
Object.registerClass("smallHead5", SmallHeadCloud);
#endinitclip
Symbol 373 MovieClip [smallHead5] Frame 40
stop();
Symbol 373 MovieClip [smallHead5] Frame 49
stop();
Symbol 374 MovieClip [smallHead5b] Frame 1
#initclip 225
Object.registerClass("smallHead5b", SmallHead);
#endinitclip
Symbol 376 MovieClip [smallHead5Shell] Frame 1
#initclip 226
Object.registerClass("smallHead5Shell", SmallHeadShell);
#endinitclip
Symbol 381 MovieClip [ground] Frame 1
#initclip 227
Object.registerClass("ground", Ground);
#endinitclip
Symbol 387 MovieClip [tailAnim] Frame 1
#initclip 228
Object.registerClass("tailAnim", ReversibleClip);
#endinitclip
stop();
Symbol 387 MovieClip [tailAnim] Frame 13
reverse(1);
Symbol 394 MovieClip [tail] Frame 1
#initclip 229
Object.registerClass("tail", ReversibleClip);
#endinitclip
Symbol 397 MovieClip Frame 1
stop();
Symbol 397 MovieClip Frame 5
_parent.onWheelComplete();
Symbol 399 MovieClip [wheelTree] Frame 1
#initclip 230
Object.registerClass("wheelTree", WheelTree);
#endinitclip
stop();
Symbol 399 MovieClip [wheelTree] Frame 7
stop();
Symbol 404 MovieClip [newBeardStrand4] Frame 1
#initclip 231
Object.registerClass("newBeardStrand4", BeardStrand);
#endinitclip
onFirstFrame();
Symbol 404 MovieClip [newBeardStrand4] Frame 9
onGrown();
stop();
Symbol 405 MovieClip [newStash] Frame 1
#initclip 232
Object.registerClass("newStash", Tuft);
#endinitclip
Symbol 406 MovieClip [newBeardSmall] Frame 1
#initclip 233
Object.registerClass("newBeardSmall", Tuft);
#endinitclip
Symbol 407 MovieClip [headTuft4] Frame 1
#initclip 234
Object.registerClass("headTuft4", Tuft);
#endinitclip
Symbol 408 MovieClip [headTuft3] Frame 1
#initclip 235
Object.registerClass("headTuft3", Tuft);
#endinitclip
Symbol 409 MovieClip [headTuft2] Frame 1
#initclip 236
Object.registerClass("headTuft2", Tuft);
#endinitclip
Symbol 410 MovieClip [headTuft] Frame 1
#initclip 237
Object.registerClass("headTuft", Tuft);
#endinitclip
Symbol 411 MovieClip [hatchTuft2] Frame 1
#initclip 238
Object.registerClass("hatchTuft2", Tuft);
#endinitclip
Symbol 412 MovieClip [hatchTuft ] Frame 1
#initclip 239
Object.registerClass("hatchTuft ", Tuft);
#endinitclip
Symbol 413 MovieClip [chinTuft] Frame 1
#initclip 240
Object.registerClass("chinTuft", Tuft);
#endinitclip
Symbol 414 MovieClip [spot] Frame 1
#initclip 241
Object.registerClass("spot", Spot);
#endinitclip
Symbol 415 MovieClip [spots] Frame 1
#initclip 242
Object.registerClass("spots", Spots);
#endinitclip
Symbol 421 MovieClip [spotAnim] Frame 1
stop();
Symbol 427 MovieClip Frame 1
gotoAndPlay(1 + random(60));
Symbol 427 MovieClip Frame 62
gotoAndPlay (2);
Symbol 428 MovieClip [scales] Frame 1
#initclip 243
Object.registerClass("scales", ReversibleClip);
#endinitclip
Symbol 430 MovieClip [flameBit] Frame 1
#initclip 244
Object.registerClass("flameBit", FlameBit);
#endinitclip
Symbol 431 MovieClip [fire] Frame 1
#initclip 245
Object.registerClass("fire", Fire);
#endinitclip
Symbol 432 MovieClip [renderShapeTrunk] Frame 1
#initclip 246
Object.registerClass("renderShapeTrunk", RenderShapeTrunk);
#endinitclip
Symbol 435 MovieClip [renderShapeTree] Frame 1
#initclip 247
Object.registerClass("renderShapeTree", RenderShapeTree);
#endinitclip
Symbol 447 MovieClip [headFlap] Frame 1
#initclip 248
Object.registerClass("headFlap", ReversibleClip);
#endinitclip
Symbol 448 MovieClip [feather] Frame 1
#initclip 249
Object.registerClass("feather", Feather);
#endinitclip
Symbol 451 MovieClip [beardStrand] Frame 1
#initclip 250
Object.registerClass("beardStrand", BeardStrand);
#endinitclip
Symbol 455 MovieClip [beard] Frame 1
#initclip 251
Object.registerClass("beard", Tuft);
#endinitclip
Symbol 462 MovieClip [beakNoseShape] Frame 1
top.gotoAndPlay(5);
Symbol 463 MovieClip [beakNose] Frame 1
#initclip 252
Object.registerClass("beakNose", ReversibleClip);
#endinitclip
Symbol 472 MovieClip [window] Frame 1
#initclip 253
Object.registerClass("window", Window);
#endinitclip
Symbol 472 MovieClip [window] Frame 11
activateMask();
Symbol 473 MovieClip [ballTracker] Frame 1
#initclip 254
Object.registerClass("ballTracker", BallTracker);
#endinitclip
Symbol 476 MovieClip Frame 19
gotoAndPlay (1);
Symbol 477 MovieClip [rollHintArrow] Frame 1
#initclip 255
Object.registerClass("rollHintArrow", RollHintMarker);
#endinitclip
stop();
Symbol 477 MovieClip [rollHintArrow] Frame 6
stop();
Symbol 478 MovieClip [hintArrow] Frame 1
#initclip 256
Object.registerClass("hintArrow", HintMarker);
#endinitclip
stop();
Symbol 478 MovieClip [hintArrow] Frame 6
if (active) {
stop();
}
Symbol 479 MovieClip [HintMaster] Frame 1
#initclip 257
Object.registerClass("HintMaster", HintMaster);
#endinitclip
Symbol 484 MovieClip [bubbleImage] Frame 1
#initclip 258
Object.registerClass("bubbleImage", ReversibleClip);
#endinitclip
Symbol 487 MovieClip [earbutton] Frame 1
#initclip 259
Object.registerClass("earbutton", Noticer);
#endinitclip
Symbol 488 MovieClip [draggable] Frame 1
#initclip 260
Object.registerClass("draggable", Draggable);
#endinitclip
Symbol 494 MovieClip [ball] Frame 1
#initclip 261
Object.registerClass("ball", Draggable);
#endinitclip
Symbol 502 MovieClip [springKnob] Frame 1
#initclip 262
Object.registerClass("springKnob", SpringKnob);
#endinitclip
stop();
Symbol 505 MovieClip Frame 1
stop();
Symbol 514 MovieClip [hairMask] Frame 1
stop();
Symbol 556 MovieClip [hairGrow] Frame 1
#initclip 263
Object.registerClass("hairGrow", ReversibleClip);
#endinitclip
Symbol 556 MovieClip [hairGrow] Frame 41
if (_animDir == 1) {
SoundManager.playSound("knobPop");
}
Symbol 556 MovieClip [hairGrow] Frame 46
stop();
Symbol 557 MovieClip [hingedObject] Frame 1
#initclip 264
Object.registerClass("hingedObject", HingedObject);
#endinitclip
stop();
Symbol 562 MovieClip [handFront] Frame 1
#initclip 265
Object.registerClass("handFront", ReversibleClip);
#endinitclip
stop();
Symbol 569 MovieClip [handBack] Frame 1
#initclip 266
Object.registerClass("handBack", ReversibleClip);
#endinitclip
stop();
Symbol 574 MovieClip [hand] Frame 1
#initclip 267
Object.registerClass("hand", Hand);
#endinitclip
Symbol 577 MovieClip [hair] Frame 1
#initclip 268
Object.registerClass("hair", Hair);
#endinitclip
Symbol 578 MovieClip [tearDropMaker] Frame 1
#initclip 269
Object.registerClass("tearDropMaker", TearDropMaker);
#endinitclip
Symbol 595 MovieClip Frame 1
stop();
Symbol 595 MovieClip Frame 12
_parent.onDone();
Symbol 598 MovieClip [tearDrop] Frame 1
#initclip 270
Object.registerClass("tearDrop", TearDrop);
#endinitclip
Symbol 609 MovieClip [eyeShape] Frame 1
#initclip 271
Object.registerClass("eyeShape", ReversibleClip);
#endinitclip
stop();
Symbol 610 MovieClip [eyeForm] Frame 1
#initclip 272
Object.registerClass("eyeForm", EyeShape);
#endinitclip
Symbol 611 MovieClip [eyeRoll] Frame 1
#initclip 273
Object.registerClass("eyeRoll", ReversibleClip);
#endinitclip
stop();
Symbol 613 MovieClip Frame 1
stop();
Symbol 614 MovieClip [eye] Frame 1
#initclip 274
Object.registerClass("eye", ReversibleClip);
#endinitclip
stop();
Symbol 614 MovieClip [eye] Frame 12
if (_animDir == -1) {
emitEye();
}
Symbol 614 MovieClip [eye] Frame 65
onReady();
stop();
Symbol 626 MovieClip Frame 1
stop();
Symbol 627 MovieClip [hatchContent] Frame 1
stop();
Symbol 630 MovieClip [head_top] Frame 1
#initclip 275
Object.registerClass("head_top", SuperClip);
#endinitclip
stop();
Symbol 630 MovieClip [head_top] Frame 2
stop();
Symbol 631 MovieClip [headAnimForm] Frame 1
#initclip 276
Object.registerClass("headAnimForm", AnimForm);
#endinitclip
Instance of Symbol 630 MovieClip [head_top] "top" in Symbol 631 MovieClip [headAnimForm] Frame 1
/* no clip actions */
Symbol 636 MovieClip [head] Frame 1
#initclip 277
Object.registerClass("head", Head);
#endinitclip
Symbol 637 MovieClip [walkingNose] Frame 1
#initclip 278
Object.registerClass("walkingNose", WalkingNose);
#endinitclip
Symbol 638 MovieClip [trycloid] Frame 1
#initclip 279
Object.registerClass("trycloid", Trycloid);
#endinitclip
Symbol 639 MovieClip [trunkNoseShape] Frame 1
#initclip 280
Object.registerClass("trunkNoseShape", TrunkShape);
#endinitclip
Symbol 640 MovieClip [trunk] Frame 1
#initclip 281
Object.registerClass("trunk", Trunk);
#endinitclip
Symbol 641 MovieClip [branch] Frame 1
#initclip 282
Object.registerClass("branch", Branch);
#endinitclip
Symbol 642 MovieClip [treeNoseShape] Frame 1
#initclip 283
Object.registerClass("treeNoseShape", TreeShape);
#endinitclip
Symbol 648 MovieClip [pipeNoseShape] Frame 1
#initclip 284
Object.registerClass("pipeNoseShape", PipeShape);
#endinitclip
Symbol 649 MovieClip [growNose] Frame 1
#initclip 285
Object.registerClass("growNose", Nose);
#endinitclip
Symbol 650 MovieClip [flyingNose] Frame 1
#initclip 286
Object.registerClass("flyingNose", FlyingNose);
#endinitclip
Symbol 653 MovieClip [floatingNose] Frame 1
#initclip 287
Object.registerClass("floatingNose", Draggable);
#endinitclip
Symbol 657 MovieClip [fanNoseShape] Frame 1
#initclip 288
Object.registerClass("fanNoseShape", FanShape);
#endinitclip
Symbol 669 MovieClip [chirpForm] Frame 1
#initclip 289
Object.registerClass("chirpForm", ReversibleClip);
#endinitclip
Symbol 670 MovieClip [chirpNoseShape] Frame 1
#initclip 290
Object.registerClass("chirpNoseShape", ChirpShape);
#endinitclip
Symbol 697 MovieClip [cannonNoseShapeAnim] Frame 1
#initclip 291
Object.registerClass("cannonNoseShapeAnim", ReversibleClip);
#endinitclip
stop();
Symbol 702 MovieClip [cannonFuse] Frame 1
#initclip 292
Object.registerClass("cannonFuse", CannonFuse);
#endinitclip
Symbol 704 MovieClip [cannonNoseShape] Frame 1
#initclip 293
Object.registerClass("cannonNoseShape", CannonShape);
#endinitclip
Symbol 715 MovieClip [pufflet] Frame 1
#initclip 294
Object.registerClass("pufflet", Pufflet);
#endinitclip
Symbol 715 MovieClip [pufflet] Frame 11
stop();
Symbol 718 MovieClip [smokePuff] Frame 1
#initclip 295
Object.registerClass("smokePuff", SmokePuff);
#endinitclip
Symbol 719 MovieClip [treeTip] Frame 1
#initclip 296
Object.registerClass("treeTip", TreeTip);
#endinitclip
Symbol 720 MovieClip [node] Frame 1
#initclip 297
Object.registerClass("node", Node);
#endinitclip
Symbol 721 MovieClip [limb] Frame 1
#initclip 298
Object.registerClass("limb", TreeLimb);
#endinitclip
Symbol 730 MovieClip [fruitShape] Frame 1
#initclip 299
Object.registerClass("fruitShape", SingingFruit);
#endinitclip
stop();
Symbol 731 MovieClip [fruit] Frame 1
#initclip 300
Object.registerClass("fruit", TreeFruit);
#endinitclip
Symbol 732 MovieClip [arm] Frame 1
#initclip 301
Object.registerClass("arm", TreeLimbArm);
#endinitclip
Symbol 740 MovieClip Frame 1
stop();
Symbol 740 MovieClip Frame 2
stop();
Symbol 741 MovieClip [projector] Frame 1
#initclip 302
Object.registerClass("projector", Projector);
#endinitclip
stop();
Symbol 745 MovieClip [knockFlash] Frame 12
onDone();
Symbol 747 MovieClip [birdPointMarker] Frame 1
#initclip 199
Object.registerClass("birdPointMarker", BirdPointMarker);
#endinitclip
Symbol 750 MovieClip [birdPlaceHolder] Frame 1
#initclip 200
Object.registerClass("birdPlaceHolder", BirdPlaceHolder);
#endinitclip
Symbol 752 MovieClip [birdTwistor] Frame 1
#initclip 201
Object.registerClass("birdTwistor", BirdTwistor);
#endinitclip
Symbol 754 MovieClip [birdShape] Frame 1
#initclip 202
Object.registerClass("birdShape", BirdShape);
#endinitclip
Symbol 755 MovieClip [birdGrouper] Frame 1
#initclip 203
Object.registerClass("birdGrouper", BirdGrouper);
#endinitclip
stop();
Symbol 756 MovieClip [birdClusterShell] Frame 1
function doIntro(callBack) {
cluster.doIntro(callBack);
}
function activate(callBack) {
cluster.activate(callBack);
}
Symbol 770 MovieClip [hintForm] Frame 1
#initclip 204
Object.registerClass("hintForm", ReversibleClip);
#endinitclip
Symbol 774 MovieClip Frame 1
stop();
Symbol 779 MovieClip Frame 1
stop();
Symbol 786 MovieClip [fish] Frame 1
#initclip 205
Object.registerClass("fish", Fish);
#endinitclip
Symbol 788 MovieClip [fishTank] Frame 1
#initclip 206
Object.registerClass("fishTank", FishTank);
#endinitclip
Symbol 788 MovieClip [fishTank] Frame 2
stop();
Symbol 790 MovieClip [fishFood] Frame 1
#initclip 207
Object.registerClass("fishFood", FishFood);
#endinitclip
Symbol 790 MovieClip [fishFood] Frame 2
stop();
Symbol 795 MovieClip [floatingBall] Frame 1
#initclip 208
Object.registerClass("floatingBall", FloatingBall);
#endinitclip
Symbol 798 MovieClip [rippleCluster] Frame 46
this.removeMovieClip();
Symbol 799 MovieClip [fishTankShell] Frame 1
stop();
Symbol 820 MovieClip [obstacle] Frame 1
#initclip 303
Object.registerClass("obstacle", Obstacle);
#endinitclip
Symbol 824 MovieClip [pedestal] Frame 1
#initclip 304
Object.registerClass("pedestal", GroundObject);
#endinitclip
stop();
Symbol 824 MovieClip [pedestal] Frame 31
this.removeMovieClip();
Symbol 825 MovieClip Frame 1
_parent.addBurst(this);
Symbol 826 MovieClip [fireWork] Frame 1
#initclip 305
Object.registerClass("fireWork", FireWork);
#endinitclip
Symbol 827 MovieClip [obstacleMeter] Frame 1
#initclip 306
Object.registerClass("obstacleMeter", SuccessDisplay);
#endinitclip
Symbol 828 MovieClip [obstacleMeterUnit] Frame 1
#initclip 307
Object.registerClass("obstacleMeterUnit", ReversibleClip);
#endinitclip
Symbol 829 MovieClip Frame 1
stop();