Frame 1
mute_btn.onPress = function () {
if (mute == false) {
mute = true;
music.setVolume(0);
mute_btn.gotoAndStop(2);
} else {
mute = false;
music.setVolume(100);
mute_btn.gotoAndStop(1);
}
};
_lockroot = true;
shownscores = true;
mute = false;
if (!musicstarted) {
music = new Sound(this);
music.attachSound("sound_track");
music.start(0, 99);
musicstarted = true;
}
beat = new Sound(this);
beat.attachSound("beat");
cheer = new Sound(this);
cheer.attachSound("cheer");
correct = new Sound(this);
correct.attachSound("correct");
wrong = new Sound(this);
wrong.attachSound("wrong");
alright_ninja = new Sound(this);
alright_ninja.attachSound("alright ninja");
hiiiiihya = new Sound(this);
hiiiiihya.attachSound("hiiiiihya");
hiya = new Sound(this);
hiya.attachSound("hiya");
hiyaaa = new Sound(this);
hiyaaa.attachSound("hiyaaa");
hiyaaaa = new Sound(this);
hiyaaaa.attachSound("hiyaaaa");
huhhh = new Sound(this);
huhhh.attachSound("huhhh");
oh_no_nun = new Sound(this);
oh_no_nun.attachSound("oh no nun");
sexy_ninja = new Sound(this);
sexy_ninja.attachSound("sexy ninja");
Frame 3
stop();
_root.localization_url1 = "http://www.agame.com/moregames/?utm_source=brandedgames_as2&utm_medium=ninja_or_nun_agame_com";
_root.localization_language_nr = 1;
_root.localization_branding_nr = 1;
_root.localization_portal = "tweens";
if (_root.localization_portal == "game_com_cn") {
this.mainscreen_moregames.onRelease = function () {
getURL (_root.localization_url1, "_blank");
};
} else {
this.mainscreen_moregames.onRelease = function () {
getURL (_root.localization_url1 + "&utm_term=button_mainscreen_moregames", "_blank");
};
}
shownscores = false;
viewscores.onPress = function () {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect("91868163bf59e2ae");
gotoAndPlay (2);
mochi.MochiScores.showLeaderboard({boardID:"50f282324481e52c"});
};
play_btn.onPress = function () {
gotoAndStop ("instructions");
totaltime = 30;
difficulty = 1;
};
play_btn2.onPress = function () {
gotoAndStop ("instructions");
totaltime = 25;
difficulty = 2;
};
play_btn3.onPress = function () {
gotoAndStop ("instructions");
totaltime = 20;
difficulty = 3;
};
Frame 4
next.onPress = function () {
_root.gotoAndStop("instructions2");
};
plays.onPress = function () {
_root.gotoAndStop("game");
};
Frame 5
next.onPress = function () {
_root.gotoAndStop("instructions3");
};
plays.onPress = function () {
_root.gotoAndStop("game");
};
Frame 6
animation.gotoAndStop(49);
plays.onPress = function () {
_root.gotoAndStop("game");
};
Frame 7
function myTimer() {
if (((!interlevel_placed) && (!gameover)) && (!game_paused)) {
timer--;
score = score - 10;
}
}
function create_nuninjas() {
show_ninjas_txt = true;
txtcount = 0;
ninjas_found = 0;
ninjas_placed = 0;
total_tiles = 0;
nunamount = 0;
ninjaamount = 0;
newsizes = sizes;
newpplsize = pplsize;
newstartx = startx;
num = 1;
randnum0 = Math.round(Math.random() * randomness);
randnum1 = Math.round(Math.random() * randomness);
randnum2 = Math.round(Math.random() * randomness);
y = 0;
while (y <= ysize) {
newsizes = newsizes * 1.025;
newstartx = newstartx * 0.983;
newpplsize = newpplsize * 1.025;
x = 0;
while (x <= size) {
num++;
trace(level);
if (level[y][x] <= 1) {
i = 0;
while (i < ninjas_total) {
if (_root["randnum" + i] == num) {
place_a_ninja = true;
}
i++;
}
if (place_a_ninja) {
randnum = 2;
ninjas_placed++;
tile = _root.attachMovie("ninjaset", "ninja" + ninjaamount, _root.getNextHighestDepth() + 100, {_x:(x * (Math.round(Math.random() * offset) + newpplsize)) + newstartx, _y:(y * (Math.round(Math.random() * offset) + newpplsize)) + starty});
tile._width = tile._width * newsizes;
tile._height = tile._height * newsizes;
ninjaamount++;
place_a_ninja = false;
} else {
randnum = 1;
tile = _root.attachMovie("nunset", "nun" + nunamount, _root.getNextHighestDepth() + 100, {_x:(x * (Math.round(Math.random() * offset) + newpplsize)) + newstartx, _y:(y * (Math.round(Math.random() * offset) + newpplsize)) + starty});
tile._width = tile._width * newsizes;
tile._height = tile._height * newsizes;
nunamount++;
}
tile.num = level[y][x];
total_tiles++;
tile.onEnterFrame = function () {
};
}
x++;
}
i = 1;
while (i < (ninjas_total + 1)) {
_root["icon" + i]._visible = true;
i++;
}
y++;
}
}
function doRemove(parent) {
var _local1;
for (_local1 in parent) {
if (parent[_local1].removeMovieClip()) {
parent[_local1].removeMovieClip();
}
}
}
function increase_level() {
beatstarted = false;
if (size < 15) {
timer = totaltime - level_num;
if (timer < 3) {
timer = 3;
}
level_num++;
pplsize = pplsize * 0.93;
sizes = sizes * 0.9;
offset = offset * 0.835;
ninjas_placed = 0;
ysize++;
size++;
randomness = (size + 1) * (ysize + 1);
startx = (850 - (size * pplsize)) / 2;
starty = (450 - (size * pplsize)) / 2;
} else {
totaltime = totaltime + 15;
timer = totaltime;
level_num++;
ninjas_total++;
pplsize = 40;
offset = 5;
sizes = 1;
ninjas_placed = 0;
size = 1;
ysize = 1;
randomness = 4;
tileset = "tile1";
startx = (850 - (size * pplsize)) / 2;
starty = (450 - (size * pplsize)) / 2;
}
}
function play_interlevel() {
attachMovie("find_ninjas", "find_ninjas", _root.getNextHighestDepth(), {_x:402, _y:195});
}
function endFunction() {
}
stop();
game_over_count = 0;
finished = true;
beatstarted = false;
gameover = false;
score = 100;
level = new Array();
zoomed = false;
game_paused = false;
level_num = 1;
interlevel_placed = false;
count = 0;
if (!timer_started) {
var intervalID = setInterval(myTimer, 1000);
timer_started = true;
}
trace("my message");
timer = totaltime;
i = 1;
while (i < 4) {
_root["icon" + i]._visible = false;
i++;
}
if (!(level_num === 1)) {
} else {
pplsize = 40;
offset = 5;
sizes = 1;
ninjas_placed = 0;
ninjas_total = 1;
size = 1;
ysize = 1;
randomness = 4;
tileset = "tile1";
startx = (800 - (size * pplsize)) / 2;
starty = (500 - (size * pplsize)) / 2;
}
pausecount = 0;
onEnterFrame = function () {
if (Key.isDown(44)) {
timer = 0;
}
pausecount++;
if (Key.isDown(32) && (pausecount > 30)) {
pausecount = 0;
if (!game_paused) {
game_paused = true;
_root.attachMovie("pause", "paused_ninja", _root.getNextHighestDepth());
pause_sound = Math.round(Math.random() * 1);
if (pause_sound == 1) {
alright_ninja.start();
} else {
sexy_ninja.start();
}
} else {
game_paused = false;
removeMovieClip(paused_ninja);
}
}
if (!game_paused) {
ninja_left = ninjas_total - ninjas_found;
if (show_ninjas_txt) {
ninja_txt1._visible = true;
ninja_txt2._visible = true;
} else {
ninja_txt1._visible = false;
ninja_txt2._visible = false;
}
txtcount++;
if (txtcount > 50) {
show_ninjas_txt = false;
}
if (Key.isDown(40) && (!zoomed)) {
_root._x = _root._x - 100;
_root._y = _root._y - 100;
_root._xscale = _root._xscale + 30;
_root._yscale = _root._yscale + 30;
zoomed = true;
clock._y = clock._y + 75;
clockb._y = clockb._y + 75;
ninja_txt1._y = ninja_txt1._y + 75;
ninja_txt2._y = ninja_txt2._y + 75;
scores._y = scores._y + 75;
scoresb._y = scoresb._y + 75;
scores._x = scores._x + 75;
scoresb._x = scoresb._x + 75;
levels._y = levels._y + 75;
levelsb._y = levelsb._y + 75;
levels._x = levels._x - 100;
levelsb._x = levelsb._x - 100;
ninj._y = ninj._y - 35;
icon1._y = icon1._y - 35;
icon2._y = icon2._y - 35;
icon3._y = icon3._y - 35;
icons._x = icons._x + 75;
icons._y = icons._y - 35;
mute_btn._y = mute_btn._y - 35;
mute_btn._x = mute_btn._x - 100;
}
if (Key.isDown(38) && (zoomed)) {
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
zoomed = false;
clock._y = clock._y - 75;
clockb._y = clockb._y - 75;
ninja_txt1._y = ninja_txt1._y - 75;
ninja_txt2._y = ninja_txt2._y - 75;
scores._y = scores._y - 75;
scoresb._y = scoresb._y - 75;
scores._x = scores._x - 75;
scoresb._x = scoresb._x - 75;
levels._y = levels._y - 75;
levelsb._y = levelsb._y - 75;
levels._x = levels._x + 100;
levelsb._x = levelsb._x + 100;
ninj._y = ninj._y + 35;
icon1._y = icon1._y + 35;
icon2._y = icon2._y + 35;
icon3._y = icon3._y + 35;
icons._x = icons._x - 75;
icons._y = icons._y + 35;
mute_btn._y = mute_btn._y + 35;
mute_btn._x = mute_btn._x + 100;
}
if ((timer <= 0) && (!gameover)) {
game_over_count++;
i = 0;
while (i < nunamount) {
_root["nun" + i]._visible = false;
i++;
}
if (game_over_count > 60) {
game_over_count = 0;
doRemove(_root);
_root.gotoAndStop("gameover");
gameover = true;
if (zoomed) {
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
zoomed = false;
clock._y = clock._y - 75;
clockb._y = clockb._y - 75;
ninja_txt1._y = ninja_txt1._y - 75;
ninja_txt2._y = ninja_txt2._y - 75;
scores._y = scores._y - 75;
scoresb._y = scoresb._y - 75;
scores._x = scores._x - 75;
scoresb._x = scoresb._x - 75;
levels._y = levels._y - 75;
levelsb._y = levelsb._y - 75;
levels._x = levels._x + 100;
levelsb._x = levelsb._x + 100;
ninj._y = ninj._y + 35;
icon1._y = icon1._y + 35;
icon2._y = icon2._y + 35;
icon3._y = icon3._y + 35;
icons._x = icons._x - 75;
icons._y = icons._y + 35;
mute_btn._y = mute_btn._y + 35;
mute_btn._x = mute_btn._x + 100;
}
}
}
if (timer < 8) {
if (!beatstarted) {
beat.start();
beatstarted = true;
}
}
if (count == 30) {
count = 0;
}
count++;
if ((find_ninjas._currentframe == find_ninjas._totalframes) and interlevel_placed) {
removeMovieClip(find_ninjas);
increase_level();
interlevel_placed = false;
}
if (ninjas_placed < ninjas_total) {
doRemove(_root);
create_nuninjas();
}
i = 0;
while (i < ninjaamount) {
if (count == 30) {
randomnum = Math.round(Math.random() * 10);
if (randomnum == 1) {
randomnum2 = Math.round(Math.random() * 7);
_root["ninja" + i].gotoAndStop(randomnum2);
} else {
_root["ninja" + i].gotoAndStop(1);
}
}
_root["ninja" + i].onPress = function () {
if (game_over_count < 1) {
show_ninjas_txt = true;
txtcount = 0;
if (!game_paused) {
random_sound = Math.round(Math.random() * 4);
trace(random_sound);
switch (random_sound) {
case 1 :
hiya.start();
break;
case 2 :
hiyaaa.start();
break;
case 3 :
hiyaaa.start();
break;
case 4 :
huhhh.start();
break;
case 0 :
hiiiiihya.start();
}
removeMovieClip(this);
ninjas_found++;
_root["icon" + ninjas_found]._visible = false;
score = score + (100 * difficulty);
}
}
};
i++;
}
i = 0;
while (i < nunamount) {
if (count == 30) {
randomnum = Math.round(Math.random() * 10);
if (randomnum == 1) {
randomnum2 = Math.round(Math.random() * 7);
_root["nun" + i].gotoAndStop(randomnum2);
} else {
_root["nun" + i].gotoAndStop(1);
}
}
_root["nun" + i].onPress = function () {
if (!game_paused) {
oh_no_nun.start();
score = score - 50;
}
};
i++;
}
if (ninjas_found == ninjas_total) {
beat.stop("beat");
if ((level_num >= 45) && (!gameover)) {
gameover = true;
_root.gotoAndStop("gameover");
doRemove(_root);
} else if ((!interlevel_placed) && (!gameover)) {
if (((level_num == 9) or (level_num == 19)) or (level_num == 29)) {
showAd(adOptions);
finished = false;
}
score = score + ((level_num * 50) * difficulty);
doRemove(_root);
play_interlevel();
cheer.start();
interlevel_placed = true;
}
if (zoomed) {
_root._x = 0;
_root._y = 0;
_root._xscale = 100;
_root._yscale = 100;
zoomed = false;
clock._y = clock._y - 75;
clockb._y = clockb._y - 75;
ninja_txt1._y = ninja_txt1._y - 75;
ninja_txt2._y = ninja_txt2._y - 75;
scores._y = scores._y - 75;
scoresb._y = scoresb._y - 75;
scores._x = scores._x - 75;
scoresb._x = scoresb._x - 75;
levels._y = levels._y - 75;
levelsb._y = levelsb._y - 75;
levels._x = levels._x + 100;
levelsb._x = levelsb._x + 100;
ninj._y = ninj._y + 35;
icon1._y = icon1._y + 35;
icon2._y = icon2._y + 35;
icon3._y = icon3._y + 35;
icons._x = icons._x - 75;
icons._y = icons._y + 35;
mute_btn._y = mute_btn._y + 35;
mute_btn._x = mute_btn._x + 100;
}
}
}
};
Frame 9
stop();
shownscores = false;
beat.stop("beat");
if (!shownscores) {
gotoAndPlay (2);
playerscore = score;
mochi.MochiServices.disconnect();
mochi.MochiServices.connect("91868163bf59e2ae");
mochi.MochiScores.showLeaderboard({boardID:"50f282324481e52c", score:playerscore});
shownscores = true;
}
Symbol 29 MovieClip [find_ninjas] Frame 49
nunamount = 10;
ninjaamount = 10;
count = 0;
play.onPress = function () {
_root.find_ninjas.gotoAndPlay(50);
};
onEnterFrame = function () {
if (count == 30) {
count = 0;
}
count++;
i = 0;
while (i < nunamount) {
if (count == 30) {
randomnum = Math.round(Math.random() * 10);
if (randomnum == 1) {
randomnum2 = Math.round(Math.random() * 7);
this["nun" + i].gotoAndStop(randomnum2);
} else {
this["nun" + i].gotoAndStop(1);
}
}
i++;
}
i = 0;
while (i < ninjaamount) {
if (count == 30) {
randomnum = Math.round(Math.random() * 10);
if (randomnum == 1) {
randomnum2 = Math.round(Math.random() * 7);
this["ninja" + i].gotoAndStop(randomnum2);
} else {
this["ninja" + i].gotoAndStop(1);
}
}
i++;
}
};
Symbol 52 MovieClip [nunset] Frame 1
stop();
Symbol 67 MovieClip [ninjaset] Frame 1
stop();
Symbol 77 MovieClip [mute] Frame 1
stop();
Symbol 77 MovieClip [mute] Frame 2
stop();
Symbol 268 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) || (options.clip == undefined)) {
options.clip = mochi.MochiServices.clip;
}
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 (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
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) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
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 269 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.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("1.43");
}
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";
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();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local3 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servicesURL != undefined) {
_servicesURL = urlOptions().servicesURL;
}
allowDomains(_servicesURL);
_clip = clip.createEmptyMovieClip(_local3, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
_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((((_servicesURL + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
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._nextcallbackID = 0;
_listenChannel._callbacks = {};
_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()});
_listenChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_listenChannel.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];
};
_listenChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
trace("connected!");
_connecting = false;
_connected = true;
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 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._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 ((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 _local5 = {};
if (_root.mochiad_options) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.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 270 MovieClip [__Packages.mochi.MochiDigits] Frame 0
class mochi.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 _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 198 MovieClip Frame 1
gotoAndStop(_root.localization_branding_nr);
Symbol 208 MovieClip Frame 90
Symbol 208 MovieClip Frame 91
stop();
Symbol 210 MovieClip Frame 1
if (_root.localization_portal == "game_com_cn") {
this.logo_intro.onRelease = function () {
getURL (_root.localization_url1, "_blank");
};
} else {
this.logo_intro.onRelease = function () {
getURL (_root.localization_url1 + "&utm_term=logo_intro", "_blank");
};
}
Symbol 210 MovieClip Frame 90
stop();
Symbol 216 MovieClip Frame 89
stop();
Symbol 224 MovieClip Frame 89
stop();
Symbol 227 MovieClip Frame 89
stop();
Symbol 228 MovieClip Frame 1
if (_root.localization_portal == "family") {
gotoAndStop (1);
}
if (_root.localization_portal == "tweens") {
gotoAndStop (2);
}
if (_root.localization_portal == "girl") {
gotoAndStop (3);
}
if (_root.localization_portal == "game_com_cn") {
gotoAndStop (4);
_root.play;
}