Frame 1
stop();
kv_v = {c:398, a:0, da:["distralytics.com", "distralytics.co.uk"]};
kv_v.i = 0;
while (kv_v.i < kv_v.da.length) {
System.security.allowDomain(kv_v.da[kv_v.i], (kv_v.c + ".c.") + kv_v.da[kv_v.i], "*." + kv_v.da[kv_v.i]);
kv_v.i++;
}
kv_v.lc = function () {
var _local1 = ((("http://" + kv_v.c) + ".c.") + kv_v.da[kv_v.a % kv_v.da.length]) + kv_v.lurl;
System.security.allowDomain(_local1);
kv_v.l_mcl.loadClip(_local1, kv_v.t_mc);
};
kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_v.lurl = "/control/tracking/tracker.swf?r=" + Math.floor(Math.random() * 10000);
kv_v.t_mc = createEmptyMovieClip("kv_tracker", -16734);
kv_v.l_mcl = new MovieClipLoader();
kv_v.mcl_l = {onLoadError:function () {
kv_v.a++;
kv_v.lc();
}, onLoadStart:function (m) {
System.security.allowDomain(m._url);
}};
kv_v.l_mcl.addListener(kv_v.mcl_l);
kv_v.lc();
Frame 2
mouse_l = {};
Mouse.addListener(mouse_l);
mouse_l.onMouseDown = function () {
if (clientLinkHit_mc.hitTest(_xmouse, _ymouse)) {
_root.kvClick(656);
}
if (tmLinkHit_mc.hitTest(_xmouse, _ymouse)) {
_root.kvClick(657);
}
};
function onEnterFrame() {
var _local2 = snd.getVolume();
_local2 = _local2 + dVol;
if (_local2 >= 100) {
if (!_global.isMuted) {
snd.setVolume(100);
}
delete onEnterFrame;
} else if (!_global.isMuted) {
snd.setVolume(_local2);
}
}
snd = new Sound();
snd.setVolume(1);
dVol = 1.25;
Instance of Symbol 30 MovieClip "mute" in Frame 2
onClipEvent (load) {
if (new Sound().getVolume() == 0) {
gotoAndStop ("off");
}
this.onRelease = function () {
if (new Sound().getVolume() == 0) {
gotoAndStop ("on");
_global.isMuted = false;
new Sound().setVolume(100);
} else {
gotoAndStop ("off");
_global.isMuted = true;
new Sound().setVolume(0);
}
};
}
Frame 3
function getSo() {
var _local1 = SharedObject.getLocal("sittingAtABarHighscores", "/");
if (!_local1.data.highscores) {
_local1.data.highscores = defaultHighscores;
_local1.data.flush();
}
return(_local1);
}
function getHighscores() {
var _local2 = getSo();
var _local1 = [].concat(_local2.data.highscores);
_local1.sortOn(["score", "datetime", "name"], [Array.DESCENDING | Array.NUMERIC, Array.NUMERIC, Array.CASEINSENSITIVE]);
return(_local1);
}
function submitHighscore(name, score, other) {
var _local1 = getSo();
_local1.data.highscores.push({name:name, score:score, datetime:new Date(), other:other});
_local1.flush();
}
function getIt() {
getURL ("http://click.linksynergy.com/fs-bin/stat?id=x87i2Q2WuTk&offerid=78941&type=3&subid=0&tmpid=1826&RD_PARM1=http%253A%252F%252Fphobos.apple.com%252FWebObjects%252FMZStore.woa%252Fwa%252FviewAlbum%253Fi%253D279647739%2526id%253D279647737%2526s%253D143441%2526partnerId%253D30", "_blank");
_root.kvClick(627);
}
function visitTheSite() {
getURL ("http://www.sittinatabar.com", "_blank");
_root.kvClick(628);
}
function goToTinymania() {
getURL ("http://www.tinymania.com", "_blank");
_root.kvClick(630);
}
function goToVideoComp() {
getURL ("http://eyespot.com/mixables/REHAB#", "_blank");
_root.kvClick(629);
}
function goDrink() {
transition.transitionTo("playGame");
}
function saveGame() {
_global.root.submitHighscore(this.name_txt.text, _global.root.finalScore);
this.gotoAndPlay("showHighscores");
}
function setHighscores(table) {
var _local2 = getHighscores();
table.names_txt.text = (table.scores_txt.text = "");
var _local1 = 0;
while (_local1 < _local2.length) {
table.names_txt.text = table.names_txt.text + ((((_local1 + 1) + ". ") + _local2[_local1].name) + newline);
table.scores_txt.text = table.scores_txt.text + (GUI.numberFormat(_local2[_local1].score) + newline);
_local1++;
}
}
function goAndPlayAgain() {
transition.transitionTo("start");
}
var defaultHighscores = [];
defaultHighscores[defaultHighscores.length] = {name:"Cletus", score:7500, datetime:new Date(1205865112000)};
defaultHighscores[defaultHighscores.length] = {name:"Peggy-Sue", score:7000, datetime:new Date(1205864212000)};
defaultHighscores[defaultHighscores.length] = {name:"Jim-Bob", score:6500, datetime:new Date(1205864911000)};
defaultHighscores[defaultHighscores.length] = {name:"Faylene", score:6000, datetime:new Date(1205865112000)};
defaultHighscores[defaultHighscores.length] = {name:"Joe-Bob", score:5500, datetime:new Date(1205865112000)};
defaultHighscores[defaultHighscores.length] = {name:"Daisy-Sue", score:5000, datetime:new Date(1205865112000)};
defaultHighscores[defaultHighscores.length] = {name:"Billy-Bob", score:4500, datetime:new Date(1205865112000)};
defaultHighscores[defaultHighscores.length] = {name:"Betty Sue", score:4000, datetime:new Date(1205865112000)};
defaultHighscores[defaultHighscores.length] = {name:"Jed", score:3500, datetime:new Date(1205865112000)};
defaultHighscores[defaultHighscores.length] = {name:"Bobbi Jo", score:3000, datetime:new Date(1205865112000)};
stop();
_global.root = this;
if (!_global.transition) {
_global.transition = transition_mc;
transition.gotoAndPlay("fadeUp");
transition.gotoAndPlay("fadeUp");
transition.gotoAndPlay("fadeUp");
transition.gotoAndPlay("fadeUp");
transition.gotoAndPlay("fadeUp");
}
Frame 4
stop();
Symbol 15 MovieClip Frame 100
gotoAndPlay (1);
Instance of Symbol 8 MovieClip in Symbol 16 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Symbol 16 MovieClip Frame 10
function onEnterFrame() {
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
if (getTimer() >= (startTime + 100)) {
animDone = true;
}
if ((Math.ceil(bar._width) >= width) && (animDone)) {
stopSparks = true;
gotoAndPlay ("out");
delete onEnterFrame;
} else {
setProgress(_local2);
}
}
function fadeOut() {
setProgress(progress);
this._alpha = this._alpha - 5;
if (this._alpha <= -50) {
this._visible = false;
_parent.play();
}
}
function makeSpark() {
}
function sparkControl() {
if (!stopSparks) {
this._y = this._y + this.grav;
this._x = this._x + this.wind;
this.grav = this.grav * gravity;
this._alpha = this._alpha - this.grav;
this._rotation = this._rotation + this.spin;
if (this._alpha <= 0) {
this.removeMovieClip();
}
} else {
this.removeMovieClip();
}
}
function setProgress(p) {
bar._width = ((bar._width * 2) + (p * width)) / 3;
if (progress != 1) {
makeSpark();
}
}
width = 200;
i = 0;
gravity = 1.3;
animDone = true;
startTime = getTimer();
if (this._name == "loader_mc") {
myName = _global.language.loadingAssets;
} else {
myName = _global.language.initLevel;
}
setProgress(0);
Symbol 16 MovieClip Frame 22
stop();
Symbol 16 MovieClip Frame 23
play();
Symbol 16 MovieClip Frame 28
_parent.play();
Symbol 23 MovieClip Frame 1
function transitionTo(newPage, transType, targ) {
nextPage = newPage;
transitionType = (transType ? (transType) : "stop");
transitionTarg = (targ ? (targ) : _parent);
play();
}
function switchPage() {
if (transitionType == "play") {
transitionTarg.gotoAndPlay(nextPage);
} else {
transitionTarg.gotoAndStop(nextPage);
}
delete nextPage;
delete transitionType;
delete transitionTarg;
}
Symbol 23 MovieClip Frame 2
stop();
Symbol 23 MovieClip Frame 7
switchPage();
Symbol 30 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 5
stop();
Symbol 64 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 1
stop();
this._parent.anim_mc = this;
Symbol 100 MovieClip Frame 6
stop();
Symbol 103 Button
on (release) {
_global.root.getIt();
}
on (rollOver) {
getIt_btn.anim_mc.gotoAndPlay("over");
}
on (rollOut) {
getIt_btn.anim_mc.gotoAndPlay("out");
}
Symbol 115 Button
on (release) {
_global.root.visitTheSite();
}
Symbol 119 Button
on (release) {
_global.root.getIt();
}
Symbol 137 MovieClip Frame 1
name_txt.restrict = "a-zA-Z0-9";
_parent._parent.name_txt = name_txt;
Symbol 142 MovieClip Frame 1
stop();
Symbol 142 MovieClip Frame 5
stop();
Symbol 142 MovieClip Frame 12
stop();
Symbol 142 MovieClip Frame 13
results_mc.score_txt.text = GUI.numberFormat(_global.root.finalScore, 0, ",");
Symbol 142 MovieClip Frame 16
stop();
Symbol 142 MovieClip Frame 22
stop();
Symbol 142 MovieClip Frame 29
stop();
Symbol 142 MovieClip Frame 33
stop();
Symbol 142 MovieClip Frame 39
stop();
Symbol 142 MovieClip Frame 43
stop();
Symbol 150 Button
on (release) {
_global.root.goDrink();
}
Symbol 154 Button
on (release) {
_parent.play();
}
Symbol 176 Button
on (release) {
_global.root.goToVideoComp();
}
Symbol 179 Button
on (release) {
_global.root.goToTinymania();
}
Symbol 183 MovieClip Frame 1
stop();
Symbol 183 MovieClip Frame 15
stop();
info_mc.gotoAndPlay("howToPlay");
Symbol 253 MovieClip [__Packages.GUI] Frame 0
class GUI extends MovieClip
{
var time_txt, score_txt;
function GUI () {
super();
}
function update(f, score) {
time_txt.text = time(f * FPS);
score_txt.text = numberFormat(score, 0, ",");
}
function time(t) {
var _local3 = (isNaN(t) ? (new Date()) : (new Date(t)));
var _local1 = _local3.getSeconds();
var _local2 = Math.round(_local3.getMilliseconds() / 10);
var _local4 = (((_local1 < 10) ? ("0" + _local1) : (_local1)) + ":") + ((_local2 < 10) ? ("0" + _local2) : (_local2));
return(_local4);
}
static function numberFormat(n, decimalPlaces, thousandSpacer) {
thousandSpacer = ((thousandSpacer == undefined) ? " " : (thousandSpacer));
var _local10 = n < 0;
var _local5 = Math.abs(n % 1);
if (decimalPlaces) {
var _local6 = Math.pow(10, decimalPlaces);
_local5 = _local5 * _local6;
n = n + Math.floor(Math.round(_local5) / _local6);
var _local9 = zerofill(Math.round(_local5) % _local6, decimalPlaces);
}
var _local3 = Math.floor(Math.abs(n)) + "";
var _local2 = "";
var _local1 = _local3.length - 1;
while (_local1 >= 0) {
if (((_local3.length - _local1) % 3) == 1) {
_local2 = thousandSpacer + _local2;
}
_local2 = _local3.charAt(_local1) + _local2;
_local1--;
}
_local2 = _local2.substr(0, _local2.length - 1);
return(((_local10 ? "-" : "") + _local2) + (decimalPlaces ? ("." + _local9) : ""));
}
static function zerofill(n, z) {
var _local2 = String(n);
var _local1 = _local2.length;
while (_local1 < z) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
}
static var FPS = 30;
}
Symbol 254 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
var falloff, guy, onEnterFrame, gui, nextBeerAt, beer, beerInfo_mc, background_mc, gotoAndPlay;
function Game () {
super();
falloff._visible = false;
startGame();
}
function startGame() {
guy.startGame();
onEnterFrame = gameLoop;
nextBeer();
}
function gameLoop() {
frame++;
guy.update(frame);
gui.update(frame, points);
if ((frame % framePerPoints) == (framePerPoints - 1)) {
points = points + pointsForTime;
}
if (frame == nextBeerAt) {
throwBeer();
}
var _local2 = guy.__get__rotation();
var _local3 = initForce * Math.pow(dForce, frame / 30);
_local2 = _local2 + (Math.cos((frame / period) * pi2) * _local3);
_local2 = _local2 + (Math.sin(guy.__get__rotation() * dr) * gravity);
if (isBeerActive) {
if (Key.isDown(32)) {
isBeerCaught = true;
}
}
if (!guy.isDrinking) {
if (Key.isDown(37)) {
leanSpeed = leanSpeed - leanPower;
}
if (Key.isDown(39)) {
leanSpeed = leanSpeed + leanPower;
}
}
leanSpeed = leanSpeed * leanFriction;
_local2 = _local2 + leanSpeed;
if (Math.abs(_local2) > fallOffAng) {
fallOff();
} else {
guy.__set__rotation(_local2);
}
}
function throwBeer() {
beer.gotoAndPlay("throwBeer");
isBeerActive = true;
isBeerCaught = false;
if (firstBeer) {
beerInfo_mc.gotoAndPlay("show");
firstBeer = false;
}
}
function catchBeer() {
if (isBeerCaught) {
beer.gotoAndStop("wait");
points = points + pointsForBeer;
guy.drink();
}
}
function finishedBeer() {
nextBeer();
}
function missedBeer() {
nextBeer();
}
function nextBeer() {
nextBeerAt = frame + Rand.random(minBeerWait, maxBeerWait, 0);
}
function fallOff() {
falloff._visible = true;
guy._visible = false;
if (guy._rotation > 0) {
falloff._xscale = falloff._xscale * -1;
}
falloff.neck.head.gotoAndStop(Guy.FALLOFF);
falloff.play();
falloff.neck.head.gotoAndStop(Guy.FALLOFF);
falloff.onEnterFrame = function () {
this.neck.head.gotoAndStop(Guy.FALLOFF);
};
delete onEnterFrame;
}
function gameOver() {
delete falloff.onEnterFrame;
background_mc.gotoAndPlay("end");
}
function showScores() {
gotoAndPlay("gameOver");
_global.root.finalScore = points;
}
var frame = 0;
var period = 250;
var initForce = 0.45;
var dForce = 1.05;
var gravity = 0.1;
var leanPower = 0.125;
var leanFriction = 0.95;
var leanSpeed = 0;
var fallOffAng = 55;
var points = 0;
var pointsForBeer = 1000;
var pointsForTime = 100;
var framePerPoints = 30;
var minBeerWait = 90;
var maxBeerWait = 180;
var isBeerActive = false;
var isBeerCaught = false;
var firstBeer = true;
var pi2 = (Math.PI*2);
var rd = 57.2957795130823;
var dr = (Math.PI/180);
}
Symbol 255 MovieClip [__Packages.Guy] Frame 0
class Guy extends MovieClip
{
var game, _parent, head, neck, changeExpressionAt, gotoAndPlay, gotoAndStop, _rotation, leftArm, rightArm;
function Guy () {
super();
game = _parent;
head = neck.head;
}
function startGame() {
changeExpression(0);
}
function update(f) {
if (!isDrinking) {
if (f == changeExpressionAt) {
changeExpression(f);
}
}
}
function changeExpression(currentFrameNum) {
head.gotoAndStop(Rand.value.apply(null, EXPRESSIONS));
changeExpressionAt = currentFrameNum + Rand.random(minExpressionChangeTime, maxExpressionChangeTime, 0);
}
function drink() {
gotoAndPlay(DRINKING);
head.gotoAndStop(DRINK);
isDrinking = true;
}
function finishedDrinking() {
gotoAndStop(SITTING);
isDrinking = false;
changeExpression(game.frame);
game.finishedBeer();
}
function get rotation() {
return(_rotation);
}
function set rotation(n) {
_rotation = n;
if (n > 0) {
leftArm._rotation = -n;
} else {
rightArm._rotation = -n;
}
var _local3 = ((n > 0) ? (((n > maxNeckHeadAngle) ? (maxNeckHeadAngle) : (n))) : (((n < (-maxNeckHeadAngle)) ? (-maxNeckHeadAngle) : (n))));
neck._rotation = _local3 * neckRotationModifier;
head._rotation = _local3 * headRotationModifier;
//return(rotation);
}
var neckRotationModifier = 0.5;
var headRotationModifier = 0.5;
var maxNeckHeadAngle = 35;
var isDrinking = false;
var minExpressionChangeTime = 45;
var maxExpressionChangeTime = 90;
static var SITTING = "sitting";
static var DRINKING = "drinking";
static var DRINK = "drink";
static var FALLOFF = "falloff";
static var EXPRESSIONS = ["normal", "happy", "confused", "drooling"];
}
Symbol 256 MovieClip [__Packages.Rand] Frame 0
class Rand
{
function Rand () {
}
static function midBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 2 : (i + 1));
var _local3 = 0;
var _local1 = 0;
while (_local1 < i) {
_local3 = _local3 + ((v() * (max - min)) + min);
_local1++;
}
_local3 = _local3 / i;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local7 = _local3 % p;
if (_local7 <= (p / 2)) {
_local3 = _local3 - _local7;
} else {
_local3 = _local3 + (p - _local7);
}
}
return(_local3);
}
static function minBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = ((1 - Math.pow(v(), 1 / (i + 1))) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function maxBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = (Math.pow(v(), 1 / (i + 1)) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function value() {
if (arguments.length > 0) {
var _local2 = v() * arguments.length;
_local2 = _local2 - (_local2 % 1);
return(arguments[_local2]);
}
}
static function get number() {
return(v());
}
static function random(min, max, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
if (!isNaN(p)) {
p = 1 / Math.pow(10, p);
max = max + p;
} else {
}
var _local3 = (v() * (max - min)) + min;
if (p) {
_local3 = _local3 - (_local3 % p);
}
return(_local3);
}
static var v = Math.random;
}
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 32
stop();
_parent.showScores();
Symbol 202 MovieClip Frame 10
gotoAndPlay ("start");
Symbol 202 MovieClip Frame 11
stop();
Symbol 203 MovieClip [guy] Frame 1
#initclip 7
Object.registerClass("guy", Guy);
#endinitclip
stop();
Symbol 203 MovieClip [guy] Frame 33
finishedDrinking();
Symbol 218 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 22
stop();
_parent.gameOver();
Symbol 224 MovieClip Frame 1
stop();
Symbol 224 MovieClip Frame 24
_parent.catchBeer();
Symbol 224 MovieClip Frame 45
_parent.missedBeer();
Symbol 226 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 22
stop();
Symbol 227 MovieClip Frame 64
stop();
Symbol 237 MovieClip [gui] Frame 1
#initclip 5
Object.registerClass("gui", GUI);
#endinitclip
Symbol 245 Button
on (release) {
_parent.gotoAndPlay("submitScore");
}
Symbol 250 Button
on (release) {
_parent.doNextThing();
}
Symbol 252 MovieClip [game] Frame 1
#initclip 6
Object.registerClass("game", Game);
#endinitclip
stop();
Symbol 252 MovieClip [game] Frame 19
stop();
info_mc.gotoAndPlay("gameOver");
Symbol 252 MovieClip [game] Frame 20
info_mc.play();
doNextThing = _global.root.saveGame;
Symbol 252 MovieClip [game] Frame 26
info_mc.gotoAndPlay("submitScore");
Symbol 252 MovieClip [game] Frame 34
stop();
Symbol 252 MovieClip [game] Frame 35
info_mc.play();
doNextThing = _global.root.goAndPlayAgain;
Symbol 252 MovieClip [game] Frame 40
info_mc.gotoAndPlay("showHighscores");
_global.root.setHighscores(info_mc.highscores);
Symbol 252 MovieClip [game] Frame 47
stop();