Frame 3
SoundManager.init();
SoundManager.musicOn();
Symbol 11 MovieClip [Preload] Frame 1
#initclip 11
Object.registerClass("Preload", Preloader);
#endinitclip
Symbol 136 MovieClip [__Packages.Preloader] Frame 0
class Preloader extends MovieClip
{
var _parent;
function Preloader () {
super();
_parent.stop();
}
function onEnterFrame() {
var _local1 = this;
if (_local1.maxWidth == undefined) {
_local1.maxWidth = _local1.preloader_mc._width;
}
var _local3 = _local1._parent.getBytesLoaded();
var _local2 = _local1._parent.getBytesTotal();
if (_local2 < 4) {
_local1.preloader_mc._width = 0;
} else {
_local1.preloader_mc._width = (_local1.maxWidth * _local3) / _local2;
}
if (_local3 == _local2) {
_local1._parent.gotoAndStop("splash");
}
}
}
Symbol 137 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager
{
function SoundManager () {
}
static function changeState() {
soundOn = !soundOn;
if (soundOn) {
sounds.volumiser.setVolume(100);
return("Sound ON");
}
sounds.volumiser.setVolume(0);
return("Sound OFF");
}
static function init() {
sounds.volumiser = new Sound();
sounds.wak = new Sound();
sounds.wak.attachSound("hit");
sounds.swing = new Sound();
sounds.swing.attachSound("swing");
}
static function wak() {
sounds.wak.start(0.17);
}
static function swing() {
if ((sounds.swing.position == 0) || (sounds.swing.position == sounds.swing.duration)) {
sounds.swing.start();
}
}
static function musicOn() {
var _local1 = _root.createEmptyMovieClip("music", 997);
musicSound = new Sound(_local1);
musicSound.attachSound("music");
musicSound.start(0, 99999);
}
static function setMusicLow() {
musicSound.setVolume(65);
}
static function setMusicHigh() {
musicSound.setVolume(100);
}
static var sounds = new Object();
static var soundOn = true;
static var musicSound = null;
}
Symbol 138 MovieClip [__Packages.Bollox] Frame 0
class Bollox extends MovieClip
{
var _parent, gotoAndStop;
function Bollox () {
super();
}
function wak(level) {
var _local1 = this;
switch (level) {
case 1 :
_local1.gotoAndStop("wakSoft");
return;
case 3 :
_local1.gotoAndStop("wakHard");
return;
default :
_local1.gotoAndStop("wakMed");
}
}
function up() {
_parent.score_mc.show();
}
function drop() {
if (Math.random() < 0.5) {
gotoAndStop("dropOne");
} else {
gotoAndStop("dropTwo");
}
}
function end() {
gotoAndStop("still");
_parent.end();
}
}
Symbol 139 MovieClip [__Packages.Hand] Frame 0
class Hand extends MovieClip
{
var _visible, _x, gotoAndStop;
function Hand () {
var _local1 = this;
super();
_local1.startx = _local1._x;
_local1.starty = _local1._y;
_local1.setFrame();
}
function show() {
var _local1 = this;
_local1._x = _local1.startx;
_local1._y = _local1.starty;
_local1.setFrame();
_local1._visible = true;
}
function hide() {
_visible = false;
}
function onPress() {
var _local1 = this;
_local1.dragging = true;
_local1.oldx = (_local1._x = _local1._parent._xmouse);
_local1.oldy = (_local1._y = _local1._parent._ymouse);
_local1.oldt = getTimer();
}
function onRelease() {
var _local1 = this;
_local1.dragging = false;
_local1._x = Math.min(Math.max(_local1._x, 0), 600);
_local1._y = Math.min(Math.max(_local1._y, 0), 375);
}
function onEnterFrame() {
var _local1 = this;
if (_local1.dragging) {
var x = ((_local1._x = _local1._parent._xmouse));
var y = ((_local1._y = _local1._parent._ymouse));
var _local3 = getTimer();
var _local2 = (33 * Math.sqrt(Math.pow(x - _local1.oldx, 2) + Math.pow(y - _local1.oldy, 2))) / (_local3 - _local1.oldt);
_local1.oldx = x;
_local1.oldy = y;
_local1.oldt = _local3;
_local1.setFrame();
_local1._parent.console_mc.setSpeed(_local2);
if (_local2 > 100) {
SoundManager.swing();
}
if (_local1.hitTest(_local1._parent.hitarea_mc)) {
_local1.onRelease();
_local1._parent.wak(_local2);
}
}
}
function setFrame() {
var _local1 = Math.ceil(_x / 60);
_local1 = Math.min(Math.max(_local1, 2), 11);
gotoAndStop(_local1);
}
var dragging = false;
var oldx = 0;
var oldy = 0;
var oldt = 0;
}
Symbol 140 MovieClip [__Packages.Score] Frame 0
class Score extends MovieClip
{
var _visible;
function Score () {
super();
}
function hide() {
_visible = false;
}
function show() {
var _local1 = this;
_local1.score_txt.text = Scorekeeper.getLatestScore();
_local1._visible = true;
_local1.gotoAndPlay("start");
}
}
Symbol 141 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
var _parent;
function Game () {
super();
ScoreKeeper.reset();
}
function start() {
var _local1 = this;
_local1.console_mc.setSpeed(0);
_local1.hand_mc.show();
_local1.score_mc.hide();
Soundmanager.setMusicLow();
}
function wak(speed) {
var _local2 = this;
var _local3 = speed;
_local2.hand_mc.hide();
_local2.console_mc.setWakSpeed(_local3);
ScoreKeeper.addScore(_local3);
var max = _local2.console_mc.getMaxSpeed();
var _local1 = Math.max(Math.min(Math.ceil((3 * _local3) / max), 3), 1);
if (_local1 > 1) {
SoundManager.wak();
}
_local2.bollox_mc.wak(_local1);
}
function end() {
if (ScoreKeeper.getNumScores() >= 3) {
Soundmanager.setMusicHigh();
_parent.gotoAndStop("endgame");
} else {
start();
}
}
}
Symbol 142 MovieClip [__Packages.ScoreKeeper] Frame 0
class ScoreKeeper
{
function ScoreKeeper () {
}
static function reset() {
numScores = 0;
totalScores = 0;
latestScore = 0;
}
static function addScore(score) {
totalScores = totalScores + score;
numScores++;
latestScore = score;
}
static function getNumScores() {
return(numScores);
}
static function getLatestScore() {
return(Math.round(latestScore));
}
static function getAverageScore() {
if (numScores == 0) {
return(0);
}
return(Math.round(totalScores / numScores));
}
static var totalScores = 0;
static var numScores = 0;
static var latestScore = 0;
}
Symbol 143 MovieClip [__Packages.Console] Frame 0
class Console extends MovieClip
{
function Console () {
super();
}
function reset() {
var _local1 = this;
_local1.fastestScore = 0;
_local1.latestScore = 0;
_local1.displayScores();
_local1.setSpeed(0);
}
function displayScores() {
var _local1 = this;
_local1.fastest_txt.text = _local1.fastestScore;
_local1.latest_txt.text = _local1.latestScore;
}
function setSpeed(speed) {
var _local1 = this;
var _local2 = speed;
if (_local2 > _local1.maxSpeed) {
_local2 = _local1.maxSpeed;
}
_local1.pointer_mc._rotation = (_local2 * 250) / _local1.maxSpeed;
}
function setWakSpeed(speed) {
var _local1 = this;
var _local2 = speed;
_local1.latestScore = Math.round(_local2);
if (_local1.fastestScore < _local2) {
_local1.fastestScore = Math.round(_local2);
}
_local1.displayScores();
_local1.setSpeed(_local2);
}
function getMaxSpeed() {
return(maxSpeed);
}
var fastestScore = 0;
var latestScore = 0;
var maxSpeed = 500;
}
Symbol 144 MovieClip [__Packages.FriendEmail] Frame 0
class FriendEmail extends MovieClip
{
var send_btn;
function FriendEmail () {
super();
send_btn.onRelease = function () {
this._parent.submitForm();
};
}
function submitForm() {
var _local1 = this;
_local1.lvars = new LoadVars();
_local1.lvars.score = ScoreKeeper.getAverageScore();
_local1.lvars.from = _local1.trim(_local1.from_txt.text);
var _local2;
var _local3;
var hasfriends = false;
_local2 = 1;
while (_local2 < 5) {
_local3 = _local1.trim(_local1[("friend" + _local2) + "_txt"].text);
if (_local3 != "") {
_local1.lvars["friend" + _local2] = _local3;
hasfriends = true;
}
_local2++;
}
var error = "";
if (_local1.lvars.from.length == 0) {
error = error + "Please enter your email address.\n";
} else if (!_local1.validateEmail(_local1.lvars.from)) {
error = error + "Please enter a valid email address.\n";
}
if (hasfriends == false) {
error = error + "Please enter the email addresses of the friends you'd like to challenge";
}
if ((_local1.lvars.friend1 != undefined) && (!_local1.validateEmail(_local1.lvars.friend1))) {
error = error + "Your first friend's email address isn't a valid email address. Please correct it.\n";
}
if ((_local1.lvars.friend2 != undefined) && (!_local1.validateEmail(_local1.lvars.friend2))) {
error = error + "Your second friend's email address isn't a valid email address. Please correct it.\n";
}
if ((_local1.lvars.friend3 != undefined) && (!_local1.validateEmail(_local1.lvars.friend3))) {
error = error + "Your third friend's email address isn't a valid email address. Please correct it.\n";
}
if ((_local1.lvars.friend4 != undefined) && (!_local1.validateEmail(_local1.lvars.friend4))) {
error = error + "Your fourth friend's email address isn't a valid email address. Please correct it.\n";
}
if (error != "") {
_local1.error_mc.alert(error);
return(false);
}
_global.loadowner = _local1;
_local1.lvars.onLoad = function (success) {
_global.loadowner.onLoadVars(success);
};
_local1.lvars;
_local1.lvars;
return(true);
}
function onLoadVars(success) {
var _local1 = this;
if (!success) {
_local1.error_mc.alert("Unable to connect to the server. Please try again.");
} else {
switch (parseInt(_local1.lvars.errorStatus)) {
case 0 :
_local1._parent.gotoAndStop("challenged");
return;
default :
_local1.error_mc.alert("There was an error sending your message. Please try again.");
}
}
}
function validateEmail(t) {
t = trim(t);
var _local2 = 0;
var dot = false;
var allnumbers = true;
var c_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var c_numbers = "0123456789";
var charSet = ((c_letters + c_numbers) + "@-^!#$%&'_*+\\=?`{|}~.");
var _local3;
var valid = true;
var l = t.length;
var _local1 = 0;
while ((_local1 < l) && (valid)) {
_local3 = t.charAt(_local1);
if (charSet.indexOf(_local3) == -1) {
valid = false;
}
if (_local3 == "@") {
if ((_local2 || (_local1 == 0)) || (_local1 == (l - 1))) {
valid = false;
} else {
_local2 = _local1;
charSet = (c_letters + c_numbers) + "-.";
}
}
if ((_local3 == ".") && (_local2)) {
if ((_local1 != (_local2 + 1)) && (_local1 != (l - 1))) {
dot = _local1;
} else {
valid = false;
}
}
if ((allnumbers && (_local2)) && (c_numbers.indexOf(_local3) == -1)) {
allnumbers = false;
}
_local1++;
}
return(((valid && (_local2)) && (dot)) && (!allnumbers));
}
function trim(s) {
var _local3 = s;
var _local2 = 0;
while ((_local2 < _local3.length) && (_local3.charAt(_local2) == " ")) {
_local2++;
}
var _local1 = _local3.length;
while ((_local1 > 0) && (_local3.charAt(_local1 - 1) == " ")) {
_local1--;
}
return(_local3.substring(_local2, _local1));
}
}
Symbol 145 MovieClip [__Packages.AlertBox] Frame 0
class AlertBox extends MovieClip
{
var message_txt, _visible;
function AlertBox () {
var _local1 = this;
super();
_local1._visible = false;
_local1.ok_btn.onRelease = function () {
this._parent._visible = false;
};
}
function alert(message) {
message_txt.text = message;
_visible = true;
}
}
Symbol 15 MovieClip Frame 1
stop();
Symbol 19 Button
on (release) {
this.sound_txt.text = SoundManager.changeState();
}
Symbol 21 Button
on (release) {
getURL ("http://www.thedoghouse.co.uk/", "_new");
}
Symbol 33 Button
on (release) {
this._parent.gotoAndStop("playgame");
}
Symbol 38 Button
on (release) {
this._parent.gotoAndStop("instructions");
}
Symbol 39 MovieClip Frame 56
stop();
Symbol 58 MovieClip [console] Frame 1
#initclip 16
Object.registerClass("console", Console);
#endinitclip
Symbol 62 MovieClip Frame 50
stop();
this._parent.up();
Symbol 68 MovieClip Frame 51
stop();
this._parent.up();
Symbol 70 MovieClip Frame 57
stop();
this._parent.up();
Symbol 72 MovieClip Frame 15
stop();
this._parent.end();
Symbol 73 MovieClip Frame 15
stop();
this._parent.end();
Symbol 74 MovieClip [bollox] Frame 1
#initclip 12
Object.registerClass("bollox", Bollox);
#endinitclip
stop();
Symbol 85 MovieClip [handy] Frame 1
#initclip 13
Object.registerClass("handy", Hand);
#endinitclip
Symbol 88 MovieClip [scoremovie] Frame 1
#initclip 14
Object.registerClass("scoremovie", Score);
#endinitclip
stop();
Symbol 88 MovieClip [scoremovie] Frame 41
this._parent.bollox_mc.drop();
Symbol 89 MovieClip [game] Frame 1
#initclip 15
Object.registerClass("game", Game);
#endinitclip
this.start();
Symbol 99 Button
on (release) {
this._parent.gotoAndStop("playgame");
}
Symbol 104 Button
on (release) {
this._parent.gotoAndStop("playgame");
}
Symbol 108 MovieClip Frame 1
this.score_txt.text = ScoreKeeper.getAverageScore();
Symbol 130 MovieClip [error panel] Frame 1
#initclip 18
Object.registerClass("error panel", AlertBox);
#endinitclip
Symbol 131 MovieClip [challengemov] Frame 1
#initclip 17
Object.registerClass("challengemov", FriendEmail);
#endinitclip
Symbol 134 Button
on (release) {
this._parent.gotoAndStop("playgame");
}