Frame 1
function itemHandler1(obj, item) {
getURL ("http://www.newgrounds.com/", "_blank");
}
function itemHandler2(obj, item) {
getURL ("jayden159@gmail.com");
}
function itemHandler5(obj, item) {
_quality = "high";
}
function itemHandler6(obj, item) {
_quality = "medium";
}
function itemHandler7(obj, item) {
_quality = "low";
}
root_cm = new ContextMenu();
root_cm.hideBuiltInItems();
aaa_cmi = new ContextMenuItem("Newgrounds Everything by Everyone", itemHandler1);
bbb_cmi = new ContextMenuItem("Email Developer", itemHandler2);
eee_cmi = new ContextMenuItem("High Quality", itemHandler5);
fff_cmi = new ContextMenuItem("Mid Quality", itemHandler6);
ggg_cmi = new ContextMenuItem("Low Quality", itemHandler7);
ccc_cmi.separatorBefore = true;
eee_cmi.separatorBefore = true;
root_cm.customItems.push(aaa_cmi, bbb_cmi, ccc_cmi, ddd_cmi, eee_cmi, fff_cmi, ggg_cmi);
_root.menu = root_cm;
stop();
mochi.as2.MochiServices.connect("b842f3b564d1cf04");
NewgroundsAPI.connectMovie(6736);
kills = 0;
totalscore = 0;
angryscore = 0;
happyscore = 0;
colour = 0;
Frame 36
if (savefile.data.score == undefined) {
_root.kills = 0;
_root.totalscore = 0;
_root.angryscore = 0;
_root.happyscore = 0;
_root.colour = 0;
} else {
_root.kills = savefile.data.score;
_root.totalscore = savefile.data.score;
_root.angryscore = savefile.data.score;
_root.happyscore = savefile.data.score;
_root.colour = savefile.data.score;
}
stop();
Mouse.show();
AmountSpawned = 50;
CurrentNumber = 0;
while (CurrentNumber != AmountSpawned) {
_root["ball_" + CurrentNumber];
CurrentNumber = CurrentNumber + 1;
}
Frame 37
Mouse.show();
savefile.data.score = _root.kills;
savefile.data.score = _root.totalscore;
savefile.data.score = _root.angryscore;
savefile.data.score = _root.happyscore;
savefile.data.score = _root.colour;
savefile.flush();
stop();
endGame = true;
onEnterFrame = function () {
if (endGame == true) {
_root["ball_" + i].removeMovieClip();
_root.ball_0.removeMovieClip();
}
};
AmountSpawned = 50;
CurrentNumber = 0;
while (CurrentNumber != AmountSpawned) {
_root["ball_" + CurrentNumber];
CurrentNumber = CurrentNumber + 1;
}
_root.totalscore = ((_root.angryscore + _root.happyscore) + _root.colour) + _root.kills;
Frame 38
stop();
Frame 39
stop();
var o = {n:[6, 15, 3, 0, 8, 13, 11, 11, 15, 10, 2, 6, 12, 9, 11, 7], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:boardID});
Frame 73
_root.gotoAndPlay("mainmenu");
Frame 74
stop();
kills = 0;
speed = 20;
passed = 0;
placed = 0;
velocity = 5;
endGame = false;
_root.onEnterFrame = function () {
passed++;
if (passed > speed) {
passed = 0;
collect = _root.attachMovie("ball", "ball_" + placed, _root.getNextHighestDepth(), {_x:Math.random() * 500, _y:Math.random() * 500});
collect.gotoAndStop(Math.floor(Math.random() * collect._totalframes) + 1);
collect.angle = Math.random() * 6.28318531;
collect.xspeed = velocity * Math.cos(collect.angle);
collect.yspeed = velocity * Math.sin(collect.angle);
collect.onEnterFrame = function () {
this._width = this._width + growth;
this._height = this._height + growth;
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
x_dist = this._x - player._x;
y_dist = this._y - player._y;
if (this._x < 0) {
this._x = 0;
this.xspeed = this.xspeed * -1;
}
if (this._x > 600) {
this._x = 600;
this.xspeed = this.xspeed * -1;
}
if (this._y < 0) {
this._y = 0;
this.yspeed = this.yspeed * -1;
}
if (this._y > 500) {
this._y = 500;
this.yspeed = this.yspeed * -1;
}
distance = (x_dist * x_dist) + (y_dist * y_dist);
touch_distance = ((player._width + this._width) / 2) * ((player._width + this._width) / 2);
if (distance < touch_distance) {
if (this._currentframe == player._currentframe) {
_root.kills++;
this.removeMovieClip();
_root.life = _root.life + 2;
}
if (this._currentframe != _root.player._currentframe) {
_root.life = _root.life - 2;
}
}
};
}
};
function countdown() {
if (timer <= 0) {
gotoAndStop ("end");
}
}
life = 100;
Mouse.hide();
timer = 60;
setInterval(countdown, 1000);
kills = 0;
Instance of Symbol 162 MovieClip "colourselect" in Frame 74
onClipEvent (enterFrame) {
if (Key.isDown(65)) {
this.gotoAndStop("green");
_root.player.gotoAndStop(3);
} else if (Key.isDown(83)) {
this.gotoAndStop("blue");
_root.player.gotoAndStop(4);
} else if (Key.isDown(68)) {
this.gotoAndStop("yellow");
_root.player.gotoAndStop(1);
} else if (Key.isDown(70)) {
this.gotoAndStop("red");
_root.player.gotoAndStop(2);
} else if (Key.isDown(71)) {
this.gotoAndStop("purple");
_root.player.gotoAndStop(5);
}
}
Instance of Symbol 169 MovieClip "lifebar" in Frame 74
onClipEvent (enterFrame) {
_root.lifebar._width = _root.life;
if (_root.life <= 0) {
_root.gotoAndStop("gameselect");
}
}
Instance of Symbol 16 MovieClip [ball] "player" in Frame 74
onClipEvent (enterFrame) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
Frame 76
stop();
life = 100;
var notallowedtoduplicate = false;
var int1 = 0;
colour = 0;
stop();
var notallowedtoduplicate = false;
var int1 = 0;
var notallowedtoduplicate = false;
var int1 = 0;
speed = 70;
passed = 0;
placed = 0;
velocity = 5;
endGame = false;
_root.onEnterFrame = function () {
passed++;
if (passed > speed) {
passed = 0;
collect = _root.attachMovie("ball", "ball_" + placed, _root.getNextHighestDepth(), {_x:Math.random() * 500, _y:Math.random() * 500});
collect.gotoAndStop(Math.floor(Math.random() * collect._totalframes) + 1);
collect.angle = Math.random() * 6.28318531;
collect.xspeed = velocity * Math.cos(collect.angle);
collect.yspeed = velocity * Math.sin(collect.angle);
collect.onEnterFrame = function () {
x_dist = this._x - player._x;
y_dist = this._y - player._y;
if (this._x < 0) {
this._x = 0;
this.xspeed = this.xspeed * -1;
}
if (this._x > 600) {
this._x = 600;
this.xspeed = this.xspeed * -1;
}
if (this._y < 0) {
this._y = 0;
this.yspeed = this.yspeed * -1;
}
if (this._y > 500) {
this._y = 500;
this.yspeed = this.yspeed * -1;
}
distance = (x_dist * x_dist) + (y_dist * y_dist);
touch_distance = ((player._width + this._width) / 2) * ((player._width + this._width) / 2);
if (distance < touch_distance) {
if (this._currentframe == player._currentframe) {
_root.colour++;
_root.life = _root.life + 1;
this.removeMovieClip();
}
if (!(this._currentframe === _root.player._currentframe)) {
_root.life = _root.life - 1;
}
}
};
}
};
Instance of Symbol 162 MovieClip "colourselect" in Frame 76
onClipEvent (enterFrame) {
if (Key.isDown(65)) {
this.gotoAndStop("green");
_root.player.gotoAndStop(3);
} else if (Key.isDown(83)) {
this.gotoAndStop("blue");
_root.player.gotoAndStop(4);
} else if (Key.isDown(68)) {
this.gotoAndStop("yellow");
_root.player.gotoAndStop(1);
} else if (Key.isDown(70)) {
this.gotoAndStop("red");
_root.player.gotoAndStop(2);
} else if (Key.isDown(71)) {
this.gotoAndStop("purple");
_root.player.gotoAndStop(5);
}
}
Instance of Symbol 16 MovieClip [ball] "player" in Frame 76
onClipEvent (load) {
var framecount = 0;
_root.int1 = 0;
speed = 10;
shot_level = 50;
xb = _x;
yb = _y;
}
onClipEvent (enterFrame) {
framecount++;
if ((framecount / 32) == Math.round(framecount / 32)) {
duplicateMovieClip (_root.balls, "balls" + _root.int1, _root.getNextHighestDepth());
_root.int1++;
}
if (Key.isDown(39) and (this._x < 550)) {
xb = xb + speed;
} else if (Key.isDown(37) and (this._x > 50)) {
xb = xb - speed;
}
if (Key.isDown(40) and (this._y < 500)) {
yb = yb + speed;
} else if (Key.isDown(38) and (this._y > 50)) {
yb = yb - speed;
}
this._x = _x + ((xb - _x) / speed);
this._y = _y + ((yb - _y) / speed);
}
Instance of Symbol 173 MovieClip "balls" in Frame 76
onClipEvent (load) {
this._y = -50;
this._x = random(600);
this.gotoAndStop(Math.floor(Math.random() * _totalframes) + 1);
}
onClipEvent (enterFrame) {
if (this._name != "balls") {
this._y = this._y + 4;
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.guard)) {
this.removeMovieClip();
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.player)) {
_root.life = _root.life - 2;
}
}
Instance of Symbol 169 MovieClip "lifebar" in Frame 76
onClipEvent (enterFrame) {
_root.lifebar._width = _root.life;
if (_root.life <= 0) {
_root.gotoAndStop("gameselect");
}
}
Frame 77
stop();
life = 100;
var notallowedtoduplicate = false;
var int1 = 0;
happyscore = 0;
Instance of Symbol 162 MovieClip "colourselect" in Frame 77
onClipEvent (enterFrame) {
if (Key.isDown(65)) {
this.gotoAndStop("green");
_root.player.gotoAndStop(3);
} else if (Key.isDown(83)) {
this.gotoAndStop("blue");
_root.player.gotoAndStop(4);
} else if (Key.isDown(68)) {
this.gotoAndStop("yellow");
_root.player.gotoAndStop(1);
} else if (Key.isDown(70)) {
this.gotoAndStop("red");
_root.player.gotoAndStop(2);
} else if (Key.isDown(71)) {
this.gotoAndStop("purple");
_root.player.gotoAndStop(5);
}
}
Instance of Symbol 169 MovieClip "lifebar" in Frame 77
onClipEvent (enterFrame) {
_root.lifebar._width = _root.life;
if (_root.life <= 0) {
_root.gotoAndStop("gameselect");
}
}
Instance of Symbol 16 MovieClip [ball] "player" in Frame 77
onClipEvent (load) {
speed = 10;
shot_level = 50;
xb = _x;
yb = _y;
canShoot = true;
limitShoot = 0;
reload = 0;
var framecount = 0;
_root.int1 = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(39) and (this._x < 550)) {
xb = xb + speed;
} else if (Key.isDown(37) and (this._x > 50)) {
xb = xb - speed;
}
this._x = _x + ((xb - _x) / speed);
this._y = _y + ((yb - _y) / speed);
framecount++;
if ((framecount / 16) == Math.round(framecount / 16)) {
duplicateMovieClip (_root.ball, "ball" + _root.int1, _root.getNextHighestDepth());
_root.int1++;
}
}
Instance of Symbol 16 MovieClip [ball] "ball" in Frame 77
onClipEvent (load) {
this._y = -50;
this._x = random(600);
this.gotoAndStop(Math.floor(Math.random() * _totalframes) + 1);
}
onClipEvent (enterFrame) {
if (this._name != "ball") {
this._y = this._y + 4;
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.guard)) {
this.removeMovieClip();
}
}
onClipEvent (enterFrame) {
if (_root.player._currentframe == this._currentframe) {
if (this.hitTest(_root.player)) {
_root.happyscore++;
this.removeMovieClip();
}
}
if (!(this._currentframe === _root.player._currentframe)) {
if (this.hitTest(_root.player)) {
_root.life = _root.life - 2;
}
}
}
Frame 78
function buildPieces() {
var i = 0;
while (i < aPieces.length) {
aPieces[i].onPress = function () {
this._alpha = dim;
};
aPieces[i].onRollOut = function () {
this._alpha = 100;
};
aPieces[i].onRelease = function () {
this._alpha = 100;
_root["soSound" + this.value].start(0);
if (aMoveList[step] != this.value) {
failure();
return(undefined);
}
step++;
if (step == aMoveList.length) {
nextLevel();
_root.angryscore = _root.angryscore + 4;
}
};
i++;
}
}
function failure() {
killPieces();
mStart._alpha = 100;
aMoveList = new Array();
_root.gotoAndStop("gameselect");
mStart.onRelease = function () {
startGame();
};
}
function killPieces() {
var i = 0;
while (i < aPieces.length) {
delete aPieces[i].onPress;
delete aPieces[i].onRollOut;
delete aPieces[i].onRelease;
i++;
}
}
function lightUp(num) {
clearInterval(ID);
count--;
if (count == 0) {
userTurn();
return(undefined);
}
if (count == 1) {
num = Math.floor(Math.random() * 5);
} else {
num = aMoveList[(aMoveList.length + 1) - count];
}
light(num);
}
function userTurn() {
step = 0;
buildPieces();
}
function light(num) {
dimIt(num);
ID = setInterval(pause, 500, num);
}
function pause(num) {
clearInterval(ID);
unDim(num);
ID = setInterval(lightUp, 50, num);
}
function dimIt(num) {
if (count == 1) {
aMoveList.push(num);
}
_root["soSound" + num].start(0);
aPieces[num]._alpha = 50;
}
function unDim(num) {
aPieces[num]._alpha = 100;
}
function startGame() {
first = Math.floor(Math.random() * 4);
tMainText.text = "";
var i = 0;
while (i < aPieces.length) {
aPieces[i]._alpha = 100;
i++;
}
mStart._alpha = 0;
delete mStart.onRelease;
buildPieces();
count = 1;
light(first);
}
function nextLevel() {
killPieces();
var i = 0;
while (i < aPieces.length) {
aPieces[i]._alpha = 100;
i++;
}
count = aMoveList.length + 1;
var timer = getTimer();
this.onEnterFrame = function () {
if (timer < (getTimer() - 1000)) {
delete this.onEnterFrame;
light(first);
}
};
}
angryscore = 0;
var dim = 50;
aPieces = new Array();
aMoveList = new Array();
var ID;
var count = 0;
var first;
var soSound0 = new Sound(this);
soSound0.attachSound("simonSound1.mp3");
var soSound1 = new Sound(this);
soSound1.attachSound("simonSound2.mp3");
var soSound2 = new Sound(this);
soSound2.attachSound("simonSound3.mp3");
var soSound3 = new Sound(this);
soSound3.attachSound("simonSound4.mp3");
var soSound4 = new Sound(this);
soSound4.attachSound("simonSound5.mp3");
var step = 0;
var i = 1;
while (i < 6) {
aPieces.push(this["m" + i]);
this["m" + i].value = i - 1;
i++;
}
mStart.onRelease = function () {
startGame();
};
Frame 79
stop();
var o = {n:[6, 15, 3, 0, 8, 13, 11, 11, 15, 10, 2, 6, 12, 9, 11, 7], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
mochi.as2.MochiScores.showLeaderboard({boardID:boardID, score:totalscore});
Frame 113
_root.gotoAndPlay("mainmenu");
Symbol 16 MovieClip [ball] Frame 1
stop();
Symbol 16 MovieClip [ball] Frame 2
stop();
Symbol 16 MovieClip [ball] Frame 3
stop();
Symbol 16 MovieClip [ball] Frame 4
stop();
Symbol 16 MovieClip [ball] Frame 5
stop();
Symbol 21 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 28 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 35 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/picoday2006", "_blank");
}
Symbol 38 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/picoday2007", "_blank");
}
Symbol 41 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/picoday2008", "_blank");
}
Symbol 44 Button
on (release) {
getURL ("http://www.newgrounds.com/collection/picoday2009", "_blank");
}
Symbol 51 Button
on (release) {
_root.play();
}
Instance of Symbol 50 MovieClip in Symbol 53 MovieClip Frame 1
onClipEvent (load) {
_root.stop();
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("loaded");
}
}
onClipEvent (enterFrame) {
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("loaded");
}
}
Symbol 53 MovieClip Frame 100
stop();
Symbol 56 MovieClip Frame 1
function startAd(ngad_url) {
System.security.allowDomain("70.87.128.99");
System.security.allowInsecureDomain("70.87.128.99");
System.security.allowDomain("ads.shizmoo.com");
System.security.allowInsecureDomain("ads.shizmoo.com");
System.security.allowDomain("www.cpmstar.com");
System.security.allowInsecureDomain("www.cpmstar.com");
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
var ngads_redirect = new XML();
ngads_redirect.ignoreWhite = true;
ngads_redirect.onLoad = function (success) {
if (success) {
ng_ad.loadMovie(ngads_redirect.toString(), "GET");
}
};
ngads_redirect.load(ngad_url);
}
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
stop();
Symbol 194 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(id) {
if (!id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = id;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var params = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(movie_version) {
if (!movie_version) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = movie_version;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!stat_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[stat_name] = CUSTOM_STATS + stat_id;
SendMessage("Created custom event: " + stat_name);
}
}
static function addCustomLink(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!stat_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[stat_name] = CUSTOM_STATS + stat_id;
SendMessage((("Created custom link " + stat_id) + ": ") + stat_name);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(special) {
if (special) {
var extra = {page:special};
}
SendLink(NEWGROUNDS, extra);
}
static function logCustomEvent(event_name) {
if (!event_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[event_name]) {
SendError("Attempted to log undefined custom event: " + event_name);
} else {
SendEvent(custom_events[event_name]);
}
}
static function loadCustomLink(link_name) {
if (!link_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[link_name]) {
SendError("Attempted to open undefined custom link: " + link_name);
} else {
SendLink(custom_links[link_name]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(id) {
SendStat(id, false);
}
static function SendLink(id, extra) {
SendStat(id, true, extra);
}
static function ReadGatewayData(params) {
for (var i in params) {
params[i] = unescape(params[i]);
movie_options[i] = params[i];
}
if (params.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var target_url = ((((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url));
var XML_in = new XML();
XML_in.ignoreWhite = true;
XML_in.load(target_url);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(stat_id, open_in_browser, extra) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var target_url = ((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id);
for (var x in extra) {
target_url = target_url + ((("&" + escape(x)) + "=") + escape(extra[x]));
}
if (debug) {
target_url = target_url + "&debug=1";
}
if (open_in_browser) {
getURL (target_url, "_blank");
} else {
var XML_in = new XML();
XML_in.ignoreWhite = true;
XML_in.onLoad = function (success) {
var params = new Object();
var i = 0;
while (i < this.firstChild.childNodes.length) {
var param = this.firstChild.childNodes[i];
var param_name = param.nodeName;
var param_value = param.attributes.value;
if (param_value == Number(param_value)) {
param_value = Number(param_value);
}
params[param_name] = param_value;
i++;
}
NewgroundsAPI.ReadGatewayData(params);
};
XML_in.load(target_url);
}
}
}
static function SendError(msg) {
}
static function SendMessage(msg) {
}
static function InitTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function onNewVersionAvailable(version, movie_url, redirect_url) {
InitTextFormats();
var center = new Object();
center.x = Stage.width / 2;
center.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(center.x - 240, center.y - 120);
_root.NGAPI_new_version_overlay.lineTo(center.x + 240, center.y - 120);
_root.NGAPI_new_version_overlay.lineTo(center.x + 240, center.y + 80);
_root.NGAPI_new_version_overlay.lineTo(center.x - 240, center.y + 80);
_root.NGAPI_new_version_overlay.lineTo(center.x - 240, center.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(center.x + 210, center.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(center.x + 230, center.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(center.x + 230, center.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(center.x + 210, center.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(center.x + 210, center.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(center.x + 214, center.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(center.x + 226, center.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(center.x + 226, center.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(center.x + 214, center.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var message = ((("Version " + version) + " is now available at:") + newline);
var link_start = message.length;
message = message + movie_url;
var link_end = message.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, center.x - 210, center.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = message;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(link_start, link_end, link_format);
}
static function onDenyHost(hostname, movie_url, redirect_url) {
InitTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var message = (("This movie has not been approved for use on " + hostname) + ".");
message = message + "\r\rFor an aproved copy, please visit:\r";
var link_start = message.length;
message = message + movie_url;
var link_end = message.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = message;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(link_start, link_end, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(ad_url) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 195 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.0");
}
static function allowDomains(server) {
var hostname = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(hostname);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(hostname);
}
}
return(hostname);
}
static function get isNetworkAvailable() {
if (System.security) {
var o = System.security;
if (o.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var clipname = ("_mochiservices_com_" + id);
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servicesURL != undefined) {
_servicesURL = urlOptions().servicesURL;
}
allowDomains(_servicesURL);
_clip = clip.createEmptyMovieClip(clipname, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip((((_servicesURL + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var cb = pkg.callbackID;
var cblst = this._callbacks[cb];
if (!cblst) {
return(undefined);
}
var method = cblst.callbackMethod;
var obj = cblst.callbackObject;
if (obj && (typeof(method) == "string")) {
method = obj[method];
}
if (method != undefined) {
method.apply(obj, pkg.args);
}
delete this._callbacks[cb];
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var request;
var callback;
while (_sendChannel._queue.length > 0) {
request = _sendChannel._queue.shift();
delete callback;
if (request.callbackID != null) {
callback = _listenChannel._callbacks[request.callbackID];
}
delete _listenChannel._callbacks[request.callbackID];
if (error) {
handleError(request.args, callback.callbackObject, callback.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var opts = {};
if (_root.mochiad_options) {
var pairs = _root.mochiad_options.split("&");
var i = 0;
while (i < pairs.length) {
var kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
}
}
return(opts);
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var vars = new Object();
vars.mav = getVersion();
vars.swfv = btn.getSWFVersion() || 6;
vars.swfurl = btn._url;
vars.fv = System.capabilities.version;
vars.os = System.capabilities.os;
vars.lang = System.capabilities.language;
vars.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var i = 0;
for (var x in vars) {
if (i != 0) {
s = s + "&";
}
i++;
s = ((s + x) + "=") + escape(vars[x]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var nettest = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
nettest.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var clk = btn.createEmptyMovieClip("clk", 1001);
clk._alpha = 0;
clk.beginFill(1044735);
clk.moveTo(0, 0);
clk.lineTo(0, btn._height);
clk.lineTo(btn._width, btn._height);
clk.lineTo(btn._width, 0);
clk.lineTo(0, 0);
clk.endFill();
clk.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static var _servicesURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
}
Symbol 196 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if ((options.clip == null) || (options.clip == undefined)) {
options.clip = mochi.as2.MochiServices.clip;
}
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var n = Number(options.score);
if (isNaN(n)) {
} else if ((n == Number.NEGATIVE_INFINITY) || (n == Number.POSITIVE_INFINITY)) {
} else {
if (Math.floor(n) != n) {
}
options.score = n;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
} else {
if (Math.floor(score) != score) {
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var so = {};
var i;
var j;
var o;
var row_obj;
for (var item in scores) {
if (typeof(scores[item]) == "object") {
if ((scores[item].cols != null) && (scores[item].rows != null)) {
so[item] = [];
o = scores[item];
j = 0;
while (j < o.rows.length) {
row_obj = {};
i = 0;
while (i < o.cols.length) {
row_obj[o.cols[i]] = o.rows[j][i];
i++;
}
so[item].push(row_obj);
j++;
}
} else {
so[item] = {};
for (var param in scores[item]) {
so[item][param] = scores[item][param];
}
}
} else {
so[item] = scores[item];
}
}
return(so);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 197 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var s = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = s.charCodeAt(index++) ^ Encoder;
if (index < s.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var newEncode = int(2147483647 * Math.random());
Fragment = Fragment ^ (newEncode ^ Encoder);
Encoder = newEncode;
}
function toString() {
var s = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (s.concat(Sibling.toString())) : (s)));
}
}
Symbol 85 Button
on (release) {
_root.gotoAndStop("gameselect");
}
Symbol 88 Button
on (release) {
_root.gotoAndStop("highscores");
}
Symbol 91 Button
on (release) {
_root.gotoAndStop("aboutpage");
}
Symbol 96 Button
on (release) {
_root.gotoAndStop("mainmenu");
}
Symbol 105 Button
on (release) {
gotoAndStop ("missmatch");
}
Symbol 106 Button
on (release) {
_root.gotoAndStop("shootingcolours");
}
Symbol 107 Button
on (release) {
_root.gotoAndStop("happyfaicgame");
}
Symbol 108 Button
on (release) {
_root.gotoAndStop("angrysimon");
}
Symbol 119 Button
on (release) {
_root.gotoAndStop("submiting");
}
Symbol 142 Button
on (release) {
getURL ("http://thesandyman.newgrounds.com/", _blank);
}
Symbol 146 Button
on (release) {
getURL ("http://mrrandomist.newgrounds.com/", _blank);
}
Symbol 162 MovieClip Frame 1
stop();
Symbol 162 MovieClip Frame 2
stop();
Symbol 162 MovieClip Frame 3
stop();
Symbol 162 MovieClip Frame 4
stop();
Symbol 162 MovieClip Frame 5
stop();
Symbol 165 MovieClip Frame 30
_root.timer--;