Frame 1
function site() {
getURL ("http://www.gr8games.eu", "_blank");
}
function mail() {
getURL ("mailto:mariusz.bekus@gmail.com");
}
var my_menu = new ContextMenu();
my_menu.hideBuiltInItems();
var powered_by = new ContextMenuItem("by: Mariusz Bekus", mail);
var more_games = new ContextMenuItem("FREE ONLINE GAMES", site);
my_menu.customItems.push(powered_by, more_games);
_root.menu = my_menu;
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
percent = loaded / total;
preloader.bar._width = percent * 200;
preloader.loading = ("Loading: " + Math.round(percent * 100)) + "%";
if (loaded == total) {
_root.gotoAndStop("INTRO");
}
Frame 2
_root.gotoAndPlay(1);
Frame 11
stop();
Frame 21
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("834639d8", this, 10301, true);
Frame 31
stop();
clickSound = new Sound(this);
clickSound.attachSound("click");
clickSound.setVolume(100);
startButton.onRelease = function () {
clickSound.start();
_root.gotoAndStop("INSTRUCTION");
};
startButton.onRollOver = function () {
this.button.nextFrame();
};
startButton.onRollOut = function () {
this.button.prevFrame();
};
highscoreButton.onRelease = function () {
clickSound.start();
_root.gotoAndStop("LEADERBOARD");
};
highscoreButton.onRollOver = function () {
this.button.nextFrame();
};
highscoreButton.onRollOut = function () {
this.button.prevFrame();
};
moreGames.onRelease = function () {
clickSound.start();
getURL ("http://www.gr8games.eu/", "_blank");
};
moreGames.onRollOver = function () {
this.button.nextFrame();
};
moreGames.onRollOut = function () {
this.button.prevFrame();
};
Frame 41
stop();
start.onRelease = function () {
clickSound.start();
_root.gotoAndStop("PLAY");
};
start.onRollOver = function () {
this.button.nextFrame();
};
start.onRollOut = function () {
this.button.prevFrame();
};
Frame 52
function timer(seconds) {
angle = (360 * seconds) / 60;
_root.clock.arrow._rotation = angle;
}
function randomNumber(Min, Max) {
number = Math.floor(Math.random() * ((Max - Min) + 1)) + Min;
return(number);
}
function addEnemy() {
number = randomNumber(1, 4);
if (number == 1) {
enemyType = "fish";
} else if (number == 2) {
enemyType = "crab";
} else if (number == 3) {
enemyType = "jellyfish";
} else if (number == 4) {
enemyType = "star";
}
number = randomNumber(1, 6);
if (number == 1) {
enemy = this.attachMovie(enemyType, enemyType + number, this.getNextHighestDepth(), {_x:70, _y:190});
} else if (number == 2) {
enemy = this.attachMovie(enemyType, enemyType + number, this.getNextHighestDepth(), {_x:110, _y:310});
} else if (number == 3) {
enemy = this.attachMovie(enemyType, enemyType + number, this.getNextHighestDepth(), {_x:200, _y:365});
} else if (number == 4) {
enemy = this.attachMovie(enemyType, enemyType + number, this.getNextHighestDepth(), {_x:360, _y:365});
} else if (number == 5) {
enemy = this.attachMovie(enemyType, enemyType + number, this.getNextHighestDepth(), {_x:445, _y:310});
} else if (number == 6) {
enemy = this.attachMovie(enemyType, enemyType + number, this.getNextHighestDepth(), {_x:475, _y:190});
}
}
function updateScore() {
score++;
}
function mouthMoves(Direction) {
if (Direction == "next") {
gotoAndStop(octopus.mouth.nextFrame());
} else {
gotoAndStop(octopus.mouth.prevFrame());
}
}
function keyboard(i) {
if (i == 1) {
k = "65";
} else if (i == 2) {
k = "83";
} else if (i == 3) {
k = "68";
} else if (i == 4) {
k = "74";
} else if (i == 5) {
k = "75";
} else if (i == 6) {
k = "76";
}
return(k);
}
stop();
seconds = 0;
score = 0;
counter = 0;
counterDown = 900;
watch = 60;
watchCounter = 0;
movesTimer = 5;
firstEnemy = true;
onEnterFrame = function () {
counter++;
counterDown--;
movesTimer--;
watchCounter++;
if ((firstEnemy == true) && (counter >= 15)) {
addEnemy();
firstEnemy = false;
}
if (watchCounter == 15) {
seconds++;
timer(seconds);
if (watch == 0) {
newEnemy = false;
removeMovieClip(enemy);
gotoAndStop ("GAMEOVER");
} else {
watch = watch - 1;
watchCounter = 0;
}
}
i = 1;
while (i < 7) {
k = keyboard(i);
if (Key.isDown(k) && (movesTimer <= 0)) {
octopus["leg" + i].gotoAndStop("2");
movesTimer = 5;
} else {
octopus["leg" + i].gotoAndStop("1");
}
if (_root.octopus["leg" + i].hitTest(_root.enemy)) {
removeMovieClip(_root.enemy);
updateScore();
clickSound.start();
mouthMoves("prev");
addEnemy();
} else if ((_root.octopus["leg" + i]._currentframe == 2) && (!_root.octopus["leg" + i].hitTest(_root.NewMovieClip))) {
clickSound.stop();
mouthMoves("next");
}
i++;
}
};
Frame 62
stop();
count = false;
counter = 0;
submit.score = score;
submit_score = false;
on_close = function () {
_root.gotoAndStop("HOME");
};
on_error = function () {
_root.gotoAndStop("HOME");
};
on_display = function () {
count = true;
};
onEnterFrame = function () {
if (submit_score == true) {
submit_score = false;
user = _root.submit.user;
if ((!(user === undefined)) && (user.length > 2)) {
submit._visible = 0;
mochi.MochiServices.connect("ed166a2c9bd8fed4");
mochi.MochiScores.showLeaderboard({boardID:"5c5307d50b9af21e", score:score, name:user, res:"550x400", preloaderDisplay:false, onClose:on_close, onError:on_error, onDisplay:on_display});
} else {
submit.enter_your_name.gotoAndStop(2);
}
}
if (count == true) {
counter++;
if (counter == 150) {
count = false;
score_api = new LocalConnection();
score_api.send(_root.gr8games_api, "submitScore", score);
}
}
};
Frame 72
stop();
closeLeaderboard = function () {
_root.gotoAndStop("HOME");
};
mochi.MochiServices.connect("ed166a2c9bd8fed4");
mochi.MochiScores.showLeaderboard({boardID:"5c5307d50b9af21e", res:"550x400", preloaderDisplay:false, onClose:closeLeaderboard});
Symbol 102 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.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 (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.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.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 103 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _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("1.31");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.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 _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.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.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
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.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.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:_rcvChannel._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:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 17 MovieClip Frame 60
_root.gotoAndPlay("ADS");
Symbol 22 MovieClip Frame 1
stop();
Symbol 29 MovieClip [crab] Frame 1
stop();
Symbol 33 MovieClip [jellyfish] Frame 1
stop();
Symbol 42 MovieClip [leg] Frame 1
stop();
Symbol 55 MovieClip [mouth] Frame 1
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 1
stop();
onRelease = function () {
_root.submit_score = true;
};
onRollOver = function () {
button.nextFrame();
};
onRollOut = function () {
button.prevFrame();
};