Frame 1
function tvc_tracker(url, media_id, format) {
tvc_lv = new LoadVars();
tvc_lv.media = media_id;
tvc_lv.f = format;
trace("media: " + media_id);
return(tvc_lv.sendAndLoad(url, tvc_lv, "get"));
}
absURL = "http://www.uniquematch.org.uk/media/uniquegame/";
kv_v = {c:476, 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();
strUrl = ((url != null) ? (url) : "http://www.viralchart.com");
_root.tvc_media = 860;
if ((_root.tvc_media != null) && (_root.tvc_media != "")) {
_root.tvc_media = (tvc_tracker(strUrl + "/tracker.php", _root.tvc_media, "F") ? null : (_root.tvc_media));
}
nameLength = 20;
numScores = 20;
nameEntered = "";
Frame 2
percent = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
percentDisplay = percent + "%";
ifFrameLoaded (_root._totalframes) {
gotoAndPlay ("endLoad");
}
Frame 3
gotoAndPlay ("loader");
Frame 4
function strPad(str, places, pad, side) {
while (length(str) < places) {
if (side == "left") {
str = pad add str;
} else {
str = str add pad;
}
}
return(str);
}
function isValidEmail(email) {
if ((email.indexOf("@") != -1) && (email.lastIndexOf(".") > email.indexOf("@"))) {
return(true);
}
return(false);
}
function updateScreen() {
i = 0;
while (i <= 4) {
j = 0;
while (j <= 4) {
if (_root[("tile" + i.toString()) + j.toString()].dropped) {
_root[("tile" + i.toString()) + j.toString()].tile_mc.person.gotoAndStop(_root[("tile" + i.toString()) + j.toString()].faceNum);
_root[("tile" + i.toString()) + j.toString()].tile_mc.protein.gotoAndStop(_root[("tile" + i.toString()) + j.toString()].proteinNum);
_root[("tile" + i.toString()) + j.toString()]._visible = true;
}
j++;
}
i++;
}
livesDisplay = strPad(String(lives), 2, "0", "left");
scoreDisplay = strPad(String(score), 6, "0", "left");
levelDisplay = strPad(String(difficulty), 2, "0", "left");
playerTile._x = 46.5 + (tileX * 65);
}
soundToggle = 1;
pauseable = false;
var swish = new Sound();
swish.attachSound("swish");
var click = new Sound();
click.attachSound("click");
var chime = new Sound();
chime.attachSound("chime");
var music = new Sound();
music.attachSound("music");
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (pauseable) {
if (Key.getCode() == 27) {
pauseDisplay._visible = false;
paused = false;
pauseable = false;
gotoAndStop ("mainMenu");
}
if (Key.getCode() == 80) {
if (!paused) {
pauseDisplay._visible = true;
paused = true;
stop();
} else {
pauseDisplay._visible = false;
paused = false;
play();
}
}
}
};
Key.addListener(keyListener);
swish.start();
Frame 10
swish.start();
Frame 54
swish.start();
Frame 60
swish.start();
Frame 93
click.start();
Frame 103
click.start();
Frame 104
music.start(0, 9999999);
Frame 105
pauseable = false;
stop();
Frame 106
if (menuOption == 3) {
menuContent.gotoAndPlay(menuOption);
} else if (menuOption == 5) {
menuContent.gotoAndStop("highScore");
} else {
menuContent.gotoAndStop(menuOption);
}
stop();
Frame 107
function randomiseTile() {
faceNum = Math.round(Math.random() * 5) + 1;
playerTile.tile_mc.person.gotoAndStop(faceNum);
proteinNum = Math.round(Math.random() * (difficulty + 8)) + 1;
playerTile.tile_mc.protein.gotoAndStop(proteinNum);
}
function initTiles() {
i = 0;
while (i <= 4) {
j = 0;
while (j <= 4) {
_root[("tile" + i.toString()) + j.toString()]._visible = false;
_root[("tile" + i.toString()) + j.toString()].dropped = false;
_root[("tile" + i.toString()) + j.toString()].proteinNum = 0;
_root[("tile" + i.toString()) + j.toString()].matched = false;
_root[("tile" + i.toString()) + j.toString()].falling = 0;
_root[("tile" + i.toString()) + j.toString()].fading = 0;
j++;
}
i++;
}
}
function strPad(str, places, pad, side) {
while (length(str) < places) {
if (side == "left") {
str = pad add str;
} else {
str = str add pad;
}
}
return(str);
}
pauseable = true;
pauseDisplay._visible = false;
tileX = 2;
speed = 0;
difficulty = 1;
score = 0;
tileCount = 1;
maxLevels = 10;
tilesPerLevel = 20;
newTile = false;
leftArrowPressed = false;
rightArrowPressed = false;
initTiles();
randomiseTile();
boardFilled = false;
lifePause = 0;
lives = 3;
chimePlay = false;
updateScreen();
Frame 108
noTilesAnimating = true;
if (lifePause > 0) {
lifePause++;
}
if (lifePause == 50) {
lives--;
initTiles();
boardFilled = false;
lifePause = 0;
tileCount = 1;
playerTile._visible = true;
}
if (lifePause == 0) {
if (Key.isDown(37) && (tileX > 0)) {
if (((!leftArrowPressed) && (!_root[("tile" + (tileX - 1).toString()) + (tileY + 1).toString()].dropped)) && (playerTile._y < 351.5)) {
leftArrowPressed = true;
tileX--;
}
} else {
leftArrowPressed = false;
}
if (Key.isDown(39) && (tileX < 4)) {
if (((!rightArrowPressed) && (!_root[("tile" + (tileX + 1).toString()) + (tileY + 1).toString()].dropped)) && (playerTile._y < 351.5)) {
rightArrowPressed = true;
tileX++;
}
} else {
rightArrowPressed = false;
}
if (Key.isDown(40)) {
speed = 9;
} else {
speed = 0;
}
i = 0;
while (i <= 4) {
j = 0;
while (j <= 3) {
if ((_root[("tile" + i.toString()) + j.toString()].dropped && (!_root[("tile" + i.toString()) + (j + 1).toString()].dropped)) && (!_root[("tile" + i.toString()) + j.toString()].matched)) {
noTilesAnimating = false;
if (_root[("tile" + i.toString()) + j.toString()].falling == 0) {
_root[("tile" + i.toString()) + j.toString()].falling = 1;
}
}
if (_root[("tile" + i.toString()) + j.toString()].falling > 0) {
if (_root[("tile" + i.toString()) + j.toString()].falling <= 5) {
_root[("tile" + i.toString()) + j.toString()].falling++;
_root[("tile" + i.toString()) + j.toString()]._y = _root[("tile" + i.toString()) + j.toString()]._y + 15;
} else {
click.start();
_root[("tile" + i.toString()) + (j + 1).toString()].dropped = true;
_root[("tile" + i.toString()) + (j + 1).toString()].proteinNum = _root[("tile" + i.toString()) + j.toString()].proteinNum;
_root[("tile" + i.toString()) + (j + 1).toString()].faceNum = _root[("tile" + i.toString()) + j.toString()].faceNum;
_root[("tile" + i.toString()) + j.toString()]._visible = false;
_root[("tile" + i.toString()) + j.toString()].dropped = false;
_root[("tile" + i.toString()) + j.toString()].proteinNum = 0;
_root[("tile" + i.toString()) + j.toString()].matched = false;
_root[("tile" + i.toString()) + j.toString()]._y = _root[("tile" + i.toString()) + j.toString()]._y - 75;
_root[("tile" + i.toString()) + j.toString()].falling = 0;
}
}
j++;
}
i++;
}
i = 0;
while (i <= 4) {
j = 0;
while (j <= 4) {
if (_root[("tile" + i.toString()) + j.toString()].dropped) {
if (_root[("tile" + (i + 1).toString()) + j.toString()].dropped) {
if (_root[("tile" + i.toString()) + j.toString()].proteinNum == _root[("tile" + (i + 1).toString()) + j.toString()].proteinNum) {
_root[("tile" + i.toString()) + j.toString()].matched = true;
_root[("tile" + (i + 1).toString()) + j.toString()].matched = true;
}
}
if (_root[("tile" + (i - 1).toString()) + j.toString()].dropped) {
if (_root[("tile" + i.toString()) + j.toString()].proteinNum == _root[("tile" + (i - 1).toString()) + j.toString()].proteinNum) {
_root[("tile" + i.toString()) + j.toString()].matched = true;
_root[("tile" + (i - 1).toString()) + j.toString()].matched = true;
}
}
if (_root[("tile" + i.toString()) + (j - 1).toString()].dropped) {
if (_root[("tile" + i.toString()) + j.toString()].proteinNum == _root[("tile" + i.toString()) + (j - 1).toString()].proteinNum) {
_root[("tile" + i.toString()) + j.toString()].matched = true;
_root[("tile" + i.toString()) + (j - 1).toString()].matched = true;
}
}
if (_root[("tile" + i.toString()) + (j + 1).toString()].dropped) {
if (_root[("tile" + i.toString()) + j.toString()].proteinNum == _root[("tile" + i.toString()) + (j + 1).toString()].proteinNum) {
_root[("tile" + i.toString()) + j.toString()].matched = true;
_root[("tile" + i.toString()) + (j + 1).toString()].matched = true;
}
}
}
j++;
}
i++;
}
i = 0;
while (i <= 4) {
j = 0;
while (j <= 4) {
if (_root[("tile" + i.toString()) + j.toString()].matched) {
noTilesAnimating = false;
if (_root[("tile" + i.toString()) + j.toString()].fading == 0) {
_root[("tile" + i.toString()) + j.toString()].fading++;
}
if (_root[("tile" + i.toString()) + j.toString()].fading <= 25) {
if (_root[("tile" + i.toString()) + j.toString()].fading <= 10) {
_root[("tile" + i.toString()) + j.toString()].tile_mc._xscale = 100 - (_root[("tile" + i.toString()) + j.toString()].fading * 10);
_root[("tile" + i.toString()) + j.toString()].tile_mc._yscale = 100 - (_root[("tile" + i.toString()) + j.toString()].fading * 10);
} else if (_root[("tile" + i.toString()) + j.toString()].fading == 11) {
_root[("tile" + i.toString()) + j.toString()].explosion.gotoAndPlay("start");
}
_root[("tile" + i.toString()) + j.toString()].fading++;
} else {
_root[("tile" + i.toString()) + j.toString()]._visible = false;
_root[("tile" + i.toString()) + j.toString()].dropped = false;
_root[("tile" + i.toString()) + j.toString()].proteinNum = 0;
_root[("tile" + i.toString()) + j.toString()].matched = false;
_root[("tile" + i.toString()) + j.toString()].tile_mc._xscale = 100;
_root[("tile" + i.toString()) + j.toString()].tile_mc._yscale = 100;
_root[("tile" + i.toString()) + j.toString()].fading = 0;
score++;
}
}
j++;
}
i++;
}
if (newTile) {
if (noTilesAnimating) {
chimePlay = false;
playerTile._visible = true;
tileX = 2;
playerTile._y = 51.5;
newTile = false;
randomiseTile();
if (tileCount < tilesPerLevel) {
tileCount++;
} else {
tileCount = 1;
if (difficulty < maxLevels) {
difficulty++;
}
}
} else {
playerTile._visible = false;
}
} else {
if (playerTile._y < 351.5) {
playerTile._y = playerTile._y + (1 + speed);
if (playerTile._y > 351.5) {
playerTile._y = 351.5;
}
} else {
click.start();
newTile = true;
_root[("tile" + tileX.toString()) + 4].dropped = true;
_root[("tile" + tileX.toString()) + 4].faceNum = faceNum;
_root[("tile" + tileX.toString()) + 4].proteinNum = proteinNum;
}
tileY = int((playerTile._y - 51.5) / 75);
if (_root[("tile" + tileX.toString()) + (tileY + 1).toString()].dropped) {
click.start();
_root[("tile" + tileX.toString()) + tileY.toString()].dropped = true;
_root[("tile" + tileX.toString()) + tileY.toString()].faceNum = faceNum;
_root[("tile" + tileX.toString()) + tileY.toString()].proteinNum = proteinNum;
if ((tileY == 0) && (_root[("tile" + tileX.toString()) + tileY.toString()].proteinNum != _root[("tile" + tileX.toString()) + (tileY + 1).toString()].proteinNum)) {
lifePause = 1;
}
if (playerTile._y > (51.5 + (tileY * 75))) {
playerTile._y = 51.5 + (tileY * 75);
}
newTile = true;
}
}
}
if ((!noTilesAnimating) && (!chimePlay)) {
chimePlay = true;
chime.start();
}
if (lives < 1) {
playerTile._visible = false;
gotoAndPlay ("gameOver");
}
updateScreen();
Frame 109
gotoAndPlay ("mainLoop");
Frame 110
pauseable = false;
Frame 125
click.start();
Frame 167
scoreLoaded = false;
var result_lv = new LoadVars();
result_lv.onLoad = function (success) {
if (success) {
_root.scoreLoaded = true;
}
};
var send_lv = new LoadVars();
send_lv.newscore = 0;
send_lv.sendAndLoad(absURL + "updatescores.php", result_lv, "GET");
Frame 169
if (!scoreLoaded) {
gotoAndPlay ("scoreLoadLoop");
}
Frame 170
i = 1;
while (i <= numScores) {
_root["highScore" + i] = result_lv["highscore" + i];
i++;
}
if (score > _root["highScore" + numScores]) {
menuOption = 5;
gotoAndStop ("enterHighScore");
} else {
gotoAndStop ("mainMenu");
}
Symbol 20 MovieClip Frame 1
stop();
Symbol 29 Button
on (release) {
gotoAndPlay ("newGame");
}
Symbol 32 Button
on (release) {
menuOption = 1;
gotoAndStop ("enterHighScore");
}
Symbol 35 Button
on (release) {
menuOption = 3;
gotoAndStop ("enterHighScore");
}
Symbol 38 Button
on (release) {
menuOption = 2;
gotoAndStop ("enterHighScore");
}
Symbol 40 Button
on (release) {
soundToggle = 1 - soundToggle;
soundDisplay.gotoAndStop(2 - soundToggle);
click.setVolume(soundToggle * 100);
}
Symbol 41 Button
on (release) {
getURL ("http://www.uniquematch.org.uk/", "_blank");
_root.kvClick(825);
}
Symbol 42 Button
on (release) {
getURL ("http://www.anthonynolan.org.uk/", "_blank");
_root.kvClick(824);
}
Symbol 56 Button
on (release) {
getURL ("http://www.uniquematch.org.uk/", "_blank");
_root.kvClick(825);
}
Symbol 59 Button
on (release) {
_root.gotoAndStop("mainMenu");
}
Symbol 64 MovieClip Frame 1
stop();
Symbol 67 Button
on (release) {
if ((((FromName == "") || (FromEmail == "")) || (ToName == "")) || (ToEmail == "")) {
errorMsg.gotoAndStop("error");
} else if (_root.isValidEmail(FromEmail) && (_root.isValidEmail(ToEmail))) {
var result_lv = new LoadVars();
var send_lv = new LoadVars();
send_lv.FromName = FromName;
send_lv.FromEmail = FromEmail;
send_lv.ToName = ToName;
send_lv.ToEmail = ToEmail;
send_lv.sendAndLoad(_root.absURL + "sendfriend.php", result_lv, "POST");
FromName = "";
FromEmail = "";
ToName = "";
ToEmail = "";
errorMsg.gotoAndStop("done");
_root.kvEvent(1323);
} else {
errorMsg.gotoAndStop("email");
}
}
Symbol 143 Button
on (release) {
if ((_root.nameEntered.length < _root.nameLength) && (_root.nameEntered.length > 0)) {
_root.nameEntered = _root.nameEntered + " ";
}
}
Symbol 146 Button
on (release) {
if (_root.nameEntered.length > 0) {
_root.nameEntered = _root.nameEntered.substr(0, _root.nameEntered.length - 1);
}
}
Symbol 149 Button
on (release) {
if (_root.nameEntered != "") {
send_lv.newname = _root.nameEntered;
send_lv.newscore = _root.score;
send_lv.sendAndLoad(_root.absURL + "updatescores.php", result_lv, "POST");
gotoAndPlay ("scoreLoadLoop");
}
}
Symbol 152 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "N";
}
}
Symbol 155 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "O";
}
}
Symbol 158 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "P";
}
}
Symbol 161 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "Q";
}
}
Symbol 164 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "R";
}
}
Symbol 167 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "S";
}
}
Symbol 170 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "T";
}
}
Symbol 173 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "U";
}
}
Symbol 176 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "V";
}
}
Symbol 179 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "W";
}
}
Symbol 182 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "X";
}
}
Symbol 185 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "Y";
}
}
Symbol 188 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "Z";
}
}
Symbol 191 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "A";
}
}
Symbol 194 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "B";
}
}
Symbol 197 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "C";
}
}
Symbol 200 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "D";
}
}
Symbol 203 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "E";
}
}
Symbol 206 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "F";
}
}
Symbol 209 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "G";
}
}
Symbol 212 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "H";
}
}
Symbol 215 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "I";
}
}
Symbol 218 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "J";
}
}
Symbol 221 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "K";
}
}
Symbol 224 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "L";
}
}
Symbol 227 Button
on (release) {
if (_root.nameEntered.length < _root.nameLength) {
_root.nameEntered = _root.nameEntered + "M";
}
}
Symbol 228 MovieClip Frame 2
FromName = "";
FromEmail = "";
ToName = "";
ToEmail = "";
Selection.setFocus("input1");
Symbol 228 MovieClip Frame 3
scoreLoaded = false;
var result_lv = new LoadVars();
result_lv.onLoad = function (success) {
if (success) {
scoreLoaded = true;
}
};
var send_lv = new LoadVars();
send_lv.newscore = 0;
send_lv.sendAndLoad(_root.absURL + "updatescores.php", result_lv, "POST");
Symbol 228 MovieClip Frame 5
if (!scoreLoaded) {
gotoAndPlay ("scoreLoadLoop");
}
Symbol 228 MovieClip Frame 6
i = 1;
while (i <= _root.numScores) {
_root["highScore" + i] = result_lv["highscore" + i];
_root["highScoreDisplay" + i] = _root.strPad(_root["highScore" + i], 6, "0", "left");
_root["highName" + i] = result_lv["highname" + i];
i++;
}
stop();
Symbol 228 MovieClip Frame 7
_root.nameEntered = "";
var result_lv = new LoadVars();
var send_lv = new LoadVars();
scoreLoaded = false;
result_lv.onLoad = function (success) {
if (success) {
scoreLoaded = true;
}
};
Symbol 257 MovieClip Frame 1
stop();