Frame 1
Main.main(this);
Symbol 24 MovieClip Frame 24
stop();
Symbol 27 MovieClip [newpet] Frame 18
gotoAndPlay ("live");
Symbol 27 MovieClip [newpet] Frame 47
gotoAndPlay ("live");
Symbol 27 MovieClip [newpet] Frame 59
gotoAndPlay ("live");
Symbol 27 MovieClip [newpet] Frame 83
gotoAndPlay ("live");
Symbol 65 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 6
stop();
Symbol 84 MovieClip Frame 1
stop();
this.is_open = false;
Symbol 84 MovieClip Frame 5
stop();
this.is_open = true;
Symbol 85 Button
on (press) {
show_help_pane();
}
Symbol 88 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 2
play();
Symbol 88 MovieClip Frame 6
stop();
Symbol 89 MovieClip Frame 1
stop();
Symbol 89 MovieClip Frame 2
star1_mc.gotoAndPlay("grow");
Symbol 89 MovieClip Frame 3
star2_mc.gotoAndPlay("grow");
Symbol 89 MovieClip Frame 4
star3_mc.gotoAndPlay("grow");
Symbol 89 MovieClip Frame 5
star4_mc.gotoAndPlay("grow");
Symbol 89 MovieClip Frame 6
star5_mc.gotoAndPlay("grow");
Symbol 92 MovieClip Frame 1
var base_mc = this;
var i = 1;
while (i <= 5) {
base_mc["b" + i].num = i;
base_mc["b" + i].onRollOver = function () {
stars_mc.gotoAndStop(this.num + 1);
};
base_mc["b" + i].onRollOut = function () {
stars_mc.gotoAndStop(1);
};
base_mc["b" + i].onPress = function () {
submit_vote(this.num);
};
i++;
}
Symbol 100 MovieClip Frame 15
stop();
Symbol 100 MovieClip Frame 23
stop();
Symbol 100 MovieClip Frame 66
var flr = Math.floor(this.score);
var flr_w = (flr * 20);
var dc = (this.score - Math.floor(this.score));
var dc_w = (dc * 17.1);
var w = (flr_w + dc_w);
star_mask_mc._width = w;
Symbol 100 MovieClip Frame 72
stop();
Symbol 110 MovieClip Frame 1
stop();
Symbol 114 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 1
stop();
Symbol 122 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 4
stop();
Symbol 133 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 6
stop();
Symbol 142 Button
on (press) {
_parent.show_help_pane();
}
Symbol 147 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 4
stop();
Symbol 149 Button
on (release) {
getURL ("http://www.mochibot.com?cpe=dT0yJmNwPUluZm8gUGFuZWwgTGluayZzPUZlZWRiYWNrIEJhciB2MQ%3D%3D", "_blank");
}
on (rollOver) {
logo_mc.gotoAndPlay("in");
}
on (rollOut) {
logo_mc.gotoAndPlay("out");
}
Symbol 150 MovieClip Frame 1
function valid() {
var _local1 = true;
if (comment_txt.text == "") {
_local1 = false;
comment_header_mc.gotoAndStop(2);
} else {
comment_header_mc.gotoAndStop(1);
}
return(_local1);
}
function set_tabs() {
name_txt.tabIndex = 1;
email_txt.tabIndex = 2;
comment_txt.tabIndex = 3;
submit_btn.tabIndex = false;
}
stop();
set_tabs();
get_user_info();
submit_btn.onRollOver = function () {
submit_mc.gotoAndPlay("on");
};
submit_btn.onRollOut = function () {
submit_mc.gotoAndPlay("off");
};
submit_btn.onPress = function () {
if (valid()) {
submit_btn.enabled = false;
submit_comment(name_txt.text, email_txt.text, comment_txt.text);
}
};
view_comments_btn.onRollOver = function () {
view_comments_mc.gotoAndStop("on");
};
view_comments_btn.onRollOut = function () {
view_comments_mc.gotoAndStop("off");
};
view_comments_btn.onPress = function () {
getURL (_parent.mochi_public_comments_url, "_blank");
};
x_btn.onPress = function () {
_parent.show_comment_pane();
};
name_txt.onSetFocus = function () {
box1_mc.gotoAndStop(2);
};
name_txt.onKillFocus = function () {
box1_mc.gotoAndStop(1);
};
email_txt.onSetFocus = function () {
box2_mc.gotoAndStop(2);
};
email_txt.onKillFocus = function () {
box2_mc.gotoAndStop(1);
};
website_txt.onSetFocus = function () {
box3_mc.gotoAndStop(2);
};
website_txt.onKillFocus = function () {
box3_mc.gotoAndStop(1);
};
comment_txt.onSetFocus = function () {
box4_mc.gotoAndStop(2);
};
comment_txt.onKillFocus = function () {
box4_mc.gotoAndStop(1);
};
Symbol 150 MovieClip Frame 19
stop();
close_btn.onPress = function () {
_parent.show_comment_pane();
};
Symbol 150 MovieClip Frame 23
stop();
close_btn.onPress = function () {
_parent.show_comment_pane();
};
Symbol 150 MovieClip Frame 29
play();
Symbol 150 MovieClip Frame 42
stop();
Symbol 153 MovieClip [MochiBotBar] Frame 1
function init_rate_me() {
cookie = SharedObject.getLocal("rate_me_limit");
var _local1 = cookie.data.year;
var _local4 = cookie.data.month;
var _local3 = cookie.data.date;
var _local5 = cookie.data.hour;
var _local6 = cookie.data.min;
var _local9 = cookie.data.sec;
cookieDate = new Date(_local1, _local4, _local3, _local5, _local6, _local9);
cookieMillisecs = cookieDate.getTime();
currentDate = new Date();
currentMillisecs = currentDate.getTime();
var _local8 = currentMillisecs - cookieMillisecs;
var _local7 = Math.floor(_local8 / 1000);
var _local2 = Math.floor(_local7 / 60);
var _local10 = Math.floor(_local2 / 60);
if ((_local2 < mochi_rate_me_time) && (_local1 != undefined)) {
get_rating();
}
}
function set_rate_me_cookie() {
cookie = SharedObject.getLocal("rate_me_limit");
var _local1 = new Date();
var _local4 = _local1.getFullYear();
var _local3 = _local1.getMonth();
var _local5 = _local1.getDate();
var _local7 = _local1.getHours();
var _local6 = _local1.getMinutes();
var _local2 = _local1.getSeconds();
cookie.data.year = _local4;
cookie.data.month = _local3;
cookie.data.date = _local5;
cookie.data.hour = _local7;
cookie.data.min = _local6;
cookie.data.sec = _local2;
cookie.flush();
}
function show_comment_pane() {
if (!comment_on) {
comment_on = true;
if (!help_on) {
gotoAndPlay ("comment_on");
} else {
help_on = false;
next_frame = "comment_on";
gotoAndPlay ("comment_off");
}
comment_btn_mc.gotoAndPlay("off");
} else {
comment_on = false;
next_frame = null;
gotoAndPlay ("comment_off");
comment_btn_mc.gotoAndPlay("off");
}
}
function show_help_pane() {
if (!help_on) {
help_on = true;
if (!comment_on) {
gotoAndPlay ("comment_on");
} else {
comment_on = false;
next_frame = "comment_on";
gotoAndPlay ("comment_off");
}
} else {
help_on = false;
next_frame = null;
gotoAndPlay ("comment_off");
}
}
function show_component(comment_on) {
if (!is_on) {
is_on = true;
gotoAndPlay ("component_on");
} else if (comment_on) {
next_frame = "component_off";
comment_on = false;
gotoAndPlay ("comment_off");
} else {
next_frame = null;
is_on = false;
gotoAndPlay ("component_off");
}
}
function clear_cookie() {
cookie = SharedObject.getLocal("rate_me_limit");
cookie.clear();
}
stop();
var mochibot_id = "7ede87a8";
guide_mc._visible = false;
var mochi_rate_me_time = 720;
var mochi_vote_url = "http://www.mochibot.com/api/api-feedback.html";
var mochi_comment_url = "http://www.mochibot.com/api/api-feedback.html";
var mochi_public_comments_url = ("http://www.mochibot.com/shared/shared_feedback.html?swfid=" + mochibot_id);
var mochi_comments_public = false;
var comment_on = false;
var help_on = false;
var is_on = false;
var next_frame = null;
_global.submit_vote = function (vote) {
rate_me_mc.gotoAndPlay("out");
var _local3 = new LoadVars();
var _local4 = new LoadVars();
_local3.mochibot_id = mochibot_id;
_local3.vote = vote;
_local3.swfurl = _root._url;
_local4.onLoad = function () {
rate_me_mc.score = this.score;
rate_me_mc.gotoAndPlay("thanks");
};
_local3.sendAndLoad(mochi_vote_url, _local4, "POST");
set_rate_me_cookie();
};
_global.submit_comment = function (name_str, email_str, comment_str) {
var _local3 = new LoadVars();
var _local4 = new LoadVars();
_local3.name = name_str;
_local3.email = email_str;
_local3.comment = comment_str;
_local3.mochibot_id = mochibot_id;
_local3.swfurl = _root._url;
_local4.onLoad = function () {
if (this.invalidSwf == "true") {
form_mc.gotoAndStop("error");
} else {
form_mc.gotoAndPlay("success");
}
};
_local3.sendAndLoad(mochi_comment_url, _local4, "POST");
};
_global.get_rating = function () {
rate_me_mc.gotoAndStop("score");
var _local2 = new LoadVars();
var _local3 = new LoadVars();
_local2.mochibot_id = mochibot_id;
_local3.onLoad = function () {
rate_me_mc.score = this.score;
rate_me_mc.gotoAndPlay("score");
mochi_comments_public = this.commentsPublic;
};
_local2.sendAndLoad(mochi_vote_url, _local3, "GET");
};
toggle_btn.onRelease = function () {
show_component();
};
toggle_btn.onRollOver = function () {
head_mc._alpha = 100;
bubble_mc.gotoAndPlay(2);
};
toggle_btn.onRollOut = function () {
head_mc._alpha = 50;
bubble_mc.gotoAndStop(1);
};
Symbol 153 MovieClip [MochiBotBar] Frame 2
play();
Symbol 153 MovieClip [MochiBotBar] Frame 22
init_rate_me();
Symbol 153 MovieClip [MochiBotBar] Frame 29
stop();
comment_btn_mc.hit_btn.onPress = show_comment_pane;
comment_btn_mc.hit_btn.onRollOver = function () {
comment_btn_mc.gotoAndPlay("on");
};
comment_btn_mc.hit_btn.onRollOut = function () {
if (comment_btn_mc.is_open) {
comment_btn_mc.gotoAndPlay("off");
}
};
toggle_btn.onRelease = function () {
show_component();
};
toggle_btn.onRollOver = function () {
head_mc._alpha = 100;
bubble_mc.gotoAndPlay(2);
};
Symbol 153 MovieClip [MochiBotBar] Frame 39
if (help_on) {
form_mc.gotoAndPlay("help");
} else {
form_mc.gotoAndStop(1);
}
Symbol 153 MovieClip [MochiBotBar] Frame 45
stop();
toggle_btn.onRelease = function () {
show_component(true);
};
Symbol 153 MovieClip [MochiBotBar] Frame 51
if (next_frame != null) {
gotoAndPlay(next_frame);
} else {
gotoAndStop ("hold");
}
Symbol 157 MovieClip Frame 23
stop();
Symbol 160 MovieClip [cEndGame] Frame 35
stop();
Symbol 162 MovieClip Frame 23
stop();
Symbol 164 MovieClip [cEndParty] Frame 35
stop();
Symbol 20480 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.7");
}
static function showPreGameAd(options) {
var _local2 = {clip:_root.ad, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
org.flashdevelop.utils.FlashConnect.mtrace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software", "MochiAd::showPreGameAd", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 91);
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local2);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local3 = 11000;
var _local4 = options.ad_timeout;
delete options.ad_timeout;
var _local5 = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local6 = _getRes(options);
var _local7 = _local6[0];
var _local8 = _local6[1];
mc._x = _local7 * 0.5;
mc._y = _local8 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local7 * -0.5;
chk._y = _local8 * -0.5;
var _local9 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local9._visible = false;
delete options.no_progress_bar;
} else {
_local9._x = 10;
_local9._y = _local8 - 20;
}
var _local10 = options.color;
delete options.color;
var _local11 = options.background;
delete options.background;
var _local12 = options.outline;
delete options.outline;
var _local13 = _local9.createEmptyMovieClip("_outline", 1);
_local13.beginFill(_local11);
_local13.moveTo(0, 0);
_local13.lineTo(_local7 - 20, 0);
_local13.lineTo(_local7 - 20, 10);
_local13.lineTo(0, 10);
_local13.lineTo(0, 0);
_local13.endFill();
var _local14 = _local9.createEmptyMovieClip("_inside", 2);
_local14.beginFill(_local10);
_local14.moveTo(0, 0);
_local14.lineTo(_local7 - 20, 0);
_local14.lineTo(_local7 - 20, 10);
_local14.lineTo(0, 10);
_local14.lineTo(0, 0);
_local14.endFill();
_local14._xscale = 0;
var _local15 = _local9.createEmptyMovieClip("_outline", 3);
_local15.lineStyle(0, _local12, 100);
_local15.moveTo(0, 0);
_local15.lineTo(_local7 - 20, 0);
_local15.lineTo(_local7 - 20, 10);
_local15.lineTo(0, 10);
_local15.lineTo(0, 0);
chk.ad_msec = _local3;
chk.ad_timeout = _local4;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = _local5;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local3 = this.mc._mochiad_wait;
_local3.server_control = true;
_local3.started = getTimer();
_local3.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
org.flashdevelop.utils.FlashConnect.mtrace("[MOCHIAD rpcTestFn] " + s, "MochiAd::showPreGameAd", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 222);
return(s);
};
chk.onEnterFrame = function () {
var _local2 = this._parent._parent;
var _local3 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local5 = false;
var _local6 = _local2.getBytesTotal();
var _local7 = _local2.getBytesLoaded();
var _local8 = (100 * _local7) / _local6;
var _local9 = (100 * _local4) / chk.ad_msec;
var _local10 = this._mochiad_bar._inside;
var _local11 = Math.min(100, Math.min(_local8 || 0, _local9));
_local11 = Math.max(this.last_pcnt, _local11);
this.last_pcnt = _local11;
_local10._xscale = _local11;
options.ad_progress(_local11);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local8});
if (_local8 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local12 = _local3.getBytesTotal();
if ((_local12 > 0) || (typeof(_local12) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local4 > chk.ad_timeout) && (_local8 == 100)) {
options.ad_failed();
_local5 = true;
}
}
if (_local4 > chk.ad_msec) {
_local5 = true;
}
if ((_local6 > 0) && ((_local7 >= _local6) && (_local5))) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local2 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
org.flashdevelop.utils.FlashConnect.mtrace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software", "MochiAd::showClickAwayAd", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 325);
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local2);
var clip = options.clip;
var _local3 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local5 = _local4[0];
var _local6 = _local4[1];
mc._x = _local5 * 0.5;
mc._y = _local6 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local3;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
org.flashdevelop.utils.FlashConnect.mtrace("[MOCHIAD rpcTestFn] " + s, "MochiAd::showClickAwayAd", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 367);
return(s);
};
var _local7 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local2 = this._parent._mochiad_ctr;
var _local3 = getTimer() - this.started;
var _local4 = false;
if (!chk.showing) {
var _local5 = _local2.getBytesTotal();
if ((_local5 > 0) || (typeof(_local5) == "undefined")) {
_local4 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local3 > chk.ad_timeout) {
options.ad_failed();
_local4 = true;
}
}
if (_local4) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local2 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
org.flashdevelop.utils.FlashConnect.mtrace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software", "MochiAd::showInterLevelAd", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 454);
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local2);
var clip = options.clip;
var _local3 = 11000;
var _local4 = options.ad_timeout;
delete options.ad_timeout;
var _local5 = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local6 = clip._mochiad;
_local6.onUnload = function () {
options.ad_finished();
};
var _local7 = _getRes(options);
var _local8 = _local7[0];
var _local9 = _local7[1];
_local6._x = _local8 * 0.5;
_local6._y = _local9 * 0.5;
var chk = _local6.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local3;
chk.ad_timeout = _local4;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = _local5;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
_local6.lc.adLoaded = options.ad_loaded;
_local6.lc.adSkipped = options.ad_skipped;
_local6.lc.adjustProgress = function (msec) {
var _local3 = this.mc._mochiad_wait;
_local3.server_control = true;
_local3.started = getTimer();
_local3.ad_msec = msec - 250;
};
_local6.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
_local6.rpcTestFn = function (s) {
org.flashdevelop.utils.FlashConnect.mtrace("[MOCHIAD rpcTestFn] " + s, "MochiAd::showInterLevelAd", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 518);
return(s);
};
chk.onEnterFrame = function () {
var _local2 = this._parent._mochiad_ctr;
var _local3 = getTimer() - this.started;
var _local4 = false;
if (!chk.showing) {
var _local5 = _local2.getBytesTotal();
if ((_local5 > 0) || (typeof(_local5) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local3 > chk.ad_timeout) {
options.ad_failed();
_local4 = true;
}
}
if (_local3 > chk.ad_msec) {
_local4 = true;
}
if (_local4) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
org.flashdevelop.utils.FlashConnect.mtrace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0", "MochiAd::showPreloaderAd", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 553);
showPreGameAd(options);
}
static function showTimedAd(options) {
org.flashdevelop.utils.FlashConnect.mtrace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0", "MochiAd::showTimedAd", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 559);
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local3 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local3);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local3);
}
}
return(_local3);
}
static function load(options) {
var _local3 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local3);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local4 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local4._mochiad_loaded) {
return(null);
}
var _local5 = options.depth;
delete options.depth;
var _local6 = _local4.createEmptyMovieClip("_mochiad", _local5);
var _local7 = _getRes(options);
options.res = (_local7[0] + "x") + _local7[1];
options.server = options.server + options.id;
delete options.id;
_local4._mochiad_loaded = true;
var _local8 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var k in options) {
_local8[k] = options[k];
}
var _local9 = _local8.server;
delete _local8.server;
var _local10 = _allowDomains(_local9);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local11 = new LocalConnection();
var _local12 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local11.mc = _local6;
_local11.name = _local12;
_local11.hostname = _local10;
_local11.allowDomain = function (d) {
return(true);
};
_local11.allowInsecureDomain = _local11.allowDomain;
_local11.connect(_local12);
_local6.lc = _local11;
_local8.lc = _local12;
_local8.st = getTimer();
_local8.loadMovie(_local9 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local2 = System.security;
if (_local2.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local4 = 0;
var _local5 = 0;
if (typeof(options.res) != "undefined") {
var _local6 = options.res.split("x");
_local4 = _global.parseFloat(_local6[0]);
_local5 = _global.parseFloat(_local6[1]);
} else {
_local4 = _local3.xMax - _local3.xMin;
_local5 = _local3.yMax - _local3.yMin;
}
if ((_local4 == 0) || (_local5 == 0)) {
_local4 = Stage.width;
_local5 = Stage.height;
}
return([_local4, _local5]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var k in defaults) {
_local4[k] = defaults[k];
}
if (options) {
for (var k in options) {
_local4[k] = options[k];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local6 = 0;
for ( ; _local6 < _local5.length ; _local6++) {
var _local7 = _local5[_local6].split("=");
_local4[_global.unescape(_local7[0])] = _global.unescape(_local7[1]);
}
}
if (_local4.id == "test") {
org.flashdevelop.utils.FlashConnect.mtrace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!", "MochiAd::_parseOptions", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 744);
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local5 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local5);
break;
case "runMethod" :
var _local6 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local6);
break;
default :
org.flashdevelop.utils.FlashConnect.mtrace("[mochiads rpc] unknown rpc id: " + arg.id, "MochiAd::rpc", "G:\\TAFF_PERSO\\balls\\balls_mochiads2_newpet\\src/MochiAd.as", 763);
}
}
static function setValue(base, objectName, value) {
var _local5 = objectName.split(".");
var _local6 = 0;
for ( ; _local6 < (_local5.length - 1) ; _local6++) {
if ((base[_local5[_local6]] == undefined) || (base[_local5[_local6]] == null)) {
return(undefined);
}
base = base[_local5[_local6]];
}
base[_local5[_local6]] = value;
}
static function getValue(base, objectName) {
var _local4 = objectName.split(".");
var _local5 = 0;
for ( ; _local5 < (_local4.length - 1) ; _local5++) {
if ((base[_local4[_local5]] == undefined) || (base[_local4[_local5]] == null)) {
return(undefined);
}
base = base[_local4[_local5]];
}
return(base[_local4[_local5]]);
}
static function runMethod(base, methodName, argsArray) {
var _local5 = methodName.split(".");
var _local6 = 0;
for ( ; _local6 < (_local5.length - 1) ; _local6++) {
if ((base[_local5[_local6]] == undefined) || (base[_local5[_local6]] == null)) {
return(undefined);
}
base = base[_local5[_local6]];
}
if (typeof(base[_local5[_local6]]) == "function") {
return(base[_local5[_local6]].apply(base, argsArray));
}
return(undefined);
}
//ASSetPropFlags(_local1, null, 1);
}
Symbol 20481 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
}
Symbol 20482 MovieClip [__Packages.org.flashdevelop.utils.TraceLevel] Frame 0
class org.flashdevelop.utils.TraceLevel
{
function TraceLevel () {
}
static var INFO = 0;
static var DEBUG = 1;
static var WARNING = 2;
static var ERROR = 3;
static var FATAL = 4;
}
Symbol 20483 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local2 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local2);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
}
Symbol 20484 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local3 = _listeners;
var _local4 = _local3.length;
while (_local4--) {
if (_local3[_local4] == o) {
_local3.splice(_local4, 1);
if (!_local3.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local2 = String(arguments.shift());
var _local3 = _listeners.concat();
var _local4 = _local3.length;
var _local5 = 0;
for ( ; _local5 < _local4 ; _local5++) {
_local3[_local5][_local2].apply(_local3[_local5], arguments);
}
}
}
Symbol 20485 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = begin;
this.duration = duration;
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = finish;
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local3 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local3) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
_global.updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = finish;
if (duration != undefined) {
this.duration = duration;
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = _global.setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
_global.clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = _duration;
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = (getTimer() - _startTime) / 1000;
} else {
time = _time + 1;
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = _time - 1;
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = getPosition(_time);
}
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 20486 MovieClip [__Packages.org.flashdevelop.utils.FlashConnect] Frame 0
class org.flashdevelop.utils.FlashConnect
{
static var messages, counter, socket, interval;
function FlashConnect () {
}
static function send(message) {
if (messages == null) {
initialize();
}
messages.push(message);
}
static function trace(message, level) {
var _local4 = createMsgNode(message, level);
send(_local4);
}
static function mtrace(message, method, path, line) {
if (path.charAt(1) != ":") {
path = "~/" + path;
}
var _local6 = (((path + ":") + line) + ":") + message;
trace(_local6, org.flashdevelop.utils.TraceLevel.DEBUG);
}
static function initialize() {
counter = 0;
messages = new Array();
socket = new XMLSocket();
socket.onData = function (data) {
org.flashdevelop.utils.FlashConnect.onReturnData(data);
};
socket.onConnect = function (success) {
if (success) {
org.flashdevelop.utils.FlashConnect.status = 1;
} else {
org.flashdevelop.utils.FlashConnect.status = -1;
}
org.flashdevelop.utils.FlashConnect.onConnection();
};
interval = _global.setInterval(sendStack, 50);
socket.connect(host, port);
}
static function createMsgNode(message, level) {
if (_global.isNaN(level)) {
level = org.flashdevelop.utils.TraceLevel.DEBUG;
}
var _local4 = new XMLNode(1, null);
var _local5 = new XMLNode(3, _global.escape(message));
_local4.attributes.state = level.toString();
_local4.attributes.cmd = "trace";
_local4.nodeName = "message";
_local4.appendChild(_local5);
return(_local4);
}
static function sendStack() {
if ((messages.length > 0) && (status == 1)) {
var _local2 = new XML();
var _local3 = _local2.createElement("flashconnect");
while (messages.length != 0) {
counter++;
if (counter > limit) {
_global.clearInterval(interval);
var _local4 = new String("FlashConnect aborted. You have reached the limit of maximum messages.");
var _local5 = createMsgNode(_local4, org.flashdevelop.utils.TraceLevel.ERROR);
_local3.appendChild(_local5);
break;
}
var _local6 = XMLNode(messages.shift());
_local3.appendChild(_local6);
}
_local2.appendChild(_local3);
socket.send(_local2);
}
}
static var status = 0;
static var limit = 1000;
static var host = "localhost";
static var port = 1978;
}
Symbol 20487 MovieClip [__Packages.Main] Frame 0
class Main
{
static var _cRoot, _m;
var cContainer, cBallContainer, cEatBall, cTimer, cScore, cLifes, cLevel, nGoal, aBallNames, nMaxLifeFalled, nMaxTimeFalled, cEnd, nTime, aBalls, nTimer, nIdInterval, nIdIntervalKnock;
function Main () {
if (!bLocal) {
__com_mochibot__("7ede87a8", _cRoot, 10301, true);
showAd();
} else {
launchTuto();
}
}
static function main(swfRoot) {
_cRoot = swfRoot;
if (!_m) {
_m = new Main();
}
}
function launchTuto() {
if (!bTuto) {
_cRoot.attachMovie("cTuto", "cTuto", 1);
_cRoot.cTuto.tf_tuto.text = "Your pet is a strange one : a real glutton, always hungry ! \nLet it follow your mouse to show it what it can eat. \nDon't forget : it will catch everything it can !\n\nClick to start ! ";
var _this = this;
_cRoot.cTuto.onRelease = function () {
_this.initGame();
};
bTuto = true;
}
}
function __com_mochibot__(swfid, mc, lv, trk) {
var _local13 = "__mochibot__";
var _local14 = "mochibot.com";
var _local7 = (_global ? (_global) : (_level0._root));
if (_local7[_local13 + swfid]) {
return(_local7[_local13 + swfid]);
}
var _local8 = System.security;
var _local6 = mc._root.getSWFVersion;
var _local9 = (_local6 ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!_local8) {
_local8 = {};
}
var _local10 = _local8.sandboxType;
if (_local10 == "localWithFile") {
return(null);
}
_local6 = _local8.allowDomain;
if (_local6) {
_local8.allowDomain(_local14);
}
_local6 = _local8.allowInsecureDomain;
if (_local6) {
_local8.allowInsecureDomain(_local14);
}
var _local15 = ((_local9 == 5) ? (getVersion()) : (System.capabilities.version));
var _local11 = (((((((((((("http://" + _local14) + "/my/core.swf?mv=8&fv=") + _local9) + "&v=") + _global.escape(_local15)) + "&swfid=") + _global.escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (_local10 ? ("&sb=" + _local10) : "")) + (trk ? "&t=1" : "");
lv = ((_local9 > 6) ? (mc.getNextHighestDepth()) : ((_local7[_local13 + "level"] ? (_local7[_local13 + "level"] + 1) : (lv))));
_local7[_local13 + "level"] = lv;
if (_local9 == 5) {
var _local12 = "_level" + lv;
if (!eval (_local12)) {
_global.loadMovieNum(_local11, lv);
}
} else {
var _local12 = mc.createEmptyMovieClip(_local13 + swfid, lv);
_local12.loadMovie(_local11);
}
return(_local12);
}
function initGame() {
_cRoot.createEmptyMovieClip("back", 1);
_cRoot.back.attachMovie("back1", "back", 1);
cContainer = _cRoot.createEmptyMovieClip("container", 2);
cBallContainer = cContainer.createEmptyMovieClip("cBallContainer", 1);
var _local2 = this;
cEatBall = cContainer.attachMovie("newpet", "newpet", cContainer.getNextHighestDepth(), {_x:0, _y:200});
cEatBall.gotoAndStop("base");
cTimer = _cRoot.attachMovie("cTimer", "cTimer", _cRoot.getNextHighestDepth(), {_y:0});
cScore = _cRoot.attachMovie("cScore", "cScore", _cRoot.getNextHighestDepth(), {_x:372});
cLifes = _cRoot.attachMovie("cLifes", "cLifes", _cRoot.getNextHighestDepth(), {_x:277});
cLevel = _cRoot.attachMovie("cLevel", "cLevel", _cRoot.getNextHighestDepth(), {_x:155, _y:0});
launchGame();
}
function launchGame() {
cEatBall._visible = false;
cLevel.tf_level.text = nLevel;
cLifes.removeMovieClip();
cLifes = _cRoot.attachMovie("cLifes", "cLifes", _cRoot.getNextHighestDepth(), {_x:277});
var _local2 = 3;
for ( ; _local2 > nLife ; _local2--) {
cLifes["eat" + _local2]._visible = false;
}
launchParty();
}
function showAd() {
if (!bLocal) {
var _this = this;
_cRoot.createEmptyMovieClip("ad", 1);
MochiAd.showPreGameAd({id:"1563746cbc370a85", res:"500x500", no_bg:true, no_progress_bar:false, ad_failed:function () {
org.flashdevelop.utils.FlashConnect.mtrace("ad failed", "Main::showAd", "src/Main.as", 139);
Main._m.launchTuto();
}, ad_skipped:function () {
org.flashdevelop.utils.FlashConnect.mtrace("ad skipped", "Main::showAd", "src/Main.as", 139);
Main._m.launchTuto();
}});
_global.setTimeout(function () {
_this.launchTuto();
}, 15000);
} else {
launchTuto();
}
}
function launchParty() {
nLifeFalled = 0;
nTimeFalled = 0;
nInitTimer = 60;
switch (nLevel) {
case 1 :
_cRoot.back.attachMovie("back1", "back", 1);
nBallTimer = 1800;
nGoal = 10;
aBallNames = ["ball1", "ball2", "bomb", "bomb", "bomb", "ball3", "bomb", "bomb", "bomb", "life"];
nMaxLifeFalled = 0;
break;
case 2 :
_cRoot.back.back.tf_click._visible = true;
nGoal = 20;
nBallTimer = 1600;
aBallNames = ["ball1", "ball2", "ball3", "bomb", "bomb", "ball3", "bomb", "bomb", "bomb", "bomb", "life"];
nMaxLifeFalled = 0;
break;
case 3 :
nBallTimer = 1300;
nGoal = 25;
aBallNames = ["ball2", "ball3", "ball2", "bomb", "bomb", "ball3", "bomb", "bomb", "mallet", "life"];
_cRoot.back.attachMovie("back2", "back", 1);
nMaxLifeFalled = 0;
break;
case 4 :
_cRoot.back.back.tf_click._visible = true;
nBallTimer = 1200;
nGoal = 30;
aBallNames = ["ball2", "ball3", "ball3", "bomb", "bomb", "ball3", "bomb", "mallet", "mallet", "life"];
nMaxLifeFalled = 0;
break;
case 5 :
_cRoot.back.attachMovie("back3", "back", 1);
nBallTimer = 1000;
nGoal = 45;
aBallNames = ["ball3", "ball3", "ball4", "bomb", "bomb", "ball4", "bomb", "mallet", "mallet", "mallet", "life", "cTime"];
nMaxLifeFalled = 1;
nMaxTimeFalled = 1;
break;
case 6 :
_cRoot.back.back.tf_click._visible = true;
nBallTimer = 950;
nGoal = 55;
aBallNames = ["ball3", "ball4", "ball3", "bomb", "bomb", "ball4", "bomb", "mallet", "mallet", "mallet", "life", "cTime"];
nMaxLifeFalled = 1;
nMaxTimeFalled = 1;
break;
case 7 :
_cRoot.back.attachMovie("back4", "back", 1);
nBallTimer = 950;
nGoal = 65;
aBallNames = ["ball4", "ball5", "bomb", "bomb", "bomb", "ball4", "bomb", "mallet", "mallet", "mallet", "life", "cTime"];
nMaxLifeFalled = 2;
nMaxTimeFalled = 1;
break;
case 8 :
_cRoot.back.back.tf_click._visible = true;
nBallTimer = 900;
nGoal = 70;
aBallNames = ["ball4", "ball5", "bomb", "bomb", "bomb", "ball4", "bomb", "mallet", "mallet", "mallet", "life", "cTime"];
nMaxLifeFalled = 1;
nMaxTimeFalled = 2;
break;
case 9 :
_cRoot.back.attachMovie("back5", "back", 1);
nGoal = 90;
nBallTimer = 800;
aBallNames = ["ball4", "ball5", "ball5", "bomb", "bomb", "bomb", "bomb", "mallet", "life", "ball4", "cTime", "ball4", "ball5", "bomb", "bomb", "bomb", "bomb", "mallet", "mallet"];
nMaxLifeFalled = 2;
nMaxTimeFalled = 2;
break;
case 10 :
_cRoot.back.back.tf_click._visible = true;
nGoal = 110;
nBallTimer = 800;
aBallNames = ["ball5", "ball5", "bomb", "bomb", "bomb", "ball5", "bomb", "mallet", "mallet", "mallet", "cTime"];
nMaxLifeFalled = 2;
nMaxTimeFalled = 2;
}
cEatBall._visible = true;
bStop = false;
bCanMove = true;
cEatBall.knock._visible = false;
cBallContainer = cContainer.createEmptyMovieClip("cBallContainer", 1);
cEnd.removeMovieClip();
nFalledBalls = 0;
cEatBall._xscale = 100 + (nLevel * 3);
cEatBall._yscale = cEatBall._xscale;
cEatBall._y = 500 - ((71 * cEatBall._xscale) / 100);
nTime = 60;
nFalledBalls = 0;
aBalls = new Array();
nScore = 0;
nTimer = 0;
cScore.tf_score.text = 0;
cScore.tf_goal.text = nGoal;
var _this = this;
_cRoot.back.back.onPress = function () {
if (_this.bCanMove) {
_this.cEatBall._x = this._xmouse - 36;
_this.cEatBall.gotoAndPlay("live");
_this.cEatBall.knock._visible = false;
_this.cEatBall.startDrag(false, 16, _this.cEatBall._y, 500 - ((80 * _this.cEatBall._xscale) / 100), _this.cEatBall._y);
}
if ((_this.nFalledBalls == 0) && (_this.nTime == 60)) {
_this.launchTimer();
_global.setTimeout(function () {
_this.launchBall();
}, Math.floor(Math.random() * _this.nBallTimer));
}
this.tf_click._visible = false;
};
}
function launchTimer() {
nIdInterval = _global.setInterval(this, "setTimer", 1000);
}
function setTimer() {
if (nTimer < nInitTimer) {
nTimer++;
cTimer.tf_min.text = Math.floor((nInitTimer - nTimer) / 60);
cTimer.tf_sec.text = (nInitTimer - nTimer) - (Number(cTimer.tf_min.text) * 60);
} else {
_global.clearInterval(nIdInterval);
if (!bStop) {
endParty("time");
}
}
}
function launchBall() {
if (nScore < nGoal) {
if (bStop == false) {
nFalledBalls++;
var _local2 = aBallNames[Math.floor(Math.random() * aBallNames.length)];
var _local3 = false;
if ((_local2 == "life") && (nLifeFalled < nMaxLifeFalled)) {
_local3 = true;
} else if ((_local2 == "cTime") && (nTimeFalled < nMaxTimeFalled)) {
_local3 = true;
} else if ((_local2 != "life") && (_local2 != "cTime")) {
_local3 = true;
}
if (_local3) {
var _local4 = cBallContainer.attachMovie(_local2, "ball" + nFalledBalls, cBallContainer.getNextHighestDepth(), {_x:Math.floor(Math.random() * 400), _y:-20});
var _this = this;
if (_local2 == "life") {
nLifeFalled++;
}
if (_local2 == "cTime") {
nTimeFalled++;
}
var _local5 = {nom:_local2, clip:_local4, tween:new mx.transitions.Tween(_local4, "_y", mx.transitions.easing.Regular.easeInOut, _local4._y, 648, 72, false)};
aBalls.push(_local5);
_local5.tween.onMotionChanged = function (tw, pos) {
if ((tw.obj._y > 400) && (tw.obj._y < 549)) {
if (tw.obj.hitTest(_this.cEatBall) && (tw.obj._y < 495)) {
tw.obj._visible = false;
_this.destroyBall(tw.obj);
}
} else if (tw.obj._y > 549) {
var _local5 = 0;
for ( ; _local5 < _this.aBalls.length ; _local5++) {
if (_this.aBalls[_local5].clip == tw.obj) {
var _local4 = _local5;
break;
}
}
this.removeMovieClip();
_this.aBalls.splice(_local4, 1);
}
};
var _local6 = Math.floor(Math.random() * nBallTimer);
_global.setTimeout(function () {
_this.launchBall();
}, _local6);
} else {
launchBall();
}
}
} else {
endParty("goal");
}
}
function destroyBall(mc) {
var _local4 = 0;
for ( ; _local4 < aBalls.length ; _local4++) {
if (aBalls[_local4].clip == mc) {
var _local3 = _local4;
break;
}
}
aBalls[_local3].tween.stop();
if (nScore < nGoal) {
switch (aBalls[_local3].nom) {
case "ball1" :
nScore = nScore + 1;
cEatBall.gotoAndPlay("eat");
mc.removeMovieClip();
break;
case "ball2" :
nScore = nScore + 1;
cEatBall.gotoAndPlay("eat");
mc.removeMovieClip();
break;
case "ball3" :
nScore = nScore + 2;
cEatBall.gotoAndPlay("eat");
mc.removeMovieClip();
break;
case "ball4" :
nScore = nScore + 4;
cEatBall.gotoAndPlay("eat");
mc.removeMovieClip();
break;
case "ball5" :
nScore = nScore + 5;
cEatBall.gotoAndPlay("eat");
mc.removeMovieClip();
break;
case "life" :
if (nLife < 3) {
nLife++;
}
cLifes["eat" + nLife]._visible = true;
cEatBall.gotoAndPlay("newlife");
mc.removeMovieClip();
break;
case "mallet" :
cEatBall.knock._visible = true;
var _local5 = this;
mc.removeMovieClip();
cEatBall.stopDrag();
bCanMove = false;
_global.clearInterval(nIdIntervalKnock);
nIdIntervalKnock = _global.setInterval(this, "allowMove", 2000);
cEatBall.gotoAndStop("knockout");
break;
case "bomb" :
mc.removeMovieClip();
cEatBall.stopDrag();
bCanMove = false;
_global.clearInterval(nIdIntervalKnock);
nIdIntervalKnock = _global.setInterval(this, "allowMove", 500);
newLife();
break;
case "cTime" :
mc.removeMovieClip();
nInitTimer = nInitTimer + 10;
cTimer.tf_min.text = Math.floor((nInitTimer - nTimer) / 60);
cTimer.tf_sec.text = (nInitTimer - nTimer) - (Number(cTimer.tf_min.text) * 60);
}
}
cScore.tf_score.text = nScore;
aBalls.splice(_local3, 1);
}
function allowMove() {
_global.clearInterval(nIdIntervalKnock);
bCanMove = true;
cEatBall.knock._visible = false;
cEatBall._x = _cRoot.back.back._xmouse - 36;
cEatBall.startDrag(false, 16, cEatBall._y, 500 - ((80 * cEatBall._xscale) / 100), cEatBall._y);
cEatBall.gotoAndPlay("live");
}
function newLife() {
if (nLife == 0) {
endGame("life");
} else {
cLifes["eat" + nLife]._visible = false;
cEatBall.gotoAndPlay("die");
nLife--;
}
}
function endParty(type) {
_global.clearInterval(nIdInterval);
bStop = true;
cEnd.removeMovieClip();
cEatBall.gotoAndStop("base");
switch (type) {
case "goal" :
switch (nLevel) {
case 1 :
var _local3 = "Ok ! You got it ! Let's continue ? \nClick !";
break;
case 2 :
_local3 = "Let's see the next... Be carefull, some heavy things may fall ... \nClick to continue !";
break;
case 3 :
_local3 = "Alright ... Will you be fast enough ? \n Click !";
break;
case 4 :
_local3 = "Did you loose some life ? Ok, open your eyes to reload energy ! \nClick !";
break;
case 5 :
_local3 = "Did you know that smaller balls give you more points ? \n Click to continue ! ";
break;
case 6 :
_local3 = "Faster ! Faster ! \n Click to see the following !";
break;
case 7 :
_local3 = "Is it difficult ? No ? Alright, see you next level so ! \n Click !";
break;
case 8 :
_local3 = "You're strong !!! Enough for the following ? \nClick to continue !";
break;
case 9 :
_local3 = "... \n Last level ... Will you be a champion ?\n Click to continue ?";
}
nLevel++;
break;
case "time" :
_local3 = "Time over ! You don't eat enough this time ... Try again ?";
}
if ((type == "goal") && (nLevel > 10)) {
endGame("finish");
} else {
cLevel.tf_level.text = nLevel;
var _this = this;
cEnd = _cRoot.attachMovie("cEndParty", "cEndParty", _cRoot.getNextHighestDepth());
cEatBall.stopDrag();
if (type == "time") {
cEnd.eatgrow._visible = false;
} else {
cEnd.eatslow._visible = false;
}
cEnd.tf_result.text = _local3;
cEnd.fond.onRelease = function () {
_this.launchParty();
};
}
}
function endGame(type) {
_global.clearInterval(nIdInterval);
bStop = true;
cEatBall.gotoAndStop("base");
cEnd.removeMovieClip();
cEnd = _cRoot.attachMovie("cEndGame", "cEndGame", _cRoot.getNextHighestDepth());
cEatBall.stopDrag();
if (type == "finish") {
cEnd.eatslow._visible = false;
nLife = nMaxLifes;
nTryLife = nMaxLifes;
nLevel = 1;
cEnd.tf_end.text = "Really impressive ! You have finished the game !!! \nYour pet is now strong enough to feed itself.\nWant to play again ?";
} else if (type == "life") {
nTryLife--;
if (nTryLife >= 0) {
nLife = nTryLife;
nLevel = (((nLevel - 1) > 0) ? (nLevel - 1) : 1);
cEnd.tf_end.text = "Damn, be carefull with how you take care of your pet !\nYou loose ... \nYou can try again, but your pet looses energy.\nTry again ?";
} else {
nLife = nMaxLifes;
nLevel = 1;
nTryLife = nMaxLifes;
cEnd.tf_end.text = "Are you sure you want this pet grows ?! \nIt died too many times ... \nClick to try again !";
}
}
aBalls = new Array();
var _this = this;
cEnd.fond.onRelease = function () {
_this.launchGame();
};
}
//ASSetPropFlags(_local1, null, 1);
var nLevel = 1;
var bLocal = false;
var nScore = 0;
var nBallTimer = 2000;
var nFalledBalls = 0;
var nInitTimer = 60;
var bStop = true;
var bCanMove = true;
var nLife = 3;
var nMaxLifes = 3;
var nTryLife = 3;
var bTuto = false;
var nLifeFalled = 0;
var nTimeFalled = 0;
}