Frame 1
function onResize() {
Resized();
}
function Resized() {
bg._y = Stage.height - 25;
}
_lockroot = true;
Stage.align = "TL";
Stage.scaleMode = "noScale";
Stage.addListener(this);
Resized();
txtLog._visible = false;
function onEnterFrame() {
bg.loadProgress.tick(_root.getBytesLoaded() / _root.getBytesTotal());
if ((_root._framesloaded >= 2) && (_root.getBytesLoaded() > 0)) {
delete onEnterFrame;
gotoAndStop (2);
}
}
stop();
Frame 2
stop();
createEmptyMovieClip("game", 0);
var lv = new LoadVars();
lv.onLoad = function (success) {
var _local3 = this.w1;
var _local5 = this.w2;
if (success) {
if (this.result) {
_root.bg.loadProgress.txtStatus.text = "error code:" + this.result;
} else {
d = _local3.substr(7);
var _local4 = d.split("/");
d = _local4[0];
System.security.allowInsecureDomain(d);
_mcLoader.loadClip(((((_local3 + "&wcc=") + escape(_local5)) + "&gid=16&rid=") + _root.rid) + (_root.debug ? ("&debug=" + _root.debug) : ""), _root.game);
}
} else {
_root.bg.loadProgress.txtStatus.text = "Unable to load game. Please notify www.casualcollective.com.";
txtLog._visible = true;
}
};
var sv = new LoadVars();
sv.url = _root._url;
sv.gid = 16;
sv.ref = "kong";
sv.v = 5;
sv.sendAndLoad("http://widget.casualcollective.com/load?r=" + random(1000000), lv, "POST");
var _mcLoader = new MovieClipLoader();
var _listener = new Object();
_mcLoader.addListener(_listener);
_listener.onLoadProgress = function (target, bytesLoaded, bytesTotal) {
};
_listener.onLoadInit = function (target) {
_root.bg._visible = false;
};
_listener.onLoadError = function (target, errorCode, httpStatus) {
_root.bg.loadProgress.txtStatus.text = "Error:" + errorCode;
};
function APIInit() {
if (_root.kongregateServices) {
_root.kongregateServices.connect();
}
return("kong");
}
function APISaveScore(score, group) {
if (_root.kongregateScores) {
_root.kongregateScores.submit(score);
}
return(undefined);
}
function APISaveStat(n, v) {
_root.kongregateStats.submit(n, int(v));
}
function APIGetUserItemList(cb) {
_apiCallback = cb;
if (_root.kongregateMtx) {
return(kongGetUserItemList());
}
if (_global.MindJoltAPI) {
return(mindjoltGetUserItemList());
}
}
function APIGetBalance(cb) {
if (_global.MindJoltAPI) {
cb(_global.MindJoltAPI.service.checkBalance());
}
}
function APIPurchaseItem(id, cb) {
_apiCallback = cb;
if (_root.kongregateMtx) {
kongPurchaseItem(id);
}
if (_global.MindJoltAPI) {
mindjoltPurchaseItem(id);
}
}
function mindjoltGetUserItemList() {
var _local2 = _global.MindJoltAPI.service.getItems();
for (var _local3 in _local2) {
trace(((("itemId [" + _local3) + "] numberOwned [") + _local2[_local3]) + "]");
}
var _local4 = {};
_apiCallback(_local4);
}
function mindjoltPurchaseItem(id) {
}
function kongPurchaseItem(id) {
_root.kongregate.mtx.purchaseItems([id], onKongItemPurchaseResult);
}
function onKongItemPurchaseResult(o) {
if (o.success) {
_apiCallback({error:0});
} else {
_apiCallback({error:o.error});
}
}
function kongGetUserItemList() {
_root.kongregateMtx.requestUserItemList(null, onKongUserItems);
}
function onKongUserItems(o) {
trace("User item list received, success: " + o.success);
if (o.success) {
var _local4 = {error:0};
var _local1 = 0;
while (_local1 < o.data.length) {
var _local2 = o.data[_local1];
trace(((((((_local1 + 1) + ". ") + _local2.identifier) + ", ") + _local2.id) + ",") + _local2.data);
_local1++;
}
} else {
var _local4 = {error:"error retrieving user items list"};
}
_apiCallback(_local4);
}
function GetSharedObject(n) {
return(SharedObject.getLocal(n));
}
var _apiCallback;
Symbol 7 MovieClip Frame 1
function tick(n) {
mcBar._width = n * 200;
txtStatus.text = ("Loading: " + int(n * 100)) + "%";
}
function Go() {
_visible = false;
}
var _speed = 0;