Frame 1
_global.mcClickId = 422;
kv_v = {c:319, 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();
_global.masterDomain = "swarm.killerviral.com";
_global.assetsURL = "http://swarm.killerviral.com/tinymania/barrelsOfMonkeys/";
_global.isMaster = _root._url.indexOf(_global.masterDomain) >= 0;
_global.domain = ((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]));
_global.playerVersion = Number(getVersion().substr(getVersion().indexOf(" ") + 1).split(",")[0]);
_global.movieVersion = (_root.getSWFVersion ? (_root.getSWFVersion()) : 8);
_global.ori_dom = (_root.ori_dom ? (_root.ori_dom) : (domain));
System.security.allowDomain(_global.masterDomain);
var game_version = 3;
if (!testMode) {
stop();
if (playerVersion < 8) {
trace("player version too old - load error swf");
loadMovie (_global.assetsURL + "error.swf", _root);
} else if (isMaster) {
trace("is master - skip version checking");
play();
} else {
trace("check version...");
var vc_lv = new LoadVars();
vc_lv.onLoad = function (success) {
clearInterval(tOIntId);
delete tOIntId;
if (success) {
if (Number(vc_lv.v) > game_version) {
trace("version checking succeeded - not the latest version");
loadMovie ((_global.assetsURL + "game.swf?ori_dom=") + ori_dom, _root);
} else {
trace("version checking succeeded - latest version");
play();
}
} else {
trace("version checking failed");
play();
}
delete vc_lv;
};
tOIntId = setInterval(timeout, 2000);
vc_lv.load(_global.assetsURL + "v.php");
}
}
Frame 3
stop();
Frame 4
stop();
Frame 5
gotoAndStop ("start");
Symbol 95 MovieClip [__Packages.Snd] Frame 0
class Snd extends Sound
{
var target, manager, position, start, duration, onFadeComplete, fId, getVolume, setVolume, setPan;
function Snd (targ, sndman) {
super(targ);
target = (targ ? (targ) : _root);
manager = sndman;
}
function switchSound(id, loops) {
var _local3 = position;
super.stop();
super.attachSound(id);
start((_local3 % duration) / 1000, loops);
}
function fade(dVol, tVol, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), tVol, true);
}
function fadeBy(dVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), dVol * t, true);
}
}
function fadeTo(tVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
var _local3 = (tVol - getVolume()) / t;
trace((((("fadeTo: " + tVol) + ", ") + getVolume()) + ", ") + _local3);
fId = setInterval(this, "changeVolTowards", FADE_RATE, _local3, tVol, true);
} else {
setVolume(tVol);
}
}
function changeVolTowards(dVol, tVol, fading) {
var _local2 = getVolume();
if (Math.abs(dVol) < Math.abs(tVol - _local2)) {
changeVolume(dVol);
} else {
setVolume(tVol);
if (fading) {
stopFade();
}
}
}
function stopFade() {
if (fId) {
clearInterval(fId);
delete fId;
onFadeComplete();
delete onFadeComplete;
}
}
function positionSound(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
d = ((d < 1) ? 1 : (d));
var _local4 = 1 / ((d / f) * 100);
setVolume(Math.ceil(_local4 * t));
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function positionSoundLinear(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
setVolume(((f - d) / f) * t);
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function changeVolume(n) {
setVolume(getVolume() + n);
}
function remove() {
trace("removing sound " + this);
super.stop();
delete manager.sounds[target.getDepth()];
target.removeMovieClip();
}
function toString() {
return(("(target=" + target) + ")");
}
static var FADE_RATE = 100;
}
Symbol 96 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager extends Snd
{
var sounds, mc_holder, getVolume;
function SoundManager (hld_mc) {
super();
sounds = new Object();
mc_holder = (hld_mc ? (hld_mc) : _root);
}
function playAndRemove(snd_id, offset, loops) {
offset = (isNaN(offset) ? 0 : (offset));
loops = (isNaN(loops) ? 0 : (loops));
var _local2 = newSound(snd_id);
_local2.start(offset, loops);
_local2.onSoundComplete = _local2.remove;
return(_local2);
}
function clearAllSounds() {
for (var _local2 in sounds) {
sounds[_local2].remove();
}
}
function newSound() {
var _local5 = mc_holder.getNextHighestDepth();
var _local6 = mc_holder.createEmptyMovieClip("sh_mc" + _local5, _local5);
var _local4 = new Snd(_local6, this);
var _local3 = 0;
while (_local3 < arguments.length) {
if (arguments[_local3] != undefined) {
_local4.attachSound(arguments[_local3]);
}
_local3++;
}
sounds[_local5] = _local4;
return(_local4);
}
function deleteSound(snd) {
snd.remove();
}
function setVolume(vol) {
if (muted) {
curVol = vol;
} else {
super.setVolume(vol);
}
}
function get mute() {
return(muted);
}
function set mute(b) {
muted = b;
if (b) {
curVol = getVolume();
super.setVolume(0);
} else {
super.setVolume(curVol);
}
//return(mute);
}
var muted = false;
var curVol = 100;
}
Symbol 17 MovieClip Frame 100
gotoAndPlay (1);
Instance of Symbol 10 MovieClip in Symbol 18 MovieClip Frame 1
onClipEvent (load) {
this._visible = 0;
}
Symbol 18 MovieClip Frame 10
function onEnterFrame() {
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
if (getTimer() >= (startTime + 100)) {
animDone = true;
}
if ((Math.ceil(bar._width) >= width) && (animDone)) {
trace("loaded!");
stopSparks = true;
delete onEnterFrame;
gotoAndPlay ("out");
} 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 18 MovieClip Frame 22
stop();
Symbol 18 MovieClip Frame 28
_parent.play();
Symbol 31 Button
on (release) {
getURL ("http://www.tinymania.com", "_blank");
_root.kvClick(_global.mcClickId);
}
Symbol 37 Button
on (release) {
_parent.gotoAndStop("playGame");
}
Symbol 45 MovieClip Frame 1
if (!master) {
_global.soundBodge = this;
master = {};
_global.sndman = new SoundManager(_root.createEmptyMovieClip("snd_mc", _root.getNextHighestDepth()));
_global.master = master;
yesSound = _global.sndman.newSound("yesSound");
yesSound.onSoundComplete = function () {
this.remove();
};
yes1Sound = _global.sndman.newSound("yes1Sound");
yes1Sound.onSoundComplete = function () {
this.remove();
};
yes2Sound = _global.sndman.newSound("yes2Sound");
yes2Sound.onSoundComplete = function () {
this.remove();
};
yes3Sound = _global.sndman.newSound("yes3Sound");
yes3Sound.onSoundComplete = function () {
this.remove();
};
noSound = _global.sndman.newSound("noSound");
noSound.onSoundComplete = function () {
this.remove();
};
timeupSound = _global.sndman.newSound("timeupSound");
timeupSound.onSoundComplete = function () {
this.remove();
};
clickSound = _global.sndman.newSound("clickSound");
clickSound.onSoundComplete = function () {
this.remove();
};
lostSound = _global.sndman.newSound("lostSound");
lostSound.onSoundComplete = function () {
this.remove();
};
wonSound = _global.sndman.newSound("wonSound");
wonSound.onSoundComplete = function () {
this.remove();
};
master.playSound = function (s) {
trace((("playing " + s) + "Sound ") + this[s + "Sound"]);
_global.sndman.playAndRemove(s + "Sound");
};
}
stop();
Symbol 49 Button
on (release) {
getURL ("http://www.tinymania.com", "_blank");
_root.kvClick(_global.mcClickId);
}
Symbol 57 Button
on (press) {
if (!gameOver) {
master.playSound("no");
}
trace("MISSED!");
}
Symbol 63 MovieClip Frame 1
stop();
Symbol 63 MovieClip Frame 14
stop();
Symbol 65 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 2
anim.gotoAndStop("alive");
dead = false;
Symbol 65 MovieClip Frame 43
active = false;
gotoAndStop ("off");
Instance of Symbol 68 MovieClip in Symbol 69 MovieClip Frame 1
/* no clip actions */
Symbol 72 MovieClip Frame 4
if (_name != "shot") {
removeMovieClip(this);
}
Symbol 76 MovieClip Frame 1
function init() {
if (!runOnce) {
totalFrames = 750;
f = 0;
totalAliens = 0;
missScore = -1;
hitScore = 1;
counter = 0;
shotsMissed = 0;
alienStartFrequency = 25;
alienFrequency = alienStartFrequency;
minAlienFrequency = 8;
shotIndex = 0;
score = 0;
i = 1;
while (i <= 5) {
trace(i);
this["alien" + i].active = false;
this["alien" + i].onPress = shotAlien;
i++;
}
runOnce = true;
}
}
function mainLoop() {
if (!gameOver) {
f++;
} else if (crosshair._xscale < 1000) {
crosshair._xscale = (crosshair._yscale = crosshair._yscale * 1.2);
crosshair2._xscale = (crosshair2._yscale = crosshair2._yscale * 1.3);
} else {
crosshair2._visible = (crosshair._visible = false);
}
if (f == totalFrames) {
endGame();
} else {
counter++;
if (counter > alienFrequency) {
popUpAlien();
}
if (shotsMissed > lastShotsMissed) {
}
lastShotsMissed = shotsMissed;
}
}
function popUpAlien() {
counter = 0;
do {
selectedAlien = Math.ceil(Math.random() * 5);
} while (this["alien" + selectedAlien].active);
totalAliens++;
this["alien" + selectedAlien].gotoAndPlay("alive");
this["alien" + selectedAlien].active = true;
}
function shotAlien() {
if (!this.dead) {
if (!gameOver) {
this.dead = true;
master.playSound("yes");
this.anim.gotoAndPlay("dead");
updateScore(hitScore);
nextAlienFrequency = Math.ceil(alienStartFrequency - score);
if (nextAlienFrequency < minAlienFrequency) {
nextAlienFrequency = minAlienFrequency;
}
alienFrequency = nextAlienFrequency;
shotsMissed--;
}
}
}
function updateScore(n) {
score = score + n;
}
function endGame() {
finalScore = 1;
if (!endGameOnce) {
master.show();
gameOver = true;
finalScore = score / totalAliens;
finalScore = Math.floor(finalScore * 100);
trace((("MISSED=" + shotsMissed) + ", shotindex:") + shotIndex);
accuracy = 1 - (shotsMissed / shotIndex);
trace(("accuracy=" + (accuracy * 100)) + "%");
trace((((score + "/") + totalAliens) + "=") + finalScore);
finalScore = finalScore * ((accuracy + 1) / 2);
finalScore = Math.floor(finalScore);
master.playSound("timeup");
finalScore = (isNaN(finalScore) ? 1 : (finalScore));
trace("FINAL SCORE=" + finalScore);
_parent.endGameBlackOut(finalScore, "timeup");
endGameOnce = true;
}
}
onMouseDown = function () {
if (!gameOver) {
shotIndex++;
duplicateMovieClip (this.shot, "shot" + shotIndex, this.getNextHighestDepth());
this["shot" + shotIndex]._x = crosshair._x;
this["shot" + shotIndex]._y = crosshair._y;
shotsMissed++;
}
};
controller.onEnterFrame = mainLoop;
init();
stop();
Instance of Symbol 65 MovieClip "alien2" in Symbol 76 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 69 MovieClip "crosshair" in Symbol 76 MovieClip Frame 1
onClipEvent (load) {
startDrag (this);
master.hide();
_x = _parent._xmouse;
_y = _parent._ymouse;
}
Instance of Symbol 70 MovieClip "crosshair2" in Symbol 76 MovieClip Frame 1
onClipEvent (enterFrame) {
_x = ((_parent.crosshair._x + (_x * 4)) / 5);
_y = ((_parent.crosshair._y + (_y * 4)) / 5);
}
Symbol 82 Button
on (release) {
getURL ("http://www.tinymania.com/", "_blank");
_root.kvClick(_global.mcClickId);
}
Symbol 86 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 8
stop();
Symbol 90 Button
on (release) {
play();
}
Symbol 91 Button
on (release) {
getURL ("http://www.tinymania.com/", "_blank");
_root.kvClick(_global.mcClickId);
}
Symbol 93 Button
on (release) {
getURL ("http://www.tinymania.com", "_blank");
_root.kvClick(420);
}
Symbol 94 MovieClip Frame 1
function endGameBlackOut(s, m) {
scorePercentage = s;
if (!playOnce) {
playOnce = true;
playWhat = "start";
if (m) {
endGameMessage.gotoAndStop(m);
} else {
endGameMessage.gotoAndStop("blank");
playWhat = "skip";
}
gotoAndPlay(playWhat);
}
}
_parent.endGameBlackOut = endGameBlackOut;
stop();
Symbol 94 MovieClip Frame 15
scoreDisplay.text = ("You scored " + scorePercentage) + "%!";
scoreDisplayShadow.text = scoreDisplay.text;
stop();
Symbol 94 MovieClip Frame 25
master.endGame(scorePercentage);
_parent.gotoAndStop("reset");
stop();