Frame 1
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__("6bb5bcd7", this, 10301, true);
mochi.MochiServices.connect("50645379dccb2974");
function nielsen(movieClip) {
scCI = "us-ugo";
scCG = "ugoplayer_flashgames";
scSI = escape(movieClip);
loadMovieNum ((((((("http://secure-us.imrworldwide.com/cgi-bin/m?ci=" + scCI) + "&cg=") + scCG) + "&si=") + scSI) + "&rnd=") + Math.ceil(Math.random() * 100000000), 100);
}
nielsen("game_intro");
Frame 165
if (getTimer() > 4000) {
if (_root.getBytesLoaded() != _root.getBytesTotal()) {
_root.gotoAndPlay(150);
}
} else {
_root.gotoAndPlay(150);
}
Frame 167
function higher() {
_root.balls_quality = "high";
var i = 1;
while (i <= _root.level) {
eval ("ball_blue" + i).gotoAndStop(1);
eval ("ball_green" + i).gotoAndStop(1);
eval ("ball_red" + i).gotoAndStop(1);
i++;
}
_root.char.blue.gotoAndStop(1);
_root.char.green.gotoAndStop(1);
_root.char.red.gotoAndStop(1);
}
function lower() {
_root.balls_quality = "low";
var i = 1;
while (i <= _root.level) {
eval ("ball_blue" + i).gotoAndStop(2);
eval ("ball_green" + i).gotoAndStop(2);
eval ("ball_red" + i).gotoAndStop(2);
i++;
}
_root.char.blue.gotoAndStop(2);
_root.char.green.gotoAndStop(2);
_root.char.red.gotoAndStop(2);
}
function menu() {
if (_root.level != undefined) {
var i = 1;
while (i <= _root.level) {
trace("delete");
removeMovieClip(eval ("ball_blue" + i));
removeMovieClip(eval ("ball_green" + i));
removeMovieClip(eval ("ball_red" + i));
i++;
}
}
_root.score = 0;
_root.gotoAndStop("menu");
}
var cmenu = new ContextMenu();
var menuItem = new ContextMenuItem("Higher balls quality", higher);
var menuItem2 = new ContextMenuItem("Lower balls quality", lower);
var menuItem3 = new ContextMenuItem("Menu", menu);
cmenu.customItems.push(menuItem, menuItem2, menuItem3);
cmenu.builtInItems.zoom = false;
cmenu.builtInItems.play = false;
cmenu.builtInItems.loop = false;
cmenu.builtInItems.rewind = false;
cmenu.builtInItems.forward_back = false;
cmenu.builtInItems.print = false;
_root.menu = cmenu;
Stage.scaleMode = "noScale";
muted = false;
var my_sound = new Sound();
my_sound.attachSound("music");
my_sound.start(0, 1000);
my_sound.setVolume(100);
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (Key.isDown(77)) {
if (muted == true) {
my_sound.start(0, 1000)();
muted = false;
} else {
my_sound.stop();
muted = true;
}
}
};
Key.addListener(keyListener);
gotoAndStop ("menu");
Frame 168
stop();
Instance of Symbol 33 MovieClip in Frame 168
onClipEvent (load) {
lokalne_data = SharedObject.getLocal("ball_collector");
}
on (rollOver) {
this.play_button.gotoAndStop(2);
}
on (rollOut) {
this.play_button.gotoAndStop(1);
}
on (releaseOutside) {
this.play_button.gotoAndStop(1);
}
on (release) {
if (lokalne_data.data.seen_tutorial == true) {
_root.level = 1;
_root.attraction = 0.1;
_root.repellent = 0.1;
_root.slowmotion_time = 1000;
_root.life = 3;
_root.points = 0;
_root.repellent_lv = 1;
_root.attraction_lv = 1;
_root.slowmotion_lv = 1;
_root.gotoAndStop("play");
} else {
lokalne_data.data.seen_tutorial = true;
lokalne_data.flush();
_root.gotoAndStop("instructions");
}
}
Instance of Symbol 36 MovieClip in Frame 168
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (releaseOutside) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop("instructions");
}
Instance of Symbol 39 MovieClip in Frame 168
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (releaseOutside) {
this.gotoAndStop(1);
}
on (release) {
trace("release");
mochi.MochiScores.showLeaderboard({boardID:"8f5e793e6956aa22", onClose:function () {
_root.gotoAndStop("menu");
}});
}
Instance of Symbol 42 MovieClip in Frame 168
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (releaseOutside) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://secure-us.imrworldwide.com/cgi-bin/b?cg=ugoplayer_flash_games&ci=us-ugclicks&tu=http://www.ugoplayer.com", "_blank");
}
Instance of Symbol 45 MovieClip in Frame 168
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (releaseOutside) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndStop("credits");
}
Instance of Symbol 33 MovieClip in Frame 169
on (rollOver) {
this.play_button.gotoAndStop(2);
}
on (rollOut) {
this.play_button.gotoAndStop(1);
}
on (releaseOutside) {
this.play_button.gotoAndStop(1);
}
on (release) {
_root.level = 1;
_root.attraction = 0.1;
_root.repellent = 0.1;
_root.slowmotion_time = 1000;
_root.life = 3;
_root.points = 0;
_root.repellent_lv = 1;
_root.attraction_lv = 1;
_root.slowmotion_lv = 1;
_root.gotoAndStop("play");
}
Frame 170
points_tx.text = _root.points;
_root.level = _root.level + 1;
_root.play_button.gotoAndStop(2);
_root.play_button.play_tx.text = "play level " + _root.level;
_root.attraction_tx.text = "level: " + _root.attraction_lv;
_root.repellent_tx.text = "level: " + _root.repellent_lv;
_root.slowmotion_tx.text = "level: " + _root.slowmotion_lv;
_root.lifes_tx.text = _root.life;
_root.attraction2_tx.text = (("(" + _root.attraction_lv) + " pts") + ")";
_root.repellent2_tx.text = (("(" + _root.repellent_lv) + " pts") + ")";
_root.slowmotion2_tx.text = (("(" + _root.slowmotion_lv) + " pts") + ")";
Instance of Symbol 33 MovieClip "play_button" in Frame 170
on (release) {
_root.attraction = _root.attraction_lv / 10;
_root.repellent = _root.repellent_lv / 10;
_root.slowmotion_time = _root.slowmotion_lv * 1500;
_root.gotoAndStop("play");
}
Instance of Symbol 56 MovieClip in Frame 170
on (release) {
if (_root.points >= _root.attraction_lv) {
_root.points = _root.points - _root.attraction_lv;
_root.points_tx.text = _root.points;
_root.attraction_lv = _root.attraction_lv + 1;
_root.attraction_tx.text = "level: " + _root.attraction_lv;
_root.attraction2_tx.text = (("(" + _root.attraction_lv) + " pts") + ")";
}
}
Instance of Symbol 56 MovieClip in Frame 170
on (release) {
if (_root.points >= _root.repellent_lv) {
_root.points = _root.points - _root.repellent_lv;
_root.points_tx.text = _root.points;
_root.repellent_lv = _root.repellent_lv + 1;
_root.repellent_tx.text = "level: " + _root.repellent_lv;
_root.repellent2_tx.text = (("(" + _root.repellent_lv) + " pts") + ")";
}
}
Instance of Symbol 56 MovieClip in Frame 170
on (release) {
if (_root.points >= _root.slowmotion_lv) {
_root.points = _root.points - _root.slowmotion_lv;
_root.points_tx.text = _root.points;
_root.slowmotion_lv = _root.slowmotion_lv + 1;
_root.slowmotion_tx.text = "level: " + _root.slowmotion_lv;
_root.slowmotion2_tx.text = (("(" + _root.slowmotion_lv) + " pts") + ")";
}
}
Instance of Symbol 56 MovieClip in Frame 170
onClipEvent (load) {
gotoAndStop (2);
}
on (release) {
if (_root.points >= 5) {
_root.points = _root.points - 3;
_root.points_tx.text = _root.points;
_root.life = _root.life + 1;
_root.lifes_tx.text = _root.life;
}
}
Frame 171
function pohyb() {
if (_root.slowmotion != 1) {
trace("slowmotion: " + _root.slowmotion);
trace("nerovna sa 1");
if (_root.char.color_var != this.color_var) {
this.xvzdialenost = Math.abs(this._x - _root.char._x);
this.yvzdialenost = Math.abs(this._y - _root.char._y);
this.vzdialenost = Math.sqrt((this.xvzdialenost * this.xvzdialenost) + (this.yvzdialenost * this.yvzdialenost));
if (this.vzdialenost <= 100) {
if (this._x < _root.char._x) {
this.xspeed = this.xspeed - ((this.xvzdialenost / this.vzdialenost) * _root.repellent);
}
if (this._x > _root.char._x) {
this.xspeed = this.xspeed + ((this.xvzdialenost / this.vzdialenost) * _root.repellent);
}
if (this._y < _root.char._y) {
this.yspeed = this.yspeed - ((this.yvzdialenost / this.vzdialenost) * _root.repellent);
}
if (this._y > _root.char._y) {
this.yspeed = this.yspeed + ((this.yvzdialenost / this.vzdialenost) * _root.repellent);
}
}
}
if (_root.char.color_var == this.color_var) {
this.xvzdialenost = Math.abs(this._x - _root.char._x);
this.yvzdialenost = Math.abs(this._y - _root.char._y);
this.vzdialenost = Math.sqrt((this.xvzdialenost * this.xvzdialenost) + (this.yvzdialenost * this.yvzdialenost));
if (this.vzdialenost > 15) {
if (this._x > _root.char._x) {
this.xspeed = this.xspeed - ((this.xvzdialenost / this.vzdialenost) * attraction);
}
if (this._x < _root.char._x) {
this.xspeed = this.xspeed + ((this.xvzdialenost / this.vzdialenost) * attraction);
}
if (this._y > _root.char._y) {
this.yspeed = this.yspeed - ((this.yvzdialenost / this.vzdialenost) * attraction);
}
if (this._y < _root.char._y) {
this.yspeed = this.yspeed + ((this.yvzdialenost / this.vzdialenost) * attraction);
}
}
}
}
if (this.xspeed > 5) {
this.xspeed = this.xspeed * 0.9;
}
if (this.yspeed > 5) {
this.yspeed = this.yspeed * 0.9;
}
if (this._x >= 475) {
if (this.xspeed > 0) {
this.xspeed = this.xspeed * -1;
}
}
if (this._x <= 5) {
if (this.xspeed < 0) {
this.xspeed = this.xspeed * -1;
}
}
if (this._y >= 475) {
if (this.yspeed > 0) {
this.yspeed = this.yspeed * -1;
}
}
if (this._y <= 5) {
if (this.yspeed < 0) {
this.yspeed = this.yspeed * -1;
}
}
this._x = this._x + (this.xspeed * _root.slowmotion);
this._y = this._y + (this.yspeed * _root.slowmotion);
}
stop();
var slowmotion = 1;
var balls_blue = level;
var balls_green = level;
var balls_red = level;
life_tx.text = life;
var keyListener = new Object();
Key.addListener(keyListener);
keyListener.onKeyDown = function () {
if (Key.isDown(17)) {
if (_root.sm_enabled != false) {
_root.slowmotion = 0.5;
}
}
};
keyListener.onKeyUp = function () {
trace("up");
if (Key.isDown(17) != true) {
_root.slowmotion = 1;
}
};
blue_onscreen = 0;
green_onscreen = 0;
red_onscreen = 0;
var i = 1;
while (i <= balls_blue) {
attachMovie("ball_blue", "ball_blue" + i, _root.getNextHighestDepth(), {_x:random(Stage.width), _y:random(Stage.height)});
blue_onscreen = blue_onscreen + 1;
Set(("ball_blue" + i) + ".xspeed", (Math.random() * 10) - 5);
Set(("ball_blue" + i) + ".yspeed", (Math.random() * 10) - 5);
Set(("ball_blue" + i) + ".color_var", "blue");
eval ("ball_blue" + i).onEnterFrame = pohyb;
i++;
}
var i = 1;
while (i <= balls_green) {
attachMovie("ball_green", "ball_green" + i, _root.getNextHighestDepth(), {_x:random(Stage.width), _y:random(Stage.height)});
green_onscreen = green_onscreen + 1;
Set(("ball_green" + i) + ".xspeed", (Math.random() * 10) - 5);
Set(("ball_green" + i) + ".yspeed", (Math.random() * 10) - 5);
Set(("ball_green" + i) + ".color_var", "green");
eval ("ball_green" + i).onEnterFrame = pohyb;
i++;
}
var i = 1;
while (i <= balls_red) {
attachMovie("ball_red", "ball_red" + i, _root.getNextHighestDepth(), {_x:random(Stage.width), _y:random(Stage.height)});
red_onscreen = red_onscreen + 1;
Set(("ball_red" + i) + ".xspeed", (Math.random() * 10) - 5);
Set(("ball_red" + i) + ".yspeed", (Math.random() * 10) - 5);
Set(("ball_red" + i) + ".color_var", "red");
eval ("ball_red" + i).onEnterFrame = pohyb;
i++;
}
Instance of Symbol 71 MovieClip "char" in Frame 171
onClipEvent (load) {
function changecolor_var() {
trace("changecolor " + _root.changecolorneed);
if (((_root.char._currentframe == 1) or (_root.char._currentframe == 17)) or (_root.char._currentframe == 33)) {
trace("changecolor");
_root.changecolorneed = false;
space_up = true;
if (((_root.blue_onscreen == 0) and (_root.green_onscreen == 0)) and (_root.red_onscreen == 0)) {
_root.points = _root.points + 1;
_root.gotoAndStop("midlevel");
}
if (!(((_root.blue_onscreen == 0) and (_root.green_onscreen == 0)) and (_root.red_onscreen == 0))) {
var _local2 = random(3);
if (_local2 == 0) {
_root.char.color_var = "blue";
if (_root.blue_onscreen == 0) {
changecolor_var();
}
}
if (_local2 == 1) {
_root.char.color_var = "green";
if (_root.green_onscreen == 0) {
changecolor_var();
}
}
if (_local2 == 2) {
_root.char.color_var = "red";
if (_root.red_onscreen == 0) {
changecolor_var();
}
}
}
_root.char.gotoAndStop(_root.char.color_var);
} else {
_root.changecolorneed = true;
}
}
var multiplier = 0;
if (_root.score == undefined) {
_root.score = 0;
}
_root.score_tx.text = _root.score;
_root.sm_timeleft = _root.slowmotion_time;
_root.sm_usedtime = 0;
_root.sm_time = getTimer();
_root.sm_percent = 100;
_root.sm.gotoAndStop(_root.sm_percent);
var keyListener = new Object();
Key.addListener(keyListener);
keyListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space_up = false;
ball_lost = false;
}
};
changecolor_var();
space_up = false;
}
onClipEvent (enterFrame) {
multiplier = 0;
if (_root.changecolorneed == true) {
changecolor_var();
}
if (Key.isDown(17) != true) {
_root.slowmotion = 1;
_root.sm_enabled = true;
}
if (Key.isDown(17)) {
if (_root.sm_enabled != false) {
trace("enabled");
_root.sm_usedtime = _root.sm_usedtime + (getTimer() - _root.sm_time);
trace(_root.sm_usedtime);
_root.sm_timeleft = _root.slowmotion_time - _root.sm_usedtime;
_root.sm_percent = Math.floor((_root.sm_timeleft / _root.slowmotion_time) * 100);
trace(_root.sm_percent);
_root.sm.gotoAndStop(_root.sm_percent);
if (_root.sm_timeleft <= 0) {
_root.sm_enabled = false;
}
}
if (_root.sm_enabled == false) {
_root.slowmotion = 1;
trace("slowmotion: " + _root.slowmotion);
}
}
this._alpha = 50;
if (!Key.isDown(32)) {
space_up = false;
}
if (Key.isDown(32)) {
if (space_up != true) {
this._alpha = 100;
var i = 1;
while (i <= _root.balls_blue) {
if (com.gskinner.sprites.CollisionDetection.checkForCollision(this, eval ("_root.ball_blue" + i), 255)) {
trace("_root.ball_blue" + i);
if (color_var == "blue") {
multiplier = multiplier + 1;
_root.attachMovie("blue_flash", "blue_flash" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:eval (("_root.ball_blue" + i) + "._x"), _y:eval (("_root.ball_blue" + i) + "._y")});
removeMovieClip(eval ("_root.ball_blue" + i));
_root.blue_onscreen = _root.blue_onscreen - 1;
changecolor_need = true;
} else {
var ball_lost = true;
}
}
i++;
}
var i = 1;
while (i <= _root.balls_green) {
if (com.gskinner.sprites.CollisionDetection.checkForCollision(this, eval ("_root.ball_green" + i), 255)) {
trace("_root.ball_green" + i);
if (color_var == "green") {
multiplier = multiplier + 1;
_root.attachMovie("green_flash", "green_flash" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:eval (("_root.ball_green" + i) + "._x"), _y:eval (("_root.ball_green" + i) + "._y")});
removeMovieClip(eval ("_root.ball_green" + i));
_root.green_onscreen = _root.green_onscreen - 1;
changecolor_need = true;
} else {
var ball_lost = true;
}
}
i++;
}
var i = 1;
while (i <= _root.balls_red) {
if (com.gskinner.sprites.CollisionDetection.checkForCollision(this, eval ("_root.ball_red" + i), 255)) {
trace("_root.ball_red" + i);
if (color_var == "red") {
multiplier = multiplier + 1;
_root.attachMovie("red_flash", "red_flash" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:eval (("_root.ball_red" + i) + "._x"), _y:eval (("_root.ball_red" + i) + "._y")});
removeMovieClip(eval ("_root.ball_red" + i));
_root.red_onscreen = _root.red_onscreen - 1;
changecolor_need = true;
} else {
var ball_lost = true;
}
}
i++;
}
if (ball_lost == true) {
var bum = new Sound();
bum.attachSound("bum");
bum.start(0.0261);
trace("ball_lost");
this.gotoAndPlay(this._currentframe + 1);
_root.life = _root.life - 1;
_root.life_tx.text = _root.life;
var space_up = true;
if (_root.life == 0) {
_root.gotoAndStop("game_over");
}
}
}
}
if (changecolor_need == true) {
changecolor_var();
changecolor_need = false;
}
_root.score = _root.score + multiplier;
_root.score_tx.text = _root.score;
xspeed = (_root._xmouse - this._x) / 15;
yspeed = (_root._ymouse - this._y) / 15;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
_root.sm_time = getTimer();
}
Frame 172
final_score_tx.text = score;
var i = 1;
while (i <= _root.level) {
removeMovieClip(eval ("ball_blue" + i));
removeMovieClip(eval ("ball_green" + i));
removeMovieClip(eval ("ball_red" + i));
i++;
}
Instance of Symbol 84 MovieClip in Frame 172
on (release) {
mochi.MochiScores.showLeaderboard({boardID:"8f5e793e6956aa22", score:_root.score, onClose:function () {
_root.gotoAndStop("menu");
}});
}
Instance of Symbol 86 MovieClip in Frame 172
on (release) {
_root.score = 0;
_root.gotoAndStop("menu");
}
Instance of Symbol 42 MovieClip in Frame 172
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (releaseOutside) {
this.gotoAndStop(1);
}
on (release) {
getURL ("http://secure-us.imrworldwide.com/cgi-bin/b?cg=ugoplayer_flash_games&ci=us-ugclicks&tu=http://www.ugoplayer.com", "_blank");
}
Instance of Symbol 89 MovieClip in Frame 173
on (release) {
_root.gotoAndStop("menu");
}
Symbol 4 MovieClip [ball_red] Frame 1
stop();
if (_root.balls_quality == "low") {
gotoAndStop (2);
}
Symbol 5 MovieClip [red_flash] Frame 20
removeMovieClip(this);
Symbol 8 MovieClip [ball_green] Frame 1
stop();
if (_root.balls_quality == "low") {
gotoAndStop (2);
}
Symbol 9 MovieClip [green_flash] Frame 20
removeMovieClip(this);
Symbol 12 MovieClip [ball_blue] Frame 1
stop();
if (_root.balls_quality == "low") {
gotoAndStop (2);
}
Symbol 13 MovieClip [blue_flash] Frame 20
removeMovieClip(this);
Symbol 90 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 91 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 92 MovieClip [__Packages.com.gskinner.sprites.CollisionDetection] Frame 0
class com.gskinner.sprites.CollisionDetection
{
function CollisionDetection () {
}
static function checkForCollision(p_clip1, p_clip2, p_alphaTolerance) {
if (p_alphaTolerance == undefined) {
p_alphaTolerance = 255;
}
var _local4 = p_clip1.getBounds(_root);
var _local3 = p_clip2.getBounds(_root);
if (((_local4.xMax < _local3.xMin) || (_local3.xMax < _local4.xMin)) || ((_local4.yMax < _local3.yMin) || (_local3.yMax < _local4.yMin))) {
return(null);
}
var _local2 = {};
_local2.xMin = Math.max(_local4.xMin, _local3.xMin);
_local2.xMax = Math.min(_local4.xMax, _local3.xMax);
_local2.yMin = Math.max(_local4.yMin, _local3.yMin);
_local2.yMax = Math.min(_local4.yMax, _local3.yMax);
var _local7 = new flash.display.BitmapData(_local2.xMax - _local2.xMin, _local2.yMax - _local2.yMin, false);
var _local5 = p_clip1.transform.concatenatedMatrix;
_local5.tx = _local5.tx - _local2.xMin;
_local5.ty = _local5.ty - _local2.yMin;
_local7.draw(p_clip1, _local5, new flash.geom.ColorTransform(1, 1, 1, 1, 255, -255, -255, p_alphaTolerance));
_local5 = p_clip2.transform.concatenatedMatrix;
_local5.tx = _local5.tx - _local2.xMin;
_local5.ty = _local5.ty - _local2.yMin;
_local7.draw(p_clip2, _local5, new flash.geom.ColorTransform(1, 1, 1, 1, 255, 255, 255, p_alphaTolerance), "difference");
var _local6 = _local7.getColorBoundsRect(4294967295, 4278255615);
if (_local6.width == 0) {
return(null);
}
_local6.x = _local6.x + _local2.xMin;
_local6.y = _local6.y + _local2.yMin;
return(_local6);
}
}
Symbol 22 Button
on (release) {
getURL ("http://secure-us.imrworldwide.com/cgi-bin/b?cg=ugoplayer_flash_games&ci=us-ugclicks&tu=http://www.ugoplayer.com", "_blank");
}
Symbol 31 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 1
stop();
Symbol 39 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 1
stop();
Symbol 71 MovieClip Frame 1
stop();
Symbol 71 MovieClip Frame 16
gotoAndStop ("blue");
Symbol 71 MovieClip Frame 32
gotoAndStop ("green");
Symbol 71 MovieClip Frame 47
gotoAndStop ("red");
Symbol 76 MovieClip Frame 1
stop();