Frame 3
SoundManager.init();
SoundManager.musicOn();
Symbol 11 MovieClip [Preload] Frame 1
#initclip 11
Object.registerClass("Preload", Preloader);
#endinitclip
Symbol 121 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 122 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 123 MovieClip [__Packages.Bottom] Frame 0
class Bottom extends MovieClip
{
var _parent, gotoAndStop;
function Bottom () {
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 wobbleDone() {
_parent.score_mc.show();
}
function end() {
gotoAndStop("still");
_parent.end();
}
}
Symbol 124 MovieClip [__Packages.Hand] Frame 0
class Hand extends MovieClip
{
var _visible, _x, gotoAndStop;
function Hand () {
super()
var _local1 = this;
_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, -350), 350);
_local1._y = Math.min(Math.max(_local1._y, -175), 175);
}
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 = 5 + 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 125 MovieClip [__Packages.Score] Frame 0
class Score extends MovieClip
{
var _visible;
function Score () {
super();
}
function hide() {
_visible = false;
}
function show() {
var _local1 = this;
_local1.speed_mc.score_txt.text = ScoreKeeper.getLatestScore();
_local1._visible = true;
_local1.gotoAndPlay("start");
}
}
Symbol 126 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 127 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.bottom_mc.wak(_local1);
}
function end() {
if (ScoreKeeper.getNumScores() >= 3) {
Soundmanager.setMusicHigh();
_parent.gotoAndStop("endgame");
} else {
start();
}
}
}
Symbol 128 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 129 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.sendAndLoad("friendemail.php", _local1.lvars, "POST");
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 130 MovieClip [__Packages.AlertBox] Frame 0
class AlertBox extends MovieClip
{
var message_txt, _visible;
function AlertBox () {
super()
var _local1 = this;
_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 35 Button
on (release) {
getURL ("http://www.thedoghouse.co.uk/", "_blank");
}
Symbol 36 MovieClip Frame 99
this._parent.gotoAndStop("select");
Symbol 41 Button
on (release) {
this._parent.gotoAndStop("playgame");
}
Symbol 42 Button
on (release) {
this._parent.gotoAndStop("instructions");
}
Symbol 43 MovieClip Frame 37
stop();
Symbol 48 Button
on (release) {
this.play();
}
Symbol 49 Button
on (release) {
play();
}
Symbol 50 MovieClip Frame 52
stop();
Symbol 50 MovieClip Frame 76
this._parent.gotoAndStop("select");
Symbol 51 MovieClip Frame 45
this._parent.gotoAndStop("playing");
Symbol 60 MovieClip [console] Frame 1
#initclip 16
Object.registerClass("console", Console);
#endinitclip
Symbol 60 MovieClip [console] Frame 10
stop();
Symbol 64 MovieClip Frame 65
stop();
this._parent.wobbleDone();
Symbol 66 MovieClip Frame 105
stop();
this._parent.wobbleDone();
Symbol 68 MovieClip Frame 152
stop();
this._parent.wobbleDone();
Symbol 69 MovieClip [bottom] Frame 1
#initclip 12
Object.registerClass("bottom", Bottom);
#endinitclip
stop();
Symbol 80 MovieClip [handy] Frame 1
#initclip 13
Object.registerClass("handy", Hand);
#endinitclip
Symbol 86 MovieClip [scoremovie] Frame 1
#initclip 14
Object.registerClass("scoremovie", Score);
#endinitclip
stop();
this.hide();
Symbol 86 MovieClip [scoremovie] Frame 61
this._parent.bottom_mc.end();
this.hide();
stop();
Symbol 87 MovieClip [play_movie] Frame 1
#initclip 15
Object.registerClass("play_movie", Game);
#endinitclip
this.start();
Symbol 94 Button
on (release) {
this._parent.gotoAndStop("challenge");
}
Symbol 95 Button
on (release) {
this._parent.gotoAndStop("playing");
}
Symbol 96 MovieClip Frame 1
this.average_mc.score_txt.text = ScoreKeeper.getAverageScore();
Symbol 96 MovieClip Frame 32
stop();
Symbol 114 MovieClip [error panel] Frame 1
#initclip 18
Object.registerClass("error panel", AlertBox);
#endinitclip
Symbol 115 MovieClip [challenge_movie] Frame 1
#initclip 17
Object.registerClass("challenge_movie", FriendEmail);
#endinitclip
Symbol 117 Button
on (release) {
this._parent.gotoAndStop("playing");
}