Frame 1
_lockroot = true;
strGlobalDIR = "";
whatMusic = Math.ceil(Math.random() * 4);
whatPic = Math.ceil(Math.random() * 4);
trace(whatMusic);
loadMovie (((strGlobalDIR + "img/plan") + whatPic) + ".jpg", _root.imageHolder_mc);
loadMovie (((strGlobalDIR + "sounds/music") + whatMusic) + ".swf", _root.music_mc);
loadMovie (strGlobalDIR + "sounds/soundfx.swf", _root.soundfx_mc);
Mouse.hide();
preLoad = function () {
loaderBar_mc.mask_mc._y = -400 + ((getBytesLoaded() / getBytesTotal()) * 400);
if (getBytesLoaded() == getBytesTotal()) {
trace("LOADED");
clearInterval(preloadINT);
gotoAndStop ("startScreen");
}
};
preloadINT = setInterval(preLoad, 40);
stop();
Frame 2
stop();
Frame 3
onEnterFrame = function () {
mouse1_mc._x = _root._xmouse;
mouse1_mc._y = _root._ymouse;
};
stop();
Frame 4
stop();
Frame 5
stop();
Frame 6
function NetServiceProxy(nc, serviceName, client) {
if (nc != null) {
this.nc = nc;
this.serviceName = serviceName;
this.client = client;
}
}
load("RecordSet.as");
_global.NetServiceProxyResponder = function (service, methodName) {
this.service = service;
this.methodName = methodName;
};
NetServiceProxyResponder = _global.NetServiceProxyResponder;
NetServiceProxyResponder.prototype.onResult = function (result) {
var _local2 = this.service.client;
result._setParentService(this.service);
var _local3 = this.methodName + "_Result";
if (typeof(_local2[_local3]) == "function") {
_local2[_local3](result);
} else if (typeof(_local2.onResult) == "function") {
_local2.onResult(result);
} else {
NetServices.trace("NetServices", "info", 1, (_local3 + " was received from server: ") + result);
}
};
NetServiceProxyResponder.prototype.onStatus = function (result) {
var _local5 = this.service.client;
var _local6 = this.methodName + "_Status";
if (typeof(_local5[_local6]) == "function") {
_local5[_local6](result);
} else if (typeof(_local5.onStatus) == "function") {
_local5.onStatus(result);
} else if (typeof(_root.onStatus) == "function") {
_root.onStatus(result);
} else if (typeof(_global.System.onStatus) == "function") {
_global.System.onStatus(result);
} else {
NetServices.trace("NetServices", "info", 2, (((_local6 + " was received from server: ") + result.level) + " ") + result.description);
}
};
_global.NetServiceProxy = NetServiceProxy;
Object.registerClass("NetServiceProxy", NetServiceProxy);
NetServiceProxy.prototype._setParentService = function (service) {
this.nc = service.nc;
this.client = service.client;
};
NetServiceProxy.prototype.__resolve = function (methodName) {
var _local3 = function () {
if (this.client != null) {
arguments.unshift(new NetServiceProxyResponder(this, methodName));
} else if (typeof(arguments[0].onResult) != "function") {
NetServices.trace("NetServices", "warning", 3, "There is no defaultResponder, but no responder was given in call to " + methodName);
arguments.unshift(new NetServiceProxyResponder(this, methodName));
}
arguments.unshift((this.serviceName + ".") + methodName);
return(this.nc.call.apply(this.nc, arguments));
};
return(_local3);
};
NetConnection.prototype.getService = function (serviceName, client) {
var _local2 = new NetServiceProxy(this, serviceName, client);
return(_local2);
};
NetConnection.prototype.setCredentials = function (userid, password) {
this.addHeader("Credentials", false, {userid:userid, password:password});
};
NetConnection.prototype.RequestPersistentHeader = function (info) {
this.addHeader(info.name, info.mustUnderstand, info.data);
};
NetConnection.prototype.RequestUrlRewrite = function (urlSuffix) {
this.__urlSuffix = urlSuffix;
if (this.__originalUrl == null) {
this.__originalUrl = this.uri;
}
var _local2 = this.__originalUrl + urlSuffix;
this.connect(_local2);
};
NetConnection.prototype.clone = function () {
var _local2 = new NetConnection();
_local2.connect(((this.__originalUrl == null) ? (this.uri) : (this.__originalUrl)));
if (this.__urlSuffix != null) {
_local2.RequestUrlRewrite(this.__urlSuffix);
}
return(_local2);
};
if (_global.NetServices == null) {
_global.NetServices = new Object();
NetServices = _global.NetServices;
NetServices.gatewayUrl = gatewayUrl;
NetServices.urlSuffix = urlSuffix;
}
NetServices.setDefaultGatewayUrl = function (url) {
NetServices.defaultGatewayUrl = url;
};
NetServices.setGatewayUrl = function (url) {
NetServices.gatewayUrl = url;
};
NetServices.createGatewayConnection = function (url) {
if (url == undefined) {
if (NetServices.isHttpUrl(_root._url)) {
url = NetServices.gatewayUrl;
if (url == undefined) {
url = NetServices.defaultGatewayUrl;
if (url != undefined) {
if (NetServices.isHttpUrl(url)) {
var _local6 = url.indexOf("/", 8);
if (_local6 >= 0) {
url = url.substring(_local6);
}
}
var _local4 = NetServices.getHostUrl();
if (_local4 != null) {
url = _local4 + url;
}
}
}
} else {
url = NetServices.defaultGatewayUrl;
}
}
if (url == undefined) {
NetServices.trace("NetServices", "warning", 4, "createGatewayConnection - gateway url is undefined");
return(null);
}
var _local5 = new NetConnection();
_local5.connect(url);
if (NetServices.urlSuffix != null) {
this.RequestUrlRewrite(NetServices.urlSuffix);
}
return(_local5);
};
NetServices.getHostUrl = function () {
if (!NetServices.isHttpUrl(_root._url)) {
return(null);
}
var _local2 = _root._url.indexOf("/", 8);
if (_local2 < 0) {
return(null);
}
return(_root._url.substring(0, _local2));
};
NetServices.isHttpUrl = function (url) {
return((url.indexOf("http://") == 0) || (url.indexOf("https://") == 0));
};
NetServices.trace = function (who, severity, number, message) {
var _local1 = (((((who + " ") + severity) + " ") + number) + ": ") + message;
trace(_local1);
NetDebug.traceNetServices(who, severity, number, message);
};
NetServices.getVersion = function () {
return(1);
};
_global.strRootURL = "http://www.tamba-games.co.uk/askthespirits2";
NetServices.setDefaultGatewayUrl(_global.strRootURL + "/gateway.php");
conn = NetServices.createGatewayConnection();
recordInput_responder = new Object();
recordInput_responder.onResult = function () {
};
gameService = conn.getService("services");
onEnterFrame = function () {
mouse1_mc._x = _root._xmouse;
mouse1_mc._y = _root._ymouse;
};
stop();
Frame 7
function parseXML() {
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("http://www.tamba-games.co.uk/askthespirits2/questions.xml");
myXML.onLoad = function () {
_root.makeArrays();
};
}
function makeArrays() {
parseArray = [];
customQuestionsArray = [];
nodes = myXML.firstChild.childNodes;
i = 0;
while (i < nodes.length) {
whatfile = nodes[i].attributes.whatfile;
keywords = nodes[i].attributes.keywords;
whatresponse = nodes[i].attributes.whatresponse;
parseArray.push({keywords:keywords, whatfile:whatfile, whatresponse:whatresponse});
i++;
}
}
function tvc_tracker(url, media_id, format) {
tvc_lv = new LoadVars();
tvc_lv.media = media_id;
tvc_lv.f = format;
return(tvc_lv.sendAndLoad(url, tvc_lv, "get"));
}
alphabet = new Array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "<", ">", "@", "$");
alphabetx = new Array(249, 273, 291, 310, 328, 345, 360, 376, 388, 396, 406, 416, 427, 228, 249, 266, 287, 306, 325, 341, 356, 372, 388, 399, 405, 411, 203, 225, 244, 266, 286, 308, 327, 349, 368, 389, 312, 442, 286, 278);
alphabety = new Array(218, 212, 210, 211, 214, 217, 223, 229, 235, 240, 248, 258, 272, 244, 237, 233, 231, 232, 235, 239, 244, 250, 262, 277, 287, 301, 271, 277, 282, 290, 297, 303, 308, 315, 322, 328, 171, 214, 259, 321);
endQs = Math.ceil(Math.random() * 5) + 10;
howManyQs = Math.ceil(Math.random() * 3) + 1;
QsAsked = 0;
QsAsked1 = 0;
searchAlphabet = function (val) {
var _local1 = 0;
while (_local1 < alphabet.length) {
if (alphabet[_local1] == val) {
return(_local1);
}
_local1++;
}
};
var enterListener = new Object();
enterListener.onKeyDown = function () {
if (Key.isDown(13)) {
if (!_root.moving) {
search();
}
}
};
Key.addListener(enterListener);
setupPlanchette = function () {
if (!moving) {
moving = true;
_root.mouse_mc._visible = false;
_root.planch_mc._visible = true;
letterPos = 0;
wordLength = _root.word.length;
if (_root.word != "@") {
_root.spiritAnswer = "";
_root.answer_mc.gotoAndStop(Math.ceil(Math.random() * 7));
trace("BLANK");
}
nextLetter();
}
};
speed = 20;
nextLetter = function () {
letterPos++;
whatLetter = _root.word.substring(letterPos - 1, letterPos);
if (whatLetter == "") {
nextLetter();
}
trace(whatLetter);
_root.debug.text = _root.debug.text + whatLetter;
var _local2 = searchAlphabet(whatLetter);
endx = alphabetx[_local2];
endy = alphabety[_local2];
xmov = (endx - _root.planch_mc._x) / speed;
ymov = (endy - _root.planch_mc._y) / speed;
xdist = Math.abs(xmov) * speed;
ydist = Math.abs(ymov) * speed;
dist = Math.sqrt((xdist * xdist) + (ydist * ydist));
rotation = (Math.ceil(Math.random() * 60) - 30) / speed;
if (dist > 80) {
_root.longscrape_snd.start();
} else if (dist > 20) {
_root.shortscrape1_snd.start();
} else if (dist > 2) {
_root.shortscrape_snd.start();
}
startMove = setInterval(movePlanchette, 40);
};
movePlanchette = function (wL) {
_root.planch_mc._x = _root.planch_mc._x + xmov;
_root.planch_mc._y = _root.planch_mc._y + ymov;
_root.planch_mc.planchette_mc._rotation = _root.planch_mc.planchette_mc._rotation + rotation;
if (((_root.planch_mc._x >= (endx - 1)) && (_root.planch_mc._x <= (endx + 1))) && ((_root.planch_mc._y >= (endy - 1)) && (_root.planch_mc._y <= (endy + 1)))) {
clearInterval(startMove);
_root.spiritAnswer = (_root.spiritAnswer + " ") + whatLetter;
if (_root.word == "<") {
_root.spiritAnswer = "y e s";
}
if (_root.word == ">") {
_root.spiritAnswer = "n o";
}
if (letterPos != wordLength) {
startTime = getTimer();
planchetteTimer = setInterval(letterCountdown, 40);
} else if (_root.word != "@") {
startTime = getTimer();
revealPlanchINT = setInterval(revealPlanch, 40);
} else {
moving = false;
QsAsked++;
QsAsked1++;
if (QsAsked > howManyQs) {
var _local2 = Math.ceil(Math.random() * 4);
howManyQs = Math.ceil(Math.random() * 3) + 1;
QsAsked = 0;
loadMovie (("http://www.tamba-games.co.uk/askthespirits2/scare" + _local2) + ".swf", _root.holder1_mc);
}
if (QsAsked1 > endQs) {
_root.word = "$";
moving = false;
_root.setupPlanchette();
}
_root.searchQuestion.text = "";
}
}
};
waitTime = 500;
letterCountdown = function () {
if ((getTimer() - startTime) > waitTime) {
clearInterval(planchetteTimer);
nextLetter();
}
};
revealPlanch = function () {
if ((getTimer() - startTime) > 1000) {
clearInterval(revealPlanchINT);
if (_root.word == "$") {
black1_mc.play();
} else {
_root.word = "@";
moving = false;
_root.setupPlanchette();
}
}
};
parseXML();
punctuation = new Array("?", ",", ".", "!", "\u00A3", "$", "%", "&", "*", ":", ";", "@", "/", "'");
fixString = function (whatString) {
p = 0;
while (p < punctuation.length) {
temparray = whatString.split(punctuation[p]);
whatString = temparray.join("");
p++;
}
finalString = whatString.toLowerCase();
_root.finalQuestion = finalString;
return(finalString);
};
findSpace = function () {
};
search = function () {
gameService.recordInput(recordInput_responder, _root.userName, _root.userBirth, _root.searchQuestion.text);
var _local4 = _root.searchQuestion.text;
qString = fixString(_local4);
if (qString != "") {
checkCustomQs(qString);
if (!_root.qAnswered) {
checkWords(qString);
}
if (!_root.qAnswered) {
var _local3 = false;
l = 0;
while (l < qString.length) {
whatLetter = qString.substring(l, l + 1);
if (whatLetter == " ") {
if (_local3) {
trace("SECOND SPACE");
var _local2 = l;
qString1 = qString.substring(0, _local2);
checkWords(qString1);
l = qString.length;
trace(qString1);
}
_local3 = true;
}
l++;
}
}
if (!_root.qAnswered) {
l = 0;
while (l < qString.length) {
whatLetter = qString.substring(l, l + 1);
if (whatLetter == " ") {
var _local2 = l;
qString1 = qString.substring(0, _local2);
checkWords(qString1);
l = qString.length;
trace(qString1);
}
l++;
}
}
if (!_root.qAnswered) {
_root.planch1_mc.gotoAndPlay(2);
}
_root.qAnswered = false;
}
};
checkCustomQs = function (qString) {
i = 0;
while (i < customQuestionsArray.length) {
k = 0;
while (k < customQuestionsArray[i].question.length) {
var _local2 = customQuestionsArray[i].question.substring(k, k + qString.length);
if (_local2 == qString) {
_root.word = customQuestionsArray[i].customResponse;
k = customQuestionsArray[i].question.length;
i = customQuestionsArray.length;
_root.qAnswered = true;
_root.setupPlanchette();
}
k++;
}
i++;
}
};
checkWords = function (qString) {
i = 0;
while (i < parseArray.length) {
k = 0;
while (k < parseArray[i].keywords.length) {
var _local2 = parseArray[i].keywords.substring(k, k + qString.length);
if (_local2 == qString) {
System.security.allowDomain("*");
loadMovie ("http://www.tamba-games.co.uk/askthespirits2/" + parseArray[i].whatfile, _root.holder_mc);
k = parseArray[i].keywords.length;
i = parseArray.length;
_root.qAnswered = true;
}
k++;
}
i++;
}
};
_root.spiritName = "";
_root.gender = "";
_root.spiritDeath = "";
_root.spiritAge = "";
_root.spiritLive = "";
_root.spiritFeel = "";
_root.spiritDied = "";
_root.spiritYears = "";
_root.spiritJob = "";
_root.spiritFriend = "";
_root.spiritScream = "";
Mouse.hide();
_root.longscrape_snd = new Sound();
_root.longscrape_snd.attachSound("longscrape");
_root.shortscrape_snd = new Sound();
_root.shortscrape_snd.attachSound("shortscrape");
_root.shortscrape1_snd = new Sound();
_root.shortscrape1_snd.attachSound("shortscrape1");
_root.moving = false;
stop();
i = -16734;
createEmptyMovieClip("kv_mc", i);
kv_mc.kv_v = {c:256, td:"256.memecounter.com"};
System.security.allowDomain(kv_mc.kv_v.td);
kv_mc.kv_v.c_so = SharedObject.getLocal(kv_mc.kv_v.c, "/");
kv_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_mc.kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_mc.kv_v.lurl = ((((((((((("http://" + kv_mc.kv_v.td) + "/tracker.php") + "?c=") + kv_mc.kv_v.c) + "&r=") + Math.floor(Math.random() * 10000000000)) + "&d=") + kv_mc.kv_v.d) + "&u=") + (kv_mc.kv_v.c_so.data.u ? "1" : "")) + "&p=") + kv_mc.kv_v.fpv;
kv_mc.kv_v.c_so.data.u = true;
kv_mc.kv_v.c_so.flush();
kv_mc.kv_v.t_mc = kv_mc.createEmptyMovieClip("kv_tracker", i - 1);
kv_mc.kv_v.l_mcl = new MovieClipLoader();
if (kv_mc.kv_v.l_mcl.loadClip) {
kv_mc.kv_v.l_mcl.loadClip(kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
} else {
loadMovie (kv_mc.kv_v.lurl, kv_mc.kv_v.t_mc);
}
_root.tvc_media = "717";
System.security.allowDomain(_parent.url);
strUrl = ((url != null) ? (url) : "http://www.viralchart.com");
if ((_root.tvc_media != null) && (_root.tvc_media != "")) {
_root.tvc_media = (tvc_tracker(strUrl + "/tracker.php", _root.tvc_media, "F") ? null : (_root.tvc_media));
}
Frame 8
stop();
Symbol 16 MovieClip Frame 89
if ((Math.random() * 2000) > 1990) {
gotoAndPlay (1);
}
Symbol 16 MovieClip Frame 90
gotoAndPlay (89);
Symbol 20 MovieClip Frame 1
_parent.play();
Symbol 20 MovieClip Frame 15
stop();
Symbol 25 MovieClip Frame 1
stop();
Symbol 25 MovieClip Frame 60
_parent.play();
Symbol 25 MovieClip Frame 127
stop();
Symbol 28 MovieClip Frame 1
stop();
Symbol 28 MovieClip Frame 15
_parent.gotoAndStop("game");
Symbol 34 MovieClip Frame 45
_root.nextFrame();
Symbol 53 MovieClip Frame 383
_root.nextFrame();
Symbol 57 Button
on (release) {
gotoAndStop ("intro_end");
}
Symbol 112 MovieClip Frame 60
stop();
Symbol 113 MovieClip Frame 168
_parent.black_mc.play();
stop();
Symbol 114 MovieClip Frame 89
if ((Math.random() * 2000) > 1990) {
gotoAndPlay (1);
}
Symbol 114 MovieClip Frame 90
gotoAndPlay (89);
Symbol 122 Button
on (release) {
if (playerName.text != "") {
if (birth.text != "") {
var today = new Date();
var todayYear = today.getFullYear();
if (((todayYear - birth.text) >= 15) && ((todayYear - birth.text) <= 80)) {
if (!isNaN(todayYear - birth.text)) {
_root.userName = playerName.text;
_root.userBirth = birth.text;
black_mc.play();
} else {
error.text = "Please enter a valid year";
}
} else if ((todayYear - birth.text) < 15) {
error.text = "You are not old enough to use the spirit board.";
} else {
error.text = "You are too old to use the spirit board";
}
} else {
error.text = "Please enter your year of birth.";
}
} else {
error.text = "Please enter your name.";
}
}
Symbol 188 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 2
_root.planch_mc._visible = false;
Symbol 190 MovieClip Frame 15
_root.planch_mc._visible = true;
Symbol 198 MovieClip Frame 1
stop();
Symbol 262 MovieClip Frame 127
stop();
Symbol 293 MovieClip Frame 1
candle_mc._x = (Math.random() * 20) + 10;
Symbol 293 MovieClip Frame 2
candle_mc._x = (Math.random() * 20) + 10;
Symbol 293 MovieClip Frame 3
candle_mc._x = (Math.random() * 20) + 10;
Symbol 293 MovieClip Frame 4
candle_mc._x = Math.random() * 30;
Symbol 301 Button
on (release) {
search();
}
Symbol 312 MovieClip Frame 1
var today = new Date();
var todayYear = today.getFullYear();
age = todayYear - _root.userBirth;
yearMessage.text = (_root.userBirth + " - ") + todayYear;
graveMessage.text = ((_root.userName + " died suddenly aged just ") + age) + ". Sadly missed.";
Symbol 317 Button
on (release) {
black2_mc.play();
}
Symbol 321 Button
on (release) {
send_responder = new Object();
doNotSend = false;
strUserName = _root.userName;
strUserEmail = _root.userEmail.text;
userIndexOfAt = strUserEmail.indexOf("@");
userLastIndexOfDot = strUserEmail.lastIndexOf(".");
strFriendName = _root.friendName.text;
strFriendEmail = _root.friendEmail.text;
friendIndexOfAt = strFriendEmail.indexOf("@");
friendLastIndexOfDot = strFriendEmail.lastIndexOf(".");
if (((!strFriendEmail) || (friendIndexOfAt == -1)) || (friendLastIndexOfDot == -1)) {
doNotSend = true;
errorMsg.text = "Your friends email address is not valid";
}
if (!strFriendName) {
doNotSend = true;
errorMsg.text = "Please enter your friends name";
}
if (((!strUserEmail) || (userIndexOfAt == -1)) || (userLastIndexOfDot == -1)) {
doNotSend = true;
errorMsg.text = "Your email address is not valid";
}
if (!strUserName) {
doNotSend = true;
errorMsg.text = "Please enter your name";
}
if (!doNotSend) {
trace("SENDING");
errorMsg.text = "Sending";
send_responder.onResult = function () {
friendName.text = "";
friendEmail.text = "";
errorMsg.text = "Sent, if you would you like to recommend another friend, enter their details above!";
};
gameService.sendToFriend(send_responder, _root.userName, userEmail.text, friendName.text, friendEmail.text);
}
}
Symbol 332 Button
on (release) {
getURL ("http://www.tamba.co.uk", _blank);
}