Frame 1
stop();
Frame 2
var types = new Array("straight", "straight", "straight", "straight", "t", "bend", "bend", "bend", "bend", "cross");
pipes_game = new PipesGame(this, 5, 7, types);
stop();
Symbol 12 MovieClip Frame 1
stop();
Symbol 17 MovieClip Frame 3
stop();
Symbol 21 MovieClip Frame 10
stop();
_parent._parent._parent._parent.obj.onFlowAnim();
Symbol 22 MovieClip Frame 1
stop();
Symbol 27 MovieClip Frame 3
stop();
Symbol 30 MovieClip Frame 10
stop();
_parent._parent._parent._parent.obj.onFlowAnim();
Symbol 31 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 3
stop();
Symbol 42 MovieClip Frame 3
stop();
Symbol 45 MovieClip Frame 10
stop();
_parent._parent._parent._parent.obj.onFlowAnim();
Symbol 46 MovieClip Frame 1
stop();
Symbol 48 MovieClip Frame 4
stop();
Symbol 59 MovieClip [bar_mc] Frame 1
stop();
Symbol 59 MovieClip [bar_mc] Frame 10
obj.onBarAppear(this);
Symbol 59 MovieClip [bar_mc] Frame 47
obj.onBarAnim(this);
Symbol 59 MovieClip [bar_mc] Frame 85
obj.onBarFinished(this);
Symbol 68 MovieClip [bar_animation_mc] Frame 192
_parent._parent.augustus.throat.gotoAndPlay("SWALLOW");
Symbol 68 MovieClip [bar_animation_mc] Frame 211
obj.onChocolateSwallowed(this);
Symbol 98 MovieClip Frame 27
function checkLoad() {
var _local2 = _parent.getBytesTotal();
var _local3 = _parent.getBytesLoaded();
var pct = (_local3 / _local2);
var cf = progress_mc._currentframe;
var _local1 = progress_mc._totalframes;
var f = Math.ceil(_local1 * pct);
if (f > cf) {
progress_mc.play();
} else {
progress_mc.stop();
}
if ((((_local3 == _local2) && (_local2 > 20)) && (cf == _local1)) && (_local1)) {
delete this.onEnterFrame;
gotoAndPlay ("OUT");
}
}
stop();
this.onEnterFrame = checkLoad;
Symbol 98 MovieClip Frame 42
stop();
_parent.gotoAndPlay("IN");
Symbol 267 MovieClip [__Packages.PipesGame] Frame 0
class PipesGame
{
var snd_loop, mc, points;
function PipesGame (mc, row, col, types) {
var _local1 = this;
_local1.mc = mc;
_local1.row = row;
_local1.col = col;
_local1.types = types;
_local1.state = "START SCREEN";
}
function startGame() {
var _local1 = this;
_local1.startGameLoop();
_local1.mc.gotoAndStop("GAME");
_local1.enable(_local1.mc);
_local1.state = "PLAYING";
_local1.pipe_l = 50;
_local1.p_index = 0;
_local1.b_index = 0;
_local1.quota = 10;
_local1.points = 0;
_local1.value_bar = 1250;
_local1.buildPipes(_local1.row, _local1.col);
_local1.buildBars(_local1.col);
_local1.initPipes(_local1.row, _local1.col);
_local1.refresh();
_local1.refreshScore();
_local1.gauge = new Gauge(_local1.mc.gauge_mc, 270, 1000, _local1);
}
function buildPipes() {
var _local3 = this;
_local3.pipes = new Object();
var _local2 = 0;
while (_local2 <= _local3.row) {
_local3.pipes[_local2] = new Array();
var _local1 = 0;
while (_local1 <= _local3.col) {
_local3.buildPipe(_local2, _local1);
_local1++;
}
_local2++;
}
}
function buildPipe(i, j, l) {
var _local1 = this;
var new_name = ("pipe_" + _local1.p_index);
var new_level = (100 + _local1.p_index);
var _local2 = _local1.mc.pipes_mc.attachMovie("pipe_mc", new_name, new_level);
if (l != undefined) {
_local2._x = _local2._x + (((_local1.col + (j - l)) + 1) * _local1.pipe_l);
} else {
_local2._x = _local2._x + (_local1.pipe_l * j);
}
_local2._y = _local2._y + (_local1.pipe_l * i);
var _local3 = new Pipe(_local1, _local2, i, j, _local1.types);
_local1.pipes[i][j] = _local3;
_local1.p_index++;
return(_local3);
}
function initPipes() {
var _local3 = this;
var _local2 = 0;
while (_local2 <= _local3.row) {
var _local1 = 0;
while (_local1 <= _local3.col) {
_local3.pipes[_local2][_local1].init();
_local1++;
}
_local2++;
}
}
function buildBars(c) {
var _local2 = c;
var _local3 = this;
var _local1 = 0;
while (_local1 <= _local2) {
_local3.buildBar(_local1);
_local1++;
}
}
function buildBar(i) {
var _local1 = this;
trace("buildBar");
var y = ((_local1.pipe_l * _local1.row) + 100);
var x = (_local1.pipe_l * i);
_local1.b_index++;
var new_name = ("bar_" + i);
var _local3 = 100 + _local1.b_index;
var _local2 = _local1.mc.bars_mc.attachMovie("bar_mc", new_name, _local3);
_local2._x = x;
_local2._y = y;
_local2.obj = _local1;
}
function rebuildPipes() {
var _local2 = this;
var _local1 = 0;
while (_local1 <= _local2.row) {
_local2.rebuildRow(_local1);
_local1++;
}
_local2.initPipes();
_local2.refresh();
}
function rebuildRow(n) {
var _local3 = this;
var _local2 = _local3.pipes[n];
var _local1 = 0;
while (_local1 < _local2.length) {
var p = _local2[_local1];
if (p.state == "OFF") {
_local2.splice(_local1, 1);
} else {
_local1++;
}
}
_local1 = 0;
while (_local1 <= _local3.col) {
var p = _local2[_local1];
p.resetCol(_local1);
p.slideOver();
_local1++;
}
var l = _local2.length;
_local1 = l;
while (_local1 <= _local3.col) {
var p = _local3.buildPipe(n, _local1, l);
p.slideOver();
_local1++;
}
}
function startGameLoop() {
var _local1 = this;
trace("Game Sound Starting...");
if (_local1.snd_loop == undefined) {
_local1.snd_loop = new Sound();
}
_local1.snd_loop.attachSound("bg_loop");
_local1.snd_loop.onSoundComplete = function () {
this.snd_loop.start(0, 9999);
};
_local1.snd_loop.setVolume(10);
_local1.snd_loop.start(0, 99999);
}
function stopGameLoop() {
snd_loop.stop();
}
function startRandomAugustusSound() {
var _local2 = this;
var $sound = new Sound();
var _local1 = random(_local2.augustus_sounds.length);
trace(_local1);
$sound.onSoundComplete = function () {
delete $sound;
};
$sound.attachSound(_local2.augustus_sounds[_local1]);
$sound.start();
trace("Augustus says: " + _local2.augustus_sounds[_local1]);
}
function score(p) {
var _local1 = mc.bars_mc["bar_" + p.col];
_local1.gotoAndPlay("IN");
}
function refreshScore() {
var m = mc.scoreboard_mc.score_mc;
var _local3 = String(points).split("").reverse();
trace("Points: " + _local3);
var _local1 = 0;
while (_local1 <= 4) {
var _local2 = m[("d_" + _local1) + "_tf"];
((_local3[_local1] != undefined) ? ((_local2.text = _local3[_local1])) : ((_local2.text = "0")));
_local1++;
}
}
function refresh() {
var _local1 = this;
_local1.checkLinks();
_local1.checkFlows();
_local1.updatePipes();
}
function checkLinks() {
var _local3 = this;
var _local2 = 0;
while (_local2 <= _local3.row) {
var _local1 = 0;
while (_local1 <= _local3.col) {
_local3.pipes[_local2][_local1].setLinks();
_local1++;
}
_local2++;
}
}
function checkFlows() {
var _local2 = this;
var _local1 = 0;
while (_local1 <= _local2.col) {
_local2.pipes[0][_local1].startFlowCheck();
_local1++;
}
}
function clearFlow() {
var _local3 = this;
var _local2 = 0;
while (_local2 <= _local3.row) {
var _local1 = 0;
while (_local1 <= _local3.col) {
_local3.pipes[_local2][_local1].clearFlow();
_local1++;
}
_local2++;
}
_local3.rebuildPipes();
}
function updatePipes() {
var _local3 = this;
var _local2 = 0;
while (_local2 <= _local3.row) {
var _local1 = 0;
while (_local1 <= _local3.col) {
_local3.pipes[_local2][_local1].update();
_local1++;
}
_local2++;
}
}
function startChoc(orig_p) {
var _local1 = this;
_local1.state = "CHOC";
orig_p.startChoc(2);
_local1.gauge.stop();
_local1.gauge.rewind();
_local1.mc.steam_mc.gotoAndPlay("STEAM");
}
function startConveyerBelt($bar_mc) {
var _local1 = Number($bar_mc._name.split("_")[$bar_mc._name.split("_").length - 1]) + 1;
var _local2 = mc.conveyer_mc.attachMovie("bar_animation_mc", ("conveyer_" + _local1) + random(100), random(100) + _local1);
_local2.obj = this;
_local2.number = _local1 - 1;
_local2.gotoAndPlay("PIPE_" + _local1);
}
function onStartGame() {
var _local1 = this;
_local1.gauge.reset();
_local1.total_bars_eaten = 0;
for (var _local3 in _local1.mc.bars_mc) {
_local1.mc.bars_mc[_local3].removeMovieClip();
}
for (var _local2 in _local1.mc.pipes_mc) {
_local1.mc.pipes_mc[_local2].removeMovieClip();
}
_local1.mc.augustus.gotoAndPlay(1);
_local1.forcePlay(_local1.mc.belt_loop);
_local1.refresh();
_local1.startGame();
}
function onPipePress() {
refresh();
}
function onCompleteFlow(orig_p) {
startChoc(orig_p);
}
function onBarAnim($bar_mc) {
startConveyerBelt($bar_mc);
}
function onBarFinished($bar_mc) {
var _local1 = this;
trace(("This piece of candy has finished: " + $bar_mc) + ". Now checking to see if we should add to the score...");
_local1.add_to_score = _local1.add_to_score + 100;
_local1.candy_onscreen.shift();
if (_local1.candy_onscreen.length <= 0) {
_local1.gauge.resume();
_local1.state = "PLAYING";
_local1.clearFlow();
_local1.points = _local1.points + _local1.add_to_score;
_local1.add_to_score = 0;
_local1.refreshScore();
} else {
_local1.add_to_score = _local1.add_to_score + 25;
}
}
function onBarAppear($bar_mc) {
trace("Bar has appeared!: " + $bar_mc);
candy_onscreen.push($bar_mc);
}
function onChocolateSwallowed($bar_animation_mc) {
trace(("Mmmm! Delicious. " + $bar_animation_mc) + " was just eaten.");
total_bars_eaten = total_bars_eaten + 1;
$bar_animation_mc.removeMovieClip();
startRandomAugustusSound();
}
function onGameOver() {
var _local1 = this;
_local1.stopGameLoop();
_local1.first_run = false;
_local1.disable(_local1.mc);
_local1.gauge.stopShake();
_local1.mc.gotoAndStop("LOSE");
_local1.mc.restart_game.onRelease = mx.utils.Delegate.create(_local1, _local1.onStartGame);
}
function onGameOverScreen() {
var _local1 = this;
_local1.mc.results.bars_txt.text = _local1.total_bars_eaten;
_local1.mc.results.score_txt.text = _local1.points;
}
function onGameOverButtons() {
var _local1 = this;
_local1.mc.results.playagain_btn.onRelease = mx.utils.Delegate.create(_local1, _local1.onStartGame);
_local1.mc.results.playagain_btn.onRollOver = mx.utils.Delegate.create(_local1, _local1.onPlayAgainOver);
_local1.mc.results.playagain_btn.onRollOut = (_local1.mc.results.playagain_btn.onReleaseOutside = mx.utils.Delegate.create(_local1, _local1.onPlayAgainOut));
}
function onStartGameButton() {
var _local1 = this;
_local1.mc.startscreen.start_btn.onRelease = mx.utils.Delegate.create(_local1, _local1.onStartGame);
_local1.mc.startscreen.start_btn.onRollOver = mx.utils.Delegate.create(_local1, _local1.onStartButtonOver);
_local1.mc.startscreen.start_btn.onRollOut = (_local1.mc.startscreen.start_btn.onReleaseOutside = mx.utils.Delegate.create(_local1, _local1.onStartButtonOut));
}
function onStartButtonOut() {
mc.startscreen.startgame.gotoAndPlay("OUT");
}
function onStartButtonOver() {
mc.startscreen.startgame.gotoAndPlay("OVER");
}
function onPlayAgainOut() {
mc.results.playagain.gotoAndPlay("OUT");
}
function onPlayAgainOver() {
mc.results.playagain.gotoAndPlay("OVER");
}
function disable($m) {
var _local1 = $m;
var _local3 = this;
var _local2;
for (_local2 in _local1) {
if (typeof(_local1[_local2]) == "movieclip") {
_local1[_local2].enabled = false;
_local1[_local2].stop();
_local3.disable(_local1[_local2]);
} else if (typeof(_local1[_local2]) == "object") {
_local1[_local2].enabled = false;
}
_local1.enabled = false;
}
}
function enable($m) {
var _local1 = $m;
var _local3 = this;
var _local2;
for (_local2 in _local1) {
if (typeof(_local1[_local2]) == "movieclip") {
_local1[_local2].enabled = true;
_local3.enable(_local1[_local2]);
} else if (typeof(_local1[_local2]) == "object") {
_local1[_local2].enabled = true;
}
_local1.enabled = true;
}
}
function forcePlay($m) {
var _local1 = $m;
var _local3 = this;
var _local2;
for (_local2 in _local1) {
_local1[_local2].play();
if (typeof(_local1[_local2]) == "movieclip") {
_local3.forcePlay(_local1[_local2]);
}
}
_local1.play();
}
var first_run = true;
var total_bars_eaten = 0;
var augustus_sounds = ["burp", "chomp1", "chomp2", "chomp3", "hiccup", "mmmm", "morecandy"];
var candy_onscreen = [];
}
Symbol 268 MovieClip [__Packages.Misc.Shaker] Frame 0
class Misc.Shaker
{
function Shaker (mc, strength, dur) {
var _local1 = this;
var _local2 = mc;
_local1.mc = _local2;
_local1.strength = strength;
_local1.dur = dur;
_local1.orig_x = _local2._x;
_local1.orig_y = _local2._y;
}
function shake(d, s) {
var _local1 = this;
var _local2 = d;
var _local3 = s;
if (_local2 == undefined) {
_local2 = _local1.dur;
}
if (_local3 == undefined) {
_local3 = _local1.strength;
}
_local1.shake_index = 0;
_local1.buildShakeArray(_local2, _local3);
clearInterval(_local1.shake_int);
_local1.shake_int = setInterval(_local1, "doShake", 10);
}
function doShake() {
var _local1 = this;
var _local2 = _local1.shake_arr[_local1.shake_index];
_local1.mc._x = _local2.x;
_local1.mc._y = _local2.y;
_local1.shake_index++;
if (_local1.shake_index >= _local1.shake_arr.length) {
_local1.onShakeComplete();
}
}
function buildShakeArray(dur, strength) {
var _local2 = this;
var _local3 = dur;
_local2.shake_arr = new Array();
var _local1 = 0;
while (_local1 < _local3) {
_local2.shake_arr[_local1] = _local2.getShakeCoords(strength);
_local1++;
}
}
function getShakeCoords(strength) {
var _local1 = this;
var _local2 = strength;
var d_x = bsMath.getRandom(_local1.orig_x - _local2, _local1.orig_x + _local2);
var _local3 = bsMath.getRandom(_local1.orig_y - _local2, _local1.orig_y + _local2);
return({x:d_x, y:_local3});
}
function onShakeComplete() {
var _local1 = this;
_local1.mc._x = _local1.orig_x;
_local1.mc._y = _local1.orig_y;
clearInterval(_local1.shake_int);
}
}
Symbol 269 MovieClip [__Packages.bsMath] Frame 0
class bsMath extends Math
{
function bsMath () {
super();
}
static function getRandom(min_num, max_num) {
return(min_num + Math.floor(Math.random() * ((max_num + 1) - min_num)));
}
static function toRadians(d) {
return((d / 180) * Math.PI);
}
static function toDegrees(r) {
return((r / Math.PI) * 180);
}
static function linearTween(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInQuad(t, b, c, d) {
return(((c * ((t = t / d))) * t) + b);
}
static function easeOutQuad(t, b, c, d) {
return((((-c) * ((t = t / d))) * (t - 2)) + b);
}
static function easeInOutQuad(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((c / 2) * _local1) * _local1) + b);
}
_local1--;
return((((-c) / 2) * ((_local1 * (_local1 - 2)) - 1)) + b);
}
static function easeInCubic(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / d;
return((((c * _local1) * _local1) * _local1) + b);
}
static function easeOutCubic(t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return((c * (((_local1 * _local1) * _local1) + 1)) + b);
}
static function easeInOutCubic(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((c / 2) * _local1) * _local1) * _local1) + b);
}
_local1 = _local1 - 2;
return(((c / 2) * (((_local1 * _local1) * _local1) + 2)) + b);
}
static function easeInQuart(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / d;
return(((((c * _local1) * _local1) * _local1) * _local1) + b);
}
static function easeOutQuart(t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return(((-c) * ((((_local1 * _local1) * _local1) * _local1) - 1)) + b);
}
static function easeInOutQuart(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((((c / 2) * _local1) * _local1) * _local1) * _local1) + b);
}
_local1 = _local1 - 2;
return((((-c) / 2) * ((((_local1 * _local1) * _local1) * _local1) - 2)) + b);
}
static function easeInQuint(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / d;
return((((((c * _local1) * _local1) * _local1) * _local1) * _local1) + b);
}
static function easeOutQuint(t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return((c * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 1)) + b);
}
static function easeInOutQuint(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((((c / 2) * _local1) * _local1) * _local1) * _local1) * _local1) + b);
}
_local1 = _local1 - 2;
return(((c / 2) * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 2)) + b);
}
static function easeInSine(t, b, c, d) {
return((((-c) * Math.cos((t / d) * (Math.PI/2))) + c) + b);
}
static function easeOutSine(t, b, c, d) {
return((c * Math.sin((t / d) * (Math.PI/2))) + b);
}
static function easeInOutSine(t, b, c, d) {
return((((-c) / 2) * (Math.cos((Math.PI * t) / d) - 1)) + b);
}
static function easeInExpo(t, b, c, d) {
return(((t == 0) ? (b) : ((c * Math.pow(2, 10 * ((t / d) - 1))) + b)));
}
static function easeOutExpo(t, b, c, d) {
return(((t == d) ? (b + c) : ((c * ((-Math.pow(2, (-10 * t) / d)) + 1)) + b)));
}
static function easeInOutExpo(t, b, c, d) {
var _local1 = t;
var _local2 = b;
var _local3 = c;
if (_local1 == 0) {
return(_local2);
}
if (_local1 == d) {
return(_local2 + _local3);
}
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((_local3 / 2) * Math.pow(2, 10 * (_local1 - 1))) + _local2);
}
_local1--;
return(((_local3 / 2) * ((-Math.pow(2, -10 * _local1)) + 2)) + _local2);
}
static function easeInCirc(t, b, c, d) {
return(((-c) * (Math.sqrt(1 - (((t = t / d)) * t)) - 1)) + b);
}
static function easeOutCirc(t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return((c * Math.sqrt(1 - (_local1 * _local1))) + b);
}
static function easeInOutCirc(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((-c) / 2) * (Math.sqrt(1 - (_local1 * _local1)) - 1)) + b);
}
_local1 = _local1 - 2;
return(((c / 2) * (Math.sqrt(1 - (_local1 * _local1)) + 1)) + b);
}
static function easeInElastic(t, b, c, d, a, p) {
var _local1 = p;
var _local2 = t;
var _local3 = c;
if (_local2 == 0) {
return(b);
}
_local2 = _local2 / d;
if (_local2 == 1) {
return(b + _local3);
}
if (!_local1) {
_local1 = d * 0.3;
}
if (a < Math.abs(_local3)) {
a = _local3;
var s = (_local1 / 4);
} else {
var s = ((_local1 / (Math.PI*2)) * Math.asin(_local3 / a));
}
_local2 = _local2 - 1;
return((-((a * Math.pow(2, 10 * _local2)) * Math.sin((((_local2 * d) - s) * (Math.PI*2)) / _local1))) + b);
}
static function easeOutElastic(t, b, c, d, a, p) {
var _local1 = c;
var _local2 = p;
var _local3 = t;
if (_local3 == 0) {
return(b);
}
_local3 = _local3 / d;
if (_local3 == 1) {
return(b + _local1);
}
if (!_local2) {
_local2 = d * 0.3;
}
if (a < Math.abs(_local1)) {
a = _local1;
var s = (_local2 / 4);
} else {
var s = ((_local2 / (Math.PI*2)) * Math.asin(_local1 / a));
}
return((((a * Math.pow(2, -10 * _local3)) * Math.sin((((_local3 * d) - s) * (Math.PI*2)) / _local2)) + _local1) + b);
}
static function easeInOutElastic(t, b, c, d, a, p) {
var _local1 = t;
var _local2 = p;
var _local3 = c;
if (_local1 == 0) {
return(b);
}
_local1 = _local1 / (d / 2);
if (_local1 == 2) {
return(b + _local3);
}
if (!_local2) {
_local2 = d * 0.45;
}
if (a < Math.abs(_local3)) {
a = _local3;
var s = (_local2 / 4);
} else {
var s = ((_local2 / (Math.PI*2)) * Math.asin(_local3 / a));
}
if (_local1 < 1) {
_local1 = _local1 - 1;
return((-0.5 * ((a * Math.pow(2, 10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / _local2))) + b);
}
_local1 = _local1 - 1;
return(((((a * Math.pow(2, -10 * _local1)) * Math.sin((((_local1 * d) - s) * (Math.PI*2)) / _local2)) * 0.5) + _local3) + b);
}
static function easeInBack(t, b, c, d, s) {
var _local1 = s;
var _local2 = t;
if (_local1 == undefined) {
_local1 = 1.70158;
}
_local2 = _local2 / d;
return((((c * _local2) * _local2) * (((_local1 + 1) * _local2) - _local1)) + b);
}
static function easeOutBack(t, b, c, d, s) {
var _local1 = t;
var _local2 = s;
if (_local2 == undefined) {
_local2 = 1.70158;
}
_local1 = (_local1 / d) - 1;
return((c * (((_local1 * _local1) * (((_local2 + 1) * _local1) + _local2)) + 1)) + b);
}
static function easeInOutBack(t, b, c, d, s) {
var _local1 = t;
var _local2 = s;
if (_local2 == undefined) {
_local2 = 1.70158;
}
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
_local2 = _local2 * 1.525;
return(((c / 2) * ((_local1 * _local1) * (((_local2 + 1) * _local1) - _local2))) + b);
}
_local1 = _local1 - 2;
_local2 = _local2 * 1.525;
return(((c / 2) * (((_local1 * _local1) * (((_local2 + 1) * _local1) + _local2)) + 2)) + b);
}
static function easeInBounce(t, b, c, d) {
return((c - easeOutBounce(d - t, 0, c, d)) + b);
}
static function easeOutBounce(t, b, c, d) {
var _local1 = t;
var _local2 = c;
var _local3 = b;
_local1 = _local1 / d;
if (_local1 < 0.363636363636364) {
return((_local2 * ((7.5625 * _local1) * _local1)) + _local3);
}
if (_local1 < 0.727272727272727) {
_local1 = _local1 - 0.545454545454545;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.75)) + _local3);
}
if (_local1 < 0.909090909090909) {
_local1 = _local1 - 0.818181818181818;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.9375)) + _local3);
}
_local1 = _local1 - 0.954545454545455;
return((_local2 * (((7.5625 * _local1) * _local1) + 0.984375)) + _local3);
}
static function easeInOutBounce(t, b, c, d) {
var _local1 = d;
var _local2 = t;
var _local3 = c;
if (_local2 < (_local1 / 2)) {
return((easeInBounce(_local2 * 2, 0, _local3, _local1) * 0.5) + b);
}
return(((easeOutBounce((_local2 * 2) - _local1, 0, _local3, _local1) * 0.5) + (_local3 * 0.5)) + b);
}
}
Symbol 270 MovieClip [__Packages.Gauge] Frame 0
class Gauge
{
var percent_filled, shake_int, rot_tween, start_rotation, needle;
function Gauge (mc, rot_max, dur, obj) {
var _local1 = this;
var _local2 = mc;
_local1.mc = _local2;
_local1.needle = _local2.needle_mc;
if (_local1.start_rotation == undefined) {
_local1.start_rotation = _local1.needle._rotation;
}
_local1.rot_init = _local1.needle._rotation;
_local1.rot_min = _local1.rot_init;
_local1.rot_max = _local1.rot_init + rot_max;
_local1.dur = dur;
_local1.game = obj;
_local1.forward();
_local2.onEnterFrame = mx.utils.Delegate.create(_local1, _local1.traceRotation);
_local1.shaker = new Misc.Shaker(_local2, 5, 10);
_local1.shake_int = setInterval(_local1, "shake", 3000);
}
function shake() {
var _local2 = Math.round(10 * percent_filled);
var _local1 = 30;
trace((("shake : " add _local2) add ", ") add _local1);
shaker.shake(_local1, _local2);
var $snd = new Sound();
$snd.onSoundComplete = function () {
delete $snd;
};
$snd.attachSound("rattle");
$snd.start();
}
function stopShake() {
clearInterval(shake_int);
shake_int = undefined;
}
function traceRotation() {
var _local1 = this;
var _local2 = _local1.needle._rotation;
var _local3 = Math.abs(_local2 - _local1.rot_min) / Math.abs(_local1.rot_max - _local1.rot_min);
_local1.percent_filled = Math.round(_local3 * 100) / 100;
}
function rotateNeedle(r, e, d) {
var _local1 = this;
trace("\trotateNeedle: " add arguments);
if (!_local1.needle.onMotionFinished) {
_local1.needle.onMotionFinished = mx.utils.Delegate.create(_local1, _local1.onRotate);
}
var _local2 = mx.transitions.easing.Regular["ease" + e];
_local1.rot_tween = new mx.transitions.Tween(_local1.needle, "_rotation", _local2, _local1.needle._rotation, r, d);
_local1.rot_tween.addListener(_local1.needle);
}
function start() {
rot_tween.start();
}
function stop() {
rot_tween.stop();
}
function forward() {
var _local1 = this;
trace(" -> forward");
_local1.state = "INCREASING";
_local1.rotateNeedle(_local1.rot_max, "Out", _local1.dur);
}
function rewind() {
var _local1 = this;
var _local2 = 80;
trace(" <- rewind: " add _local2);
_local1.state = "REWINDING";
var _local3 = Math.max(_local1.needle._rotation - _local2, _local1.rot_min);
_local1.rotateNeedle(_local3, "Out", 20);
}
function resume() {
var _local1 = this;
_local1.state = "INCREASING";
trace("resume: " add _local1.percent_filled);
_local1.rot_tween.continueTo(_local1.rot_max, _local1.dur * (1 - _local1.percent_filled));
}
function reset() {
needle._rotation = start_rotation;
}
function checkComplete() {
var _local1 = this;
if (_local1.needle._rotation == _local1.rot_max) {
_local1.game.onGameOver();
stop();
}
}
function onRotate() {
var _local1 = this;
trace("onRotate: " add _local1.state);
switch (_local1.state) {
case "REWINDING" :
return;
case "INCREASING" :
_local1.checkComplete();
}
}
var shaker = Misc.Shaker;
}
Symbol 271 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 = func;
var _local3 = arguments;
var _local1 = function () {
var _local1 = arguments;
var _local2 = _local1.callee.target;
var _local3 = _local1.callee.func;
return(_local3.apply(_local2, _local1));
};
_local1.target = obj;
_local1.func = _local2;
return(_local1);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 272 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
return(((c * ((t = t / d))) * t) + b);
}
static function easeOut(t, b, c, d) {
return((((-c) * ((t = t / d))) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((c / 2) * _local1) * _local1) + b);
}
_local1--;
return((((-c) / 2) * ((_local1 * (_local1 - 2)) - 1)) + b);
}
}
Symbol 273 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local2 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local2);
var _local1 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local1.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
}
Symbol 274 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
var _local1 = o;
if (_local1.broadcastMessage != undefined) {
delete _local1.broadcastMessage;
}
_local1.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
_local1.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
_local1._listeners = new Array();
}
}
function addListener(o) {
var _local1 = this;
_local1.removeListener(o);
if (_local1.broadcastMessage == undefined) {
_local1.broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_local1._listeners.push(o));
}
function removeListener(o) {
var _local3 = this;
var _local1 = _local3._listeners;
var _local2 = _local1.length;
while (_local2--) {
if (_local1[_local2] == o) {
_local1.splice(_local2, 1);
if (!_local1.length) {
_local3.broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local3 = String(arguments.shift());
var _local2 = _listeners.concat();
var l = _local2.length;
var _local1 = 0;
while (_local1 < l) {
_local2[_local1][_local3].apply(_local2[_local1], arguments);
_local1++;
}
}
}
Symbol 275 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var _time, _duration, _fps, change, begin;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
var _local1 = this;
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
} else {
_local1.obj = obj;
_local1.prop = prop;
_local1.begin = begin;
_local1.__set__position(begin);
_local1.__set__duration(duration);
_local1.useSeconds = useSeconds;
if (func) {
_local1.func = func;
}
_local1.__set__finish(finish);
_local1._listeners = [];
_local1.addListener(_local1);
_local1.start();
}
}
function set time(t) {
var _local1 = this;
var _local2 = t;
_local1.prevTime = _local1._time;
if (_local2 > _local1.__get__duration()) {
if (_local1.looping) {
_local1.rewind(_local2 - _local1._duration);
_local1.update();
_local1.broadcastMessage("onMotionLooped", _local1);
} else {
if (_local1.useSeconds) {
_local1._time = _local1._duration;
_local1.update();
}
_local1.stop();
_local1.broadcastMessage("onMotionFinished", _local1);
}
} else if (_local2 < 0) {
_local1.rewind();
_local1.update();
} else {
_local1._time = _local2;
_local1.update();
}
//return(_local1.__get__time());
}
function get time() {
return(_time);
}
function set duration(d) {
var _local1 = d;
_duration = (((_local1 == null) || (_local1 <= 0)) ? (_global.Infinity) : (_local1));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local1 = this;
var _local2 = _local1.isPlaying;
_local1.stopEnterFrame();
_local1._fps = fps;
if (_local2) {
_local1.startEnterFrame();
}
//return(_local1.__get__FPS());
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
var _local1 = this;
_local1.prevPos = _local1._pos;
_local1.obj[_local1.prop] = (_local1._pos = p);
_local1.broadcastMessage("onMotionChanged", _local1, _local1._pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
var _local1 = this;
var _local2 = t;
if (_local2 == undefined) {
_local2 = _local1._time;
}
return(_local1.func(_local2, _local1.begin, _local1.change, _local1._duration));
}
function set finish(f) {
var _local1 = this;
_local1.change = f - _local1.begin;
//return(_local1.__get__finish());
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
var _local1 = this;
_local1.begin = _local1.position;
_local1.__set__finish(finish);
if (duration != undefined) {
_local1.__set__duration(duration);
}
_local1.start();
}
function yoyo() {
var _local1 = this;
_local1.continueTo(_local1.begin, _local1.__get__time());
}
function startEnterFrame() {
var _local1 = this;
if (_local1._fps == undefined) {
_global.MovieClip.addListener(_local1);
} else {
_local1._intervalID = setInterval(_local1, "onEnterFrame", 1000 / _local1._fps);
}
_local1.isPlaying = true;
}
function stopEnterFrame() {
var _local1 = this;
if (_local1._fps == undefined) {
_global.MovieClip.removeListener(_local1);
} else {
clearInterval(_local1._intervalID);
}
_local1.isPlaying = false;
}
function start() {
var _local1 = this;
_local1.rewind();
_local1.startEnterFrame();
_local1.broadcastMessage("onMotionStarted", _local1);
}
function stop() {
var _local1 = this;
_local1.stopEnterFrame();
_local1.broadcastMessage("onMotionStopped", _local1);
}
function resume() {
var _local1 = this;
_local1.fixTime();
_local1.startEnterFrame();
_local1.broadcastMessage("onMotionResumed", _local1);
}
function rewind(t) {
var _local1 = this;
_local1._time = ((t == undefined) ? 0 : (t));
_local1.fixTime();
_local1.update();
}
function fforward() {
var _local1 = this;
_local1.__set__time(_local1._duration);
_local1.fixTime();
}
function nextFrame() {
var _local1 = this;
if (_local1.useSeconds) {
_local1.__set__time((getTimer() - _local1._startTime) / 1000);
} else {
_local1.__set__time(_local1._time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
var _local1 = this;
if (!_local1.useSeconds) {
_local1.__set__time(_local1._time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
var _local1 = this;
if (_local1.useSeconds) {
_local1._startTime = getTimer() - (_local1._time * 1000);
}
}
function update() {
var _local1 = this;
_local1.__set__position(_local1.getPosition(_local1._time));
}
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 276 MovieClip [__Packages.Pipe] Frame 0
class Pipe
{
var col, state, mc;
function Pipe (parent, mc, row, col, types) {
var _local1 = this;
_local1.parent = parent;
_local1.mc = mc;
_local1.row = row;
_local1.col = col;
_local1.state = "IDLE";
_local1.setPipeType(types);
_local1.initOpenings();
_local1.mc.onRollOver = mx.utils.Delegate.create(_local1, _local1.onPipeOver);
_local1.mc.onRollOut = mx.utils.Delegate.create(_local1, _local1.onPipeOut);
_local1.mc.onPress = mx.utils.Delegate.create(_local1, _local1.onPipePress);
_local1.rot_matrix = new Object();
_local1.rot_matrix = {r0:new Array(2, 3, 0, 1), r1:new Array(1, 2, 3, 0), r2:new Array(0, 1, 2, 3), r3:new Array(3, 0, 1, 2), r4:new Array(2, 3, 0, 1)};
_local1.slider = new Misc.Slider(_local1, mc);
}
function init() {
var _local1 = this;
if (!_local1.mc.obj) {
_local1.mc.obj = _local1;
_local1.rotate(bsMath.getRandom(0, 3));
}
_local1.setNeighbors();
}
function resetCol(n) {
col = n;
}
function setPipeType(types) {
var _local1 = this;
var _local2 = bsMath.getRandom(0, types.length - 1);
_local1.p_type = types[_local2];
_local1.mc.master_mc.gotoAndStop(_local1.p_type);
}
function initOpenings() {
var _local1 = this;
switch (_local1.p_type) {
case "straight" :
_local1.openings = new Array(0, 2);
return;
case "t" :
_local1.openings = new Array(0, 1, 3);
return;
case "bend" :
_local1.openings = new Array(0, 1);
return;
case "cross" :
_local1.openings = new Array(0, 1, 2, 3);
}
}
function setNeighbors() {
var _local1 = this;
_local1.neighbors = new Array(_local1.getNeighbor(-1, 0), _local1.getNeighbor(0, 1), _local1.getNeighbor(1, 0), _local1.getNeighbor(0, -1));
}
function getNeighbor(r, c) {
var _local1 = this;
return(_local1.parent.pipes[_local1.row + r][_local1.col + c]);
}
function rotate(r) {
var _local1 = this;
if (_local1.p_type != "cross") {
_local1.mc._rotation = _local1.mc._rotation + (90 * r);
_local1.rotateOpenings(r);
_local1.state = "IDLE";
}
}
function rotateOpenings(r) {
var _local2 = this;
var _local3 = r;
for (var i in _local2.openings) {
var _local1 = _local2.openings[i] + _local3;
if (_local1 >= 4) {
_local1 = _local1 - 4;
}
_local2.openings[i] = _local1;
}
}
function update() {
switch (state) {
case "LINK" :
case "CHOCLINK" :
case "CHOCFLOW" :
return;
default :
idle();
}
}
function setLinks() {
var _local2 = this;
_local2.linked = new Array();
for (var _local3 in _local2.openings) {
var _local1 = _local2.openings[_local3];
if (_local2.neighbors[_local1].linkedTo(_local1)) {
_local2.linked[_local1] = _local2.neighbors[_local1];
}
}
_local2.is_linked = _local2.linked.length > 0;
if (_local2.is_linked) {
_local2.link();
}
}
function linkedTo(n) {
var _local1 = this;
var _local2 = ((n <= 1) ? (n + 2) : (n - 2));
for (var _local3 in _local1.openings) {
if (_local1.openings[_local3] == _local2) {
return(true);
}
}
return(false);
}
function startFlowCheck() {
var _local1 = this;
if (_local1.linkedTo(2)) {
_local1.chocLink(_local1);
}
}
function checkFlow(orig_p) {
var _local1 = this;
var _local2 = orig_p;
for (var _local3 in _local1.linked) {
_local1.linked[_local3].chocLink(_local2);
}
if (_local1.isFinalFlowPiece()) {
_local1.parent.onCompleteFlow(_local2);
}
}
function isFinalFlowPiece() {
var _local1 = this;
return((_local1.row == _local1.parent.row) and _local1.linkedTo(0));
}
function clearFlow() {
var _local1 = this;
if (_local1.state == "CHOCFLOW") {
_local1.state = "OFF";
_local1.mc.removeMovieClip();
}
}
function link() {
var _local1 = this;
if (_local1.state != "LINK") {
_local1.state = "LINK";
_local1.mc.master_mc.sub_mc.solid_mc.gotoAndStop(_local1.state);
}
}
function idle() {
var _local1 = this;
if (_local1.state != "IDLE") {
_local1.state = "IDLE";
_local1.mc.master_mc.sub_mc.solid_mc.gotoAndStop(_local1.state);
}
}
function chocLink(orig_p) {
var _local1 = this;
if (_local1.state != "CHOCLINK") {
_local1.state = "CHOCLINK";
_local1.mc.master_mc.sub_mc.solid_mc.gotoAndStop(_local1.state);
_local1.checkFlow(orig_p);
}
}
function startLinkedChoc() {
var _local1 = this;
for (var _local2 in _local1.linked) {
_local1.linked[_local2].startChoc(_local2);
}
}
function startChoc(n) {
var _local1 = this;
var _local3 = n;
if (_local1.state != "CHOCFLOW") {
_local1.state = "CHOCFLOW";
var k = ((_local3 <= 1) ? (Number(_local3) + 2) : (Number(_local3) - 2));
var _local2 = (_local1.mc._rotation / 90) + 2;
var f = _local1.rot_matrix["r" + _local2][k];
_local1.mc.master_mc.sub_mc.anim_mc.gotoAndStop("ANIM_" + f);
}
}
function slideOver() {
var _local1 = this;
var _local2;
_local1.idle();
_local1.slider.slideTo(_local1.parent.pipe_l * _local1.col, _local2, _local2, _local2, "Out", 10 + _local1.col);
}
function onPipeOver() {
mc.bg_mc.gotoAndStop("OVER");
}
function onPipeOut() {
mc.bg_mc.gotoAndStop("IDLE");
}
function onPipePress() {
var _local1 = this;
if (_local1.parent.state == "PLAYING") {
_local1.rotate(1);
_local1.parent.onPipePress();
}
}
function onFlowAnim() {
var _local1 = this;
_local1.startLinkedChoc();
if (_local1.isFinalFlowPiece()) {
_local1.parent.score(_local1);
}
}
}
Symbol 277 MovieClip [__Packages.Misc.Slider] Frame 0
class Misc.Slider
{
function Slider (p, m) {
var _local1 = this;
_local1.state = "STILL";
_local1.parent = p;
_local1.mc = m;
_local1.setupInitObj();
}
function setupInitObj() {
var _local1 = this;
_local1.init_obj = new Object();
_local1.init_obj = {x:_local1.mc._x, y:_local1.mc._y, xs:_local1.mc._xscale, ys:_local1.mc._yscale};
}
function slideInit() {
var _local1 = this;
_local1.slideTo(_local1.init_obj.x, _local1.init_obj.y, _local1.init_obj.xs, _local1.init_obj.ys, "Out", 10);
}
function slideTo(x, y, xs, ys, e_type, dur, e_level) {
var _local1 = this;
var _local2 = dur;
var _local3 = e_type;
_local1.mc.onMotionFinished = mx.utils.Delegate.create(_local1, _local1.onSlide);
_local1.deleteSlide();
_local1.setupTween("x", x, _local3, _local2, e_level);
_local1.setupTween("y", y, _local3, _local2, e_level);
_local1.setupTween("xscale", xs, _local3, _local2, e_level);
_local1.setupTween("yscale", ys, _local3, _local2, e_level);
_local1.state = "SLIDING";
}
function setupTween(s, n, e_type, d, e_l) {
var _local1 = this;
var _local2 = s;
var _local3 = n;
if ((_local3 != "") and (_local3 != undefined)) {
var easeType = mx.transitions.easing.Strong["ease" + e_type];
_local1[_local2 + "_tween"] = new mx.transitions.Tween(_local1.mc, "_" + _local2, easeType, _local1.mc["_" + _local2], _local3, d);
if (!_local1.slide_tween) {
_local1.slide_tween = _local1[_local2 + "_tween"];
_local1.slide_tween.addListener(_local1.mc);
}
} else {
delete _local1[_local2 + "_tween"];
}
}
function cleanUp() {
deleteSlide();
}
function deleteSlide() {
var _local1 = this;
_local1.slide_tween.stop();
_local1.slide_tween.removeListener(_local1.mc);
_local1.slide_tween = null;
}
function onSlide() {
var _local1 = this;
_local1.slide_tween.removeListener(_local1.mc);
_local1.state = "STILL";
_local1.parent.onSlide();
}
}
Symbol 278 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / d;
return((((((c * _local1) * _local1) * _local1) * _local1) * _local1) + b);
}
static function easeOut(t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return((c * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((((c / 2) * _local1) * _local1) * _local1) * _local1) * _local1) + b);
}
_local1 = _local1 - 2;
return(((c / 2) * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 2)) + b);
}
}
Symbol 140 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 20
stop();
Symbol 153 MovieClip Frame 22
stop();
Symbol 155 MovieClip Frame 69
_parent.pipes_game.onStartGameButton();
stop();
Symbol 163 MovieClip Frame 1
stop();
Symbol 233 MovieClip Frame 1
stop();
Symbol 239 MovieClip Frame 1
this.onEnterFrame = function () {
this._rotation = _parent.needle_mc._rotation;
};
Symbol 246 MovieClip Frame 6
stop();
Symbol 247 MovieClip Frame 16
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 18
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 262 MovieClip Frame 18
stop();
Symbol 265 Button
on (rollOver) {
exitgame.gotoAndPlay("OVER");
}
on (rollOut, releaseOutside) {
exitgame.gotoAndPlay("OUT");
}
on (release) {
getURL ("javascript:window.close();");
}
Symbol 266 MovieClip Frame 16
_parent.pipes_game.onGameOverScreen();
Symbol 266 MovieClip Frame 23
_parent.pipes_game.onGameOverButtons();
stop();