Frame 1
_root.kongregateServices.connect();
function preloadSite() {
var _local3 = _root.getBytesLoaded();
var _local2 = _root.getBytesTotal();
var _local4 = Math.round((_local3 / _local2) * 100);
loadingBar._xscale = _local4;
percentClip.percentDisplay.text = _local4 + "%";
percentClip._x = loadingBar._x + loadingBar._width;
bytesDisplay.text = ((("loaded " + _local3) + " of ") + _local2) + " bytes";
if (_local3 >= _local2) {
c++;
if (c > 20) {
clearInterval(loadingCall);
gotoAndPlay(_root._currentframe + 1);
}
}
}
stop();
c = 0;
loadingBar._xscale = 1;
var loadingCall = setInterval(preloadSite, 50);
mochi.MochiServices.connect("f20daa53b7c7bab4");
Frame 2
stop();
Instance of Symbol 88 MovieClip in Frame 2
on (release) {
getURL ("http://www.kongregate.com/?gamereferral=Fling", "_blank");
}
Frame 3
stop();
Frame 4
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__("344a8b0b", this, 10301, true);
Frame 5
stop();
this.onEnterFrame = function () {
var _local2 = 100;
var _local3 = random(_local2);
if (_local3 == 2) {
_root.attachMovie("bird", "birdy", _root.getNextHighestDepth(), {_x:random(500) + 20, _y:30});
}
};
Frame 6
stop();
function place_line() {
y = 0;
while (y < 9) {
tiles_placed++;
if (field[0][y] != 0) {
push_blocks(y);
}
tile = attachMovie("tile", "tile_" + tiles_placed, _root.getNextHighestDepth(), {_x:550, _y:315 - (10 + (32 * y))});
num = Math.floor(Math.random() * numBlocks) + 1;
tile.gotoAndStop(num);
field[0][y] = tiles_placed;
y++;
}
}
function push_blocks(row_number) {
i = 8;
while (i >= 0) {
if (field[i][row_number] != 0) {
if (i != 8) {
field[i + 1][row_number] = field[i][row_number];
_root["tile_" + field[i][row_number]]._x = _root["tile_" + field[i][row_number]]._x - 32;
} else {
_root["tile_" + field[i][row_number]].removeMovieClip();
gameOver();
}
}
i--;
}
}
function update_field() {
i = 0;
while (i < 9) {
j = 0;
while (j < 9) {
if (_root["tile_" + field[i][j]]._x < 275) {
gameOver();
}
if (_root["tile_" + field[i][j]]._y > 310) {
_root["tile_" + field[i][j]].die();
field[i][j] = 0;
}
if ((field[i][j] != 0) and (field[i][j - 1] == 0)) {
falling = j - 1;
while ((field[i][falling] == 0) and (falling >= 0)) {
field[i][falling] = field[i][falling + 1];
_root["tile_" + field[i][falling + 1]]._y = _root["tile_" + field[i][falling + 1]]._y + 32;
field[i][falling + 1] = 0;
falling--;
}
}
j++;
}
i++;
}
}
function checkHits() {
j = 0;
while (j < 9) {
k = 0;
while (k < 9) {
if (_root["th_" + throws].hitTest(_root["tile_" + field[j][k]]._x, _root["tile_" + field[j][k]]._y)) {
_root["tile_" + field[j][k]]._x;
_root["tile_" + field[j][k]]._y;
color = _root["tile_" + field[j][k]]._currentframe;
if (_root["th_" + throws]._currentframe == color) {
_root["th_" + throws].die();
sound = new Sound(this);
sound.attachSound("d1");
sound.setVolume(70);
sound.start(0, 1);
bonuscount++;
bonustext = (("" + bonuscount) + " of ") + bmax;
checkOtherHits(j, k);
} else if (_root["th_" + throws]._currentframe == 6) {
_root["th_" + throws].die();
sound = new Sound(this);
sound.attachSound("d1");
sound.setVolume(70);
sound.start(0, 1);
checkOtherHits(j, k);
} else if (_root["th_" + throws]._currentframe == 7) {
sound = new Sound(this);
sound.attachSound("d1");
sound.setVolume(70);
sound.start(0, 1);
checkOtherHits(j, k);
} else {
_root["th_" + throws].die();
sound = new Sound(this);
sound.attachSound("d2");
sound.setVolume(70);
sound.start(0, 1);
bonuscount = 0;
bonustext = (("" + bonuscount) + " of ") + bmax;
}
update_field();
checkColors();
if ((removed * (10 * (removed / 2))) > 0) {
_root.attachMovie("score", "score" + Math.random(), _root.getNextHighestDepth(), {_x:140, _y:220, point:removed * (10 * (removed / 2))});
}
interval = interval + (20 * removed);
removed = 0;
}
k++;
}
j++;
}
}
function checkOtherHits(tx, ty, ori) {
color = _root["tile_" + field[tx][ty]]._currentframe;
if (!ori) {
_root["tile_" + field[tx][ty]].die();
field[tx][ty] = 0;
removed++;
clearedstuff++;
hits++;
}
if ((field[tx + 1][ty] != 0) and (_root["tile_" + field[tx + 1][ty]]._currentframe == color)) {
checkOtherHits(tx + 1, ty);
}
if ((field[tx - 1][ty] != 0) and (_root["tile_" + field[tx - 1][ty]]._currentframe == color)) {
checkOtherHits(tx - 1, ty);
}
if ((field[tx][ty - 1] != 0) and (_root["tile_" + field[tx][ty - 1]]._currentframe == color)) {
checkOtherHits(tx, ty - 1);
}
if ((field[tx][ty + 1] != 0) and (_root["tile_" + field[tx][ty + 1]]._currentframe == color)) {
checkOtherHits(tx, ty + 1);
}
}
function dropThrower() {
if (!gameover) {
var _local2 = random(numBlocks) + 1;
if (nextColor > 0) {
_local2 = nextColor;
}
if (bonus) {
_local2 = 6;
bonus = false;
bonuscount--;
}
temp = _root.attachMovie("tile_throw", "th_" + throws, _root.getNextHighestDepth(), {_x:130, _y:-10});
temp.gotoAndStop(_local2);
}
}
function winlevel() {
level++;
_root.attachMovie("wavedone", "wavedone", _root.getNextHighestDepth(), {_x:275, _y:130});
if ((level % 6) == 0) {
numBlocks++;
maxtime = maxtime + 120;
} else {
maxtimer = maxtimer - 50;
}
cleared = false;
clearedstuff = 0;
interval = maxtimer;
tiles_placed = 0;
place_line();
place_line();
if (level > 3) {
place_line();
}
_root.kongregateStats.submit("HighestLevel", _root.level);
_root.kongregateStats.submit("TotalSmashes", _root.hits);
_root.kongregateStats.submit("Highscore", _root.money);
}
function checkClear() {
if (clearedstuff >= tiles_placed) {
cleared = true;
} else {
cleared = false;
}
}
function randombird() {
if (!gameover) {
var _local2 = 250;
var _local3 = random(_local2);
if (_local3 == 2) {
_root.attachMovie("bird", "birdy", _root.getNextHighestDepth(), {_x:random(500) + 20, _y:30});
}
}
}
function gameOver() {
gameover = true;
gotoAndStop (7);
}
function checkColors() {
c = 0;
j = 0;
while (j < 9) {
k = 0;
while (k < 9) {
if (_root["tile_" + field[j][k]]._currentframe != undefined) {
c++;
nextColor = _root["tile_" + field[j][k]]._currentframe;
}
k++;
}
j++;
}
if (c > 2) {
trace("a lot of blocks left!");
nextColor = 0;
} else {
trace("-----");
trace(nextColor);
}
}
hits = 0;
nextColor = 0;
field = Array();
level = 1;
meter = 0;
bmax = 4;
bonuscount = 0;
bonustext = "0 of 4";
numBlocks = 2;
maxtimer = 350;
score = 0;
combo = 5;
removed = 0;
cleared = false;
bonus = false;
clearedstuff = 0;
money = 0;
interval = maxtimer;
tiles_placed = 0;
minspeed = 1;
x = 0;
while (x < 9) {
field[x] = Array();
y = 0;
while (y < 9) {
field[x][y] = 0;
y++;
}
x++;
}
place_line();
xmove = 0;
ymove = 0;
grav = 0.5;
restitution = 0.6;
friction = 0.9;
throws = 0;
gameover = false;
_root.createEmptyMovieClip("scorebar", _root.getNextHighestDepth());
scorebar.lineStyle(10, 16763904, 100);
scorebar.moveTo(20, 360);
_root.attachMovie("rest", "rest", _root.getNextHighestDepth(), {_x:140, _y:280});
dropThrower();
_root.onEnterFrame = function () {
if (!gameover) {
randombird();
interval = interval - minspeed;
if (interval == 0) {
interval = maxtimer + 50;
place_line();
}
checkClear();
if (cleared) {
winlevel();
}
if (bonuscount >= bmax) {
bonuscount = 0;
bonus = true;
_root.attachMovie("bonus", "b", _root.getNextHighestDepth(), {_x:300, _y:130});
}
}
};
Frame 7
Symbol 5 MovieClip [bonus] Frame 40
this.removeMovieClip();
Symbol 8 MovieClip [wavedone] Frame 46
this.removeMovieClip();
Symbol 11 MovieClip [score] Frame 1
speed = random(4) + 5;
sub = 2;
_root.score = _root.score + point;
this.onEnterFrame = function () {
user_x = 30;
user_y = 60;
rotation = Math.atan2(this._y - user_y, this._x - user_x);
pos_x = Math.cos(rotation);
pos_y = Math.sin(rotation);
this._x = this._x - (speed * pos_x);
this._y = this._y - (speed * pos_y);
if ((this._x <= 30) && (this._y <= 60)) {
_root.money = _root.money + point;
this.removeMovieClip();
}
};
Symbol 28 MovieClip [tile_throw] Frame 1
function die() {
x = 0;
while (x < 12) {
var _local3 = random(5) + 1;
temp = _root.attachMovie("hit", "h_" + x, _root.getNextHighestDepth(), {_x:(this._x + (Math.random() * 40)) - 20, _y:(this._y + (Math.random() * 40)) - 20});
temp.speed = random(5) + 1;
temp.gotoAndStop(_local3);
x++;
}
_root.throws++;
_root.dropThrower();
this.removeMovieClip();
}
velx = 0;
vely = 0;
rot = 0;
dragging = false;
hitground = false;
justfell = true;
totalx = 0;
startx = 0;
starty = 0;
endy = 0;
endx = 0;
power = 10;
counter = 0;
aliveTime = 1400;
this.onEnterFrame = function () {
counter++;
if (counter > aliveTime) {
_root.drawline.removeMovieClip();
die();
}
if (dragging) {
if (justfell) {
justfell = false;
}
startx = _root.drawline.sx;
starty = _root.drawline.sy;
endx = _root._xmouse;
endy = _root._ymouse;
myRadians = Math.atan2(endy - starty, endx - startx);
myDegrees = Math.round((myRadians * 180) / Math.PI);
this._rotation = myDegrees + 90;
var _local4 = endx - startx;
var _local3 = endy - starty;
var _local6 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
_local6 = _local6 / 4.5;
power = _local6;
if (power > 30) {
power = 30;
}
}
if (!dragging) {
vely = vely + _root.grav;
this._x = this._x + velx;
this._y = this._y + vely;
if (!hitground) {
this._rotation = this._rotation + rot;
}
} else {
trace(power);
velx = (-Math.sin(this._rotation * (Math.PI/180))) * power;
vely = Math.cos(this._rotation * (Math.PI/180)) * power;
rot = ((velx / 6) * random(4)) + 1;
}
if (justfell) {
var _local5 = 200;
if ((this._y + 30) > _local5) {
this._y = _local5 - 30;
this._y = _local5 - 30;
vely = vely * (-_root.restitution);
velx = velx * _root.friction;
resting = true;
}
} else {
var _local5 = 337;
if ((this._y + 30) > _local5) {
this._y = _local5 - 30;
vely = vely * (-_root.restitution);
velx = velx * _root.friction;
hitground = true;
}
}
if (this._x < (this._height / 2)) {
hitground = true;
this._x = this._height / 2;
velx = velx * (-_root.restitution);
}
if ((this._x + (this._width / 2)) > 600) {
this.die();
}
if (resting) {
}
_root.checkHits();
};
this.onPress = function () {
temp = _root.createEmptyMovieClip("drawline", _root.getNextHighestDepth());
temp.lineStyle(2, 0, 100);
temp.sx = _root._xmouse;
temp.sy = _root._ymouse;
temp.moveTo(temp.sx, temp.sy);
temp.onEnterFrame = function () {
this.clear();
this.lineStyle(2, 0, 100);
this.moveTo(this.sx, this.sy);
this.lineTo(_root._xmouse, _root._ymouse);
};
temp2 = _root.attachMovie("arch", "arch", _root.getNextHighestDepth(), {_x:_root._xmouse, _y:_root._ymouse});
temp2.onEnterFrame = function () {
var _local3 = _root["th_" + _root.throws]._rotation;
if (_root._xmouse > 0) {
this._yscale = Math.abs(this._x - _root._xmouse);
this._xscale = Math.abs(this._x - _root._xmouse);
this._rotation = _local3;
} else {
this._yscale = Math.abs(this._x - 0);
this._xscale = Math.abs(this._x - 0);
this._rotation = _local3;
}
};
dragging = true;
};
this.onRelease = function () {
hitground = false;
dragging = false;
_root.arch.removeMovieClip();
_root.drawline.removeMovieClip();
};
this.onReleaseOutside = function () {
hitground = false;
dragging = false;
_root.arch.removeMovieClip();
_root.drawline.removeMovieClip();
};
stop();
Symbol 28 MovieClip [tile_throw] Frame 2
stop();
Symbol 28 MovieClip [tile_throw] Frame 3
stop();
Symbol 28 MovieClip [tile_throw] Frame 4
stop();
Symbol 28 MovieClip [tile_throw] Frame 5
stop();
Symbol 28 MovieClip [tile_throw] Frame 6
stop();
Symbol 28 MovieClip [tile_throw] Frame 7
stop();
Symbol 34 MovieClip [hit] Frame 1
movex = (Math.random() * 16) - 8;
movey = (Math.random() * 16) - 8;
counter = 100;
this.onEnterFrame = function () {
this._x = this._x + movex;
this._y = this._y + movey;
counter = counter - speed;
this._alpha = this._alpha - speed;
if (counter <= 0) {
this.removeMovieClip();
}
};
stop();
Symbol 34 MovieClip [hit] Frame 2
stop();
Symbol 34 MovieClip [hit] Frame 3
stop();
Symbol 34 MovieClip [hit] Frame 4
stop();
Symbol 34 MovieClip [hit] Frame 5
stop();
Symbol 35 MovieClip [tile_dead] Frame 1
vx = random(15) + 8;
vy = (Math.random() * 20) - 10;
rot = (Math.random() * 10) - 5;
this.onEnterFrame = function () {
this._x = this._x + vx;
this._y = this._y + vy;
this._rotation = this._rotation + rot;
if (this._x > 700) {
this.removeMovieClip();
}
};
stop();
Symbol 35 MovieClip [tile_dead] Frame 2
stop();
Symbol 35 MovieClip [tile_dead] Frame 3
stop();
Symbol 35 MovieClip [tile_dead] Frame 4
stop();
Symbol 35 MovieClip [tile_dead] Frame 5
stop();
Symbol 36 MovieClip [tile] Frame 1
function die() {
x = 0;
while (x < 5) {
temp = _root.attachMovie("hit", "h_" + x, _root.getNextHighestDepth(), {_x:(this._x + (Math.random() * 40)) - 20, _y:(this._y + (Math.random() * 40)) - 20});
temp.speed = random(5) + 1;
temp.gotoAndStop(this._currentframe);
x++;
}
temp = _root.attachMovie("tile_dead", "td_", _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
temp.gotoAndStop(this._currentframe);
this.removeMovieClip();
}
stop();
Symbol 36 MovieClip [tile] Frame 2
stop();
Symbol 36 MovieClip [tile] Frame 3
stop();
Symbol 36 MovieClip [tile] Frame 4
stop();
Symbol 36 MovieClip [tile] Frame 5
stop();
Symbol 38 MovieClip [bird] Frame 1
function die() {
this._width = this._width - 2;
this._height--;
if (this._width <= 4) {
this.removeMovieClip();
}
}
this._width = random(30) + 10;
this._height = this._width / 2;
movex = 0;
movey = 0;
posx = 0;
posy = 0;
c = 0;
power = 3;
movetime = 30;
leavetime = 140 + random(200);
this.onEnterFrame = function () {
c++;
var _local3 = Math.atan2(movey - this._y, movex - this._x);
var _local4 = Math.round((_local3 * 180) / Math.PI);
var _local2 = _local4 + 90;
if ((Math.abs(this._x - movex) > 1) && (Math.abs(this._y - movey) > 1)) {
this._x = this._x + (power * Math.sin(_local2 * (Math.PI/180)));
this._y = this._y - (power * Math.cos(_local2 * (Math.PI/180)));
}
if ((c % movetime) == 0) {
movey = movey + ((Math.random() * 400) - 200);
movex = movex + ((Math.random() * 400) - 200);
movetime = random(60) + 30;
power = random(2) + 1;
}
if (c > leavetime) {
die();
}
if (movey > 100) {
movey = 100;
}
if (movey < 0) {
movey = 0;
}
if (movex > 550) {
movex = 550;
}
if (movex < 0) {
movex = 0;
}
};
Symbol 48 MovieClip [bar] Frame 1
tot_frames = this._totalFrames;
this.onEnterFrame = function () {
bar_d = Math.round((_root.maxtimer - _root.interval) / (_root.maxtimer / tot_frames));
if (bar_d != this._currentFrame) {
if (bar_d > this._currentFrame) {
this.gotoAndStop(this._currentFrame + 1);
} else {
this.gotoAndStop(this._currentFrame - 1);
}
}
};
stop();
Symbol 139 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.2");
}
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 140 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.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 59 Button
on (release) {
getURL ("http://www.kongregate.com/?gamereferral=Fling", "_blank");
}
Symbol 60 Button
on (release) {
getURL ("http://www.kongregate.com/?gamereferral=MovementMayhem", "_blank");
}
Symbol 79 Button
on (release) {
getURL ("http://kongregate.com/", "_blank");
}
Instance of Symbol 57 MovieClip in Symbol 88 MovieClip Frame 1
on (release) {
getURL ("http://www.kongregate.com/?gamereferral=Fling", "_blank");
}
Symbol 88 MovieClip Frame 180
_root.gotoAndStop(_root._currentframe + 1);
Symbol 98 MovieClip Frame 130
_root.gotoAndPlay(_root._currentframe + 1);
Symbol 108 Button
on (release) {
gotoAndStop(_root._currentframe + 1);
}
Symbol 116 Button
on (release) {
this.gotoAndStop(2);
}
Symbol 119 Button
on (release) {
this.gotoAndStop(1);
}
Symbol 122 MovieClip Frame 1
stop();
Symbol 122 MovieClip Frame 2
stop();
Symbol 124 Button
on (release) {
getURL ("http://www.kongregate.com/?gamereferral=Fling", "_blank");
}
Symbol 138 Button
on (release) {
getURL ("http://www.kongregate.com/?gamereferral=Fling", "_blank");
}