Combined Code
movieClip 6 {
}
movieClip 7 {
}
// unknown tag 88 length 96
// unknown tag 88 length 96
movieClip 15 {
}
movieClip 18 {
}
movieClip 21 {
}
// unknown tag 88 length 96
// unknown tag 88 length 96
movieClip 28 {
}
// unknown tag 88 length 96
movieClip 30 {
}
movieClip 31 {
}
movieClip 33 {
}
movieClip 36 {
}
// unknown tag 88 length 96
// unknown tag 88 length 493
// unknown tag 88 length 493
movieClip 42 {
}
movieClip 44 {
}
movieClip 45 ZattikkaHiScores {
#initclip
Object.registerClass('ZattikkaHiScores', ZattikkaHiScores);
#endinitclip
}
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;
var pv;
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);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&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);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
__com_mochibot__('c348fdb1', this, 10301, true);
}
frame 1 {
function gotoplay() {
gotoAndStop(4);
}
if (yraGarsas == undefined) {
yraGarsas = true;
}
Stage.scaleMode = 'noScale';
stop();
onEnterFrame = function () {
total_bytes = getBytesTotal();
loaded_bytes = getBytesLoaded();
remaining_bytes = total_bytes - loaded_bytes;
percent_done = int((loaded_bytes / total_bytes) * 100);
t = percent_done.toString();
te = t + '% loaded';
bar.gotoAndStop(percent_done);
if (total_bytes == loaded_bytes) {
delete onEnterFrame;
gotoAndStop(2);
}
};
}
movieClip 56 {
frame 1 {
stop();
}
}
// unknown tag 88 length 96
movieClip 348 __Packages.mochi.as2.MochiEventDispatcher {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiEventDispatcher) {
var v1 = function () {
this.eventTable = {};
};
mochi.as2.MochiEventDispatcher = v1;
var v2 = v1.prototype;
v2.buildDelegate = function (thisObject, thatObject) {
var v2 = {'thisObject': thisObject, 'thatObject': thatObject};
if (thatObject != undefined) {
var funct = (typeof thatObject == 'string') ? thisObject[thatObject] : thatObject;
v2.delegate = function (args) {
funct.call(thisObject, args);
};
return v2;
}
v2.delegate = thisObject;
return v2;
};
v2.compareDelegate = function (d_A, d_B) {
if (d_A.thisObject != d_B.thisObject || d_A.thatObject != d_B.thatObject) {
return false;
}
return true;
};
v2.addEventListener = function (event, thisObject, thatObject) {
this.removeEventListener(event, thisObject, thatObject);
this.eventTable[event].push(this.buildDelegate(thisObject, thatObject));
};
v2.removeEventListener = function (event, thisObject, thatObject) {
var v3 = this.buildDelegate(thisObject, thatObject);
if (this.eventTable[event] == undefined) {
this.eventTable[event] = [];
return undefined;
}
for (var v4 in this.eventTable[event]) {
if (!this.compareDelegate(this.eventTable[event][v4], v3)) {
continue;
}
this.eventTable[event].splice(Number(v4), 1);
}
};
v2.triggerEvent = function (event, args) {
if (this.eventTable[event] == undefined) {
return undefined;
}
for (var v4 in this.eventTable[event]) {
this.eventTable[event][v4].delegate(args);
}
};
ASSetPropFlags(mochi.as2.MochiEventDispatcher.prototype, null, 1);
}
#endinitclip
}
movieClip 349 __Packages.mochi.as2.MochiEvents {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiEvents) {
var v1 = function () {};
mochi.as2.MochiEvents = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return mochi.as2.MochiServices.getVersion();
};
v1.startSession = function (achievementID) {
mochi.as2.MochiServices.send('events_beginSession', {'achievementID': achievementID}, null, null);
};
v1.setNotifications = function (clip, style) {
var v2 = {};
for (var v3 in style) {
v2[v3] = style[v3];
}
v2.clip = clip;
mochi.as2.MochiServices.send('events_setNotifications', v2, null, null);
};
v1.addEventListener = function (eventType, thisObject, thatObject) {
mochi.as2.MochiEvents._dispatcher.addEventListener(eventType, thisObject, thatObject);
};
v1.triggerEvent = function (eventType, args) {
mochi.as2.MochiEvents._dispatcher.triggerEvent(eventType, args);
};
v1.removeEventListener = function (eventType, thisObject, thatObject) {
mochi.as2.MochiEvents._dispatcher.removeEventListener(eventType, thisObject, thatObject);
};
v1.startPlay = function (tag) {
if (tag == undefined) {
tag = 'gameplay';
}
mochi.as2.MochiServices.send('events_setRoundID', {'tag': String(tag)}, null, null);
};
v1.endPlay = function () {
mochi.as2.MochiServices.send('events_clearRoundID', null, null, null);
};
v1.trackEvent = function (tag, value) {
mochi.as2.MochiServices.send('events_trackEvent', {'tag': tag, 'value': value}, null, null);
};
v1.ACHIEVEMENT_RECEIVED = 'AchievementReceived';
v1.ALIGN_TOP_LEFT = 'ALIGN_TL';
v1.ALIGN_TOP = 'ALIGN_T';
v1.ALIGN_TOP_RIGHT = 'ALIGN_TR';
v1.ALIGN_LEFT = 'ALIGN_L';
v1.ALIGN_CENTER = 'ALIGN_C';
v1.ALIGN_RIGHT = 'ALIGN_R';
v1.ALIGN_BOTTOM_LEFT = 'ALIGN_BL';
v1.ALIGN_BOTTOM = 'ALIGN_B';
v1.ALIGN_BOTTOM_RIGHT = 'ALIGN_BR';
v1.FORMAT_SHORT = 'ShortForm';
v1.FORMAT_LONG = 'LongForm';
v1._dispatcher = new mochi.as2.MochiEventDispatcher();
ASSetPropFlags(mochi.as2.MochiEvents.prototype, null, 1);
}
#endinitclip
}
movieClip 350 __Packages.mochi.as2.MochiSync {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiSync) {
var v1 = function () {
this._syncContainer = {};
};
mochi.as2.MochiSync = v1;
var v2 = v1.prototype;
v2.getProp = function (name) {
return this._syncContainer[name];
};
v2.setProp = function (name, value) {
if (this._syncContainer[name] == value) {
return undefined;
}
this._syncContainer[name] = value;
mochi.as2.MochiServices.send('sync_propUpdate', {'name': name, 'value': value});
};
v2.triggerEvent = function (eventType, args) {
switch (eventType) {
case mochi.as2.MochiSync.SYNC_REQUEST:
mochi.as2.MochiServices.send('sync_syncronize', this._syncContainer);
break;
case mochi.as2.MochiSync.SYNC_PROPERTY:
this._syncContainer[args.name] = args.value;
}
};
v1.SYNC_REQUEST = 'SyncRequest';
v1.SYNC_PROPERTY = 'UpdateProperty';
ASSetPropFlags(mochi.as2.MochiSync.prototype, null, 1);
}
#endinitclip
}
movieClip 351 __Packages.mochi.as2.MochiServices {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiServices) {
var v1 = function () {};
mochi.as2.MochiServices = v1;
var v2 = v1.prototype;
v1.__get__id = function () {
return mochi.as2.MochiServices._id;
};
v1.__get__clip = function () {
return mochi.as2.MochiServices._container;
};
v1.__get__childClip = function () {
return mochi.as2.MochiServices._clip;
};
v1.getVersion = function () {
return '3.8 as2';
};
v1.allowDomains = function (server) {
var v1 = ((server.split('/'))[2].split(':'))[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain('*');
System.security.allowDomain(v1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain('*');
System.security.allowInsecureDomain(v1);
}
}
return v1;
};
v1.__get__isNetworkAvailable = function () {
if (System.security) {
var v1 = System.security;
if (v1.sandboxType == 'localWithFile') {
return false;
}
}
return true;
};
v1.__set__comChannelName = function (val) {
if (val != undefined) {
if (val.length > 3) {
mochi.as2.MochiServices._sendChannelName = val + '_fromgame';
mochi.as2.MochiServices.initComChannels();
}
}
return mochi.as2.MochiServices.__get__comChannelName();
};
v1.__get__connected = function () {
return mochi.as2.MochiServices._connected;
};
v1.connect = function (id, clip, onError) {
mochi.as2.MochiServices.warnID(id, false);
if (!mochi.as2.MochiServices._connected && mochi.as2.MochiServices._clip == undefined) {
trace('MochiServices Connecting...');
mochi.as2.MochiServices._connecting = true;
mochi.as2.MochiServices.init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else {
if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
};
v1.disconnect = function () {
if (mochi.as2.MochiServices._connected || mochi.as2.MochiServices._connecting) {
mochi.as2.MochiServices._connected = false;
mochi.as2.MochiServices._connecting = mochi.as2.MochiServices._connected;
mochi.as2.MochiServices.flush(true);
if (mochi.as2.MochiServices._clip != undefined) {
mochi.as2.MochiServices._clip.removeMovieClip();
delete mochi.as2.MochiServices._clip;
}
mochi.as2.MochiServices._listenChannel.close();
}
};
v1.init = function (id, clip) {
mochi.as2.MochiServices._id = id;
if (clip != undefined) {
mochi.as2.MochiServices._container = clip;
} else {
mochi.as2.MochiServices._container = _root;
}
mochi.as2.MochiServices.loadCommunicator(id, mochi.as2.MochiServices._container);
};
v1.loadCommunicator = function (id, clip) {
var v6 = '_mochiservices_com_' + id;
var v5 = new MovieClipLoader();
var v3 = {};
if (mochi.as2.MochiServices._clip != null) {
return mochi.as2.MochiServices._clip;
}
if (!mochi.as2.MochiServices.__get__isNetworkAvailable()) {
return null;
}
if ((mochi.as2.MochiServices.urlOptions()).servURL) {
mochi.as2.MochiServices._servURL = (mochi.as2.MochiServices.urlOptions()).servURL;
}
var v4 = mochi.as2.MochiServices._servURL + mochi.as2.MochiServices._services;
if ((mochi.as2.MochiServices.urlOptions()).servicesURL) {
v4 = (mochi.as2.MochiServices.urlOptions()).servicesURL;
}
mochi.as2.MochiServices.allowDomains(v4);
mochi.as2.MochiServices._clip = clip.createEmptyMovieClip(v6, 10336, false);
mochi.as2.MochiServices._listenChannelName += Math.floor((new Date()).getTime()) + '_' + Math.floor(Math.random() * 99999);
mochi.as2.MochiServices.listen();
if (v3.waitInterval != null) {
clearInterval(v3.waitInterval);
}
v3.onLoadError = mochi.as2.MochiServices.loadError;
v3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
v3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
v3.startTime = getTimer();
v3.wait = function () {
if (getTimer() - this.startTime > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ['IOError']);
}
clearInterval(this.waitInterval);
}
};
v3.waitInterval = setInterval(v3, 'wait', 1000);
v5.addListener(v3);
v5.loadClip(v4 + '?listenLC=' + mochi.as2.MochiServices._listenChannelName + '&mochiad_options=' + escape(_root.mochiad_options) + '&api_version=' + mochi.as2.MochiServices.getVersion(), mochi.as2.MochiServices._clip);
mochi.as2.MochiServices._sendChannel = new LocalConnection();
mochi.as2.MochiServices._sendChannel._queue = [];
return mochi.as2.MochiServices._clip;
};
v1.loadError = function (target_mc, errorCode, httpStatus) {
trace('MochiServices could not load.');
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, [errorCode]);
};
v1.onStatus = function (infoObject) {
if (infoObject.level !== 'error') {
} else {
mochi.as2.MochiServices._connected = false;
mochi.as2.MochiServices._listenChannel.connect(mochi.as2.MochiServices._listenChannelName);
}
};
v1.listen = function () {
mochi.as2.MochiServices._listenChannel = new LocalConnection();
mochi.as2.MochiServices._listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
mochi.as2.MochiServices._listenChannel.allowDomain = function (d) {
return true;
};
mochi.as2.MochiServices._listenChannel.allowInsecureDomain = mochi.as2.MochiServices._listenChannel.allowDomain;
mochi.as2.MochiServices._listenChannel._nextcallbackID = 0;
mochi.as2.MochiServices._listenChannel._callbacks = {};
mochi.as2.MochiServices._listenChannel.connect(mochi.as2.MochiServices._listenChannelName);
trace('Waiting for MochiAds services to connect...');
};
v1.initComChannels = function () {
if (!mochi.as2.MochiServices._connected) {
mochi.as2.MochiServices._sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', {'methodName': 'handshakeDone'});
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', {'methodName': 'registerGame', 'id': mochi.as2.MochiServices._id, 'version': mochi.as2.MochiServices.getVersion()});
mochi.as2.MochiServices._listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
mochi.as2.MochiServices._listenChannel.onReceive = function (pkg) {
var v5 = pkg.callbackID;
var v4 = this._callbacks[v5];
if (!v4) {
return undefined;
}
var v2 = v4.callbackMethod;
var v3 = v4.callbackObject;
if (v3 && typeof v2 == 'string') {
v2 = v3[v2];
}
if (v2 != undefined) {
v2.apply(v3, pkg.args);
}
delete this._callbacks[v5];
};
mochi.as2.MochiServices._listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case 'events':
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case 'coins':
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
case 'sync':
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
mochi.as2.MochiServices._listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ['IOError']);
};
trace('[SERVICES_API] connected!');
mochi.as2.MochiServices._connecting = false;
mochi.as2.MochiServices._connected = true;
while (mochi.as2.MochiServices._sendChannel._queue.length > 0) {
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', mochi.as2.MochiServices._sendChannel._queue.shift());
}
}
};
v1.updateCopy = function (args) {
mochi.as2.MochiServices.send('coins_updateCopy', args, null, null);
};
v1.flush = function (error) {
var v1;
var v2;
while (mochi.as2.MochiServices._sendChannel._queue.length > 0) {
v1 = mochi.as2.MochiServices._sendChannel._queue.shift();
false;
if (v1.callbackID != null) {
v2 = mochi.as2.MochiServices._listenChannel._callbacks[v1.callbackID];
}
delete mochi.as2.MochiServices._listenChannel._callbacks[v1.callbackID];
if (error) {
mochi.as2.MochiServices.handleError(v1.args, v2.callbackObject, v2.callbackMethod);
}
}
};
v1.handleError = function (args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ['NotConnected']);
}
if (args.options != null && args.options.onError != null) {
args.options.onError.apply(null, ['NotConnected']);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = 'NotConnected';
if (callbackObject != null && typeof callbackMethod == 'string') {
callbackObject[callbackMethod](args);
} else {
if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
};
v1.send = function (methodName, args, callbackObject, callbackMethod) {
if (mochi.as2.MochiServices._connected) {
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', {'methodName': methodName, 'args': args, 'callbackID': mochi.as2.MochiServices._listenChannel._nextcallbackID});
} else {
if (mochi.as2.MochiServices._clip == undefined || !mochi.as2.MochiServices._connecting) {
trace('Error: MochiServices not connected. Please call MochiServices.connect(). Function: ' + methodName);
mochi.as2.MochiServices.handleError(args, callbackObject, callbackMethod);
mochi.as2.MochiServices.flush(true);
return undefined;
} else {
mochi.as2.MochiServices._sendChannel._queue.push({'methodName': methodName, 'args': args, 'callbackID': mochi.as2.MochiServices._listenChannel._nextcallbackID});
}
}
mochi.as2.MochiServices._listenChannel._callbacks[mochi.as2.MochiServices._listenChannel._nextcallbackID] = {'callbackObject': callbackObject, 'callbackMethod': callbackMethod};
++mochi.as2.MochiServices._listenChannel._nextcallbackID;
};
v1.urlOptions = function () {
var v5 = {};
var v6;
if (_root._url.indexOf('mochiad_options') != -1) {
var v2 = _root._url.indexOf('mochiad_options') + 'mochiad_options'.length + 1;
v6 = _root._url.substr(v2, _root._url.length);
} else {
if (_root.mochiad_options) {
v6 = _root.mochiad_options;
}
}
if (v6) {
var v4 = _root.mochiad_options.split('&');
var v2 = 0;
while (v2 < v4.length) {
var v3 = v4[v2].split('=');
v5[unescape(v3[0])] = unescape(v3[1]);
++v2;
}
}
return v5;
};
v1.warnID = function (bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace('WARNING: ' + (leaderboard ? 'board' : 'game') + ' ID is not the appropriate length');
return undefined;
} else {
if (bid == '1e113c7239048b3f') {
if (leaderboard) {
trace('WARNING: Using testing board ID');
} else {
trace('WARNING: Using testing board ID as game ID');
}
return undefined;
} else {
if (bid == '84993a1de4031cd8') {
if (leaderboard) {
trace('WARNING: Using testing game ID as board ID');
} else {
trace('WARNING: Using testing game ID');
}
return undefined;
}
}
}
var v1 = 0;
while (v1 < bid.length) {
switch (bid.charAt(v1)) {
if (bid.charAt(v1) !== 'f') {
} else {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'a':
case 'b':
case 'c':
break;
case 'd':
case 'e':
}
default:
trace('WARNING: Board ID contains illegal characters: ' + bid);
return undefined;
}
++v1;
}
};
v1.addLinkEvent = function (url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var v2 = new Object();
v2.mav = mochi.as2.MochiServices.getVersion();
v2.swfv = btn.getSWFVersion() || 6;
v2.swfurl = btn._url;
v2.fv = System.capabilities.version;
v2.os = System.capabilities.os;
v2.lang = System.capabilities.language;
v2.scres = System.capabilities.screenResolutionX + 'x' + System.capabilities.screenResolutionY;
var s = '?';
var v3 = 0;
for (var v6 in v2) {
if (v3 != 0) {
s += '&';
}
++v3;
s = s + v6 + '=' + escape(v2[v6]);
}
if (!(mochi.as2.MochiServices.netupAttempted || mochi.as2.MochiServices._connected)) {
var ping = btn.createEmptyMovieClip('ping', 777);
var v7 = btn.createEmptyMovieClip('nettest', 778);
mochi.as2.MochiServices.netupAttempted = true;
ping.loadMovie('http://x.mochiads.com/linkping.swf?t=' + getTimer());
v7.onEnterFrame = function () {
if (ping._totalframes > 0 && ping._totalframes == ping._framesloaded) {
delete this.onEnterFrame;
} else {
if (getTimer() - t0 > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
}
};
}
var v4 = btn.createEmptyMovieClip('clk', 1001);
v4._alpha = 0;
v4.beginFill(1044735);
v4.moveTo(0, 0);
v4.lineTo(0, btn._height);
v4.lineTo(btn._width, btn._height);
v4.lineTo(btn._width, 0);
v4.lineTo(0, 0);
v4.endFill();
v4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL(url + s, '_blank');
} else {
getURL(burl, '_blank');
}
if (onClick != undefined) {
onClick();
}
};
};
v1.setContainer = function (clip) {};
v1.stayOnTop = function (clip) {};
v1._servURL = 'http://www.mochiads.com/static/lib/services/';
v1._services = 'services.swf';
v1._mochiLC = 'MochiLC.swf';
v1._listenChannelName = '__ms_';
v1._connecting = false;
v1._connected = false;
v1.netup = true;
v1.netupAttempted = false;
v1.servicesSync = new mochi.as2.MochiSync();
v1.addProperty('childClip', v1.__get__childClip, function () {});
v1.addProperty('clip', v1.__get__clip, function () {});
v1.addProperty('comChannelName', function () {}, v1.__set__comChannelName);
v1.addProperty('connected', v1.__get__connected, function () {});
v1.addProperty('id', v1.__get__id, function () {});
v1.addProperty('isNetworkAvailable', v1.__get__isNetworkAvailable, function () {});
ASSetPropFlags(mochi.as2.MochiServices.prototype, null, 1);
}
#endinitclip
}
movieClip 352 __Packages.mochi.as2.MochiSocial {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiSocial) {
var v1 = function () {};
mochi.as2.MochiSocial = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return mochi.as2.MochiServices.getVersion();
};
v1.showLoginWidget = function (options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send('coins_showLoginWidget', {'options': options});
};
v1.hideLoginWidget = function () {
mochi.as2.MochiServices.send('coins_hideLoginWidget');
};
v1.requestLogin = function () {
mochi.as2.MochiServices.send('coins_requestLogin');
};
v1.getUserInfo = function () {
mochi.as2.MochiServices.send('coins_getUserInfo');
};
v1.saveUserProperties = function (properties) {
mochi.as2.MochiServices.send('coins_saveUserProperties', properties);
};
v1.addEventListener = function (eventType, delegate) {
mochi.as2.MochiSocial._dispatcher.addEventListener(eventType, delegate);
};
v1.triggerEvent = function (eventType, args) {
mochi.as2.MochiSocial._dispatcher.triggerEvent(eventType, args);
};
v1.removeEventListener = function (eventType, delegate) {
mochi.as2.MochiSocial._dispatcher.removeEventListener(eventType, delegate);
};
v1.LOGGED_IN = 'LoggedIn';
v1.LOGGED_OUT = 'LoggedOut';
v1.LOGIN_SHOW = 'LoginShow';
v1.LOGIN_HIDE = 'LoginHide';
v1.LOGIN_SHOWN = 'LoginShown';
v1.PROFILE_SHOW = 'ProfileShow';
v1.PROFILE_HIDE = 'ProfileHide';
v1.PROPERTIES_SAVED = 'PropertySaved';
v1.WIDGET_LOADED = 'WidgetLoaded';
v1.USER_INFO = 'UserInfo';
v1.ERROR = 'Error';
v1.IO_ERROR = 'IOError';
v1.NO_USER = 'NoUser';
v1.PROPERTIES_SIZE = 'PropertiesSize';
v1._dispatcher = new mochi.as2.MochiEventDispatcher();
ASSetPropFlags(mochi.as2.MochiSocial.prototype, null, 1);
}
#endinitclip
}
movieClip 1 __Packages.mx.core.UIObject {
#initclip
if (!_global.mx) {
_global.mx = new Object();
}
if (!_global.mx.core) {
_global.mx.core = new Object();
}
if (!_global.mx.core.UIObject) {
var v1 = function () {
super();
this.constructObject();
};
mx.core.UIObject = v1;
mx.core.UIObject extends MovieClip;
var v2 = v1.prototype;
v2.__get__width = function () {
return this._width;
};
v2.__get__height = function () {
return this._height;
};
v2.__get__left = function () {
return this._x;
};
v2.__get__x = function () {
return this._x;
};
v2.__get__top = function () {
return this._y;
};
v2.__get__y = function () {
return this._y;
};
v2.__get__right = function () {
return this._parent.width - (this._x + this.__get__width());
};
v2.__get__bottom = function () {
return this._parent.height - (this._y + this.__get__height());
};
v2.getMinHeight = function (Void) {
return this._minHeight;
};
v2.setMinHeight = function (h) {
this._minHeight = h;
};
v2.__get__minHeight = function () {
return this.getMinHeight();
};
v2.__set__minHeight = function (h) {
this.setMinHeight(h);
return this.__get__minHeight();
};
v2.getMinWidth = function (Void) {
return this._minWidth;
};
v2.setMinWidth = function (w) {
this._minWidth = w;
};
v2.__get__minWidth = function () {
return this.getMinWidth();
};
v2.__set__minWidth = function (w) {
this.setMinWidth(w);
return this.__get__minWidth();
};
v2.setVisible = function (x, noEvent) {
if (x != this._visible) {
this._visible = x;
if (noEvent != true) {
this.dispatchEvent({'type': x ? 'reveal' : 'hide'});
}
}
};
v2.__get__visible = function () {
return this._visible;
};
v2.__set__visible = function (x) {
this.setVisible(x, false);
return this.__get__visible();
};
v2.__get__scaleX = function () {
return this._xscale;
};
v2.__set__scaleX = function (x) {
this._xscale = x;
return this.__get__scaleX();
};
v2.__get__scaleY = function () {
return this._yscale;
};
v2.__set__scaleY = function (y) {
this._yscale = y;
return this.__get__scaleY();
};
v2.doLater = function (obj, fn) {
if (this.methodTable == undefined) {
this.methodTable = new Array();
}
this.methodTable.push({'obj': obj, 'fn': fn});
this.onEnterFrame = this.doLaterDispatcher;
};
v2.doLaterDispatcher = function (Void) {
delete this.onEnterFrame;
if (this.invalidateFlag) {
this.redraw();
}
var v3 = this.methodTable;
this.methodTable = new Array();
if (v3.length > 0) {
var v2;
v2 = v3.shift();
while (v2 != undefined) {
v2.obj[v2.fn]();
}
}
};
v2.cancelAllDoLaters = function (Void) {
delete this.onEnterFrame;
this.methodTable = new Array();
};
v2.invalidate = function (Void) {
this.invalidateFlag = true;
this.onEnterFrame = this.doLaterDispatcher;
};
v2.invalidateStyle = function (Void) {
this.invalidate();
};
v2.redraw = function (bAlways) {
if (this.invalidateFlag || bAlways) {
this.invalidateFlag = false;
var v2;
for (v2 in this.tfList) {
this.tfList[v2].draw();
}
this.draw();
this.dispatchEvent({'type': 'draw'});
}
};
v2.draw = function (Void) {};
v2.move = function (x, y, noEvent) {
var v3 = this._x;
var v2 = this._y;
this._x = x;
this._y = y;
if (noEvent != true) {
this.dispatchEvent({'type': 'move', 'oldX': v3, 'oldY': v2});
}
};
v2.setSize = function (w, h, noEvent) {
var v3 = this.__width;
var v2 = this.__height;
this.__width = w;
this.__height = h;
this.size();
if (noEvent != true) {
this.dispatchEvent({'type': 'resize', 'oldWidth': v3, 'oldHeight': v2});
}
};
v2.size = function (Void) {
this._width = this.__width;
this._height = this.__height;
};
v2.drawRect = function (x1, y1, x2, y2) {
this.moveTo(x1, y1);
this.lineTo(x2, y1);
this.lineTo(x2, y2);
this.lineTo(x1, y2);
this.lineTo(x1, y1);
};
v2.createLabel = function (name, depth, text) {
this.createTextField(name, depth, 0, 0, 0, 0);
var v2 = this[name];
v2._color = mx.core.UIObject.textColorList;
v2._visible = false;
v2.__text = text;
if (this.tfList == undefined) {
this.tfList = new Object();
}
this.tfList[name] = v2;
v2.invalidateStyle();
this.invalidate();
v2.styleName = this;
return v2;
};
v2.createObject = function (linkageName, id, depth, initobj) {
return this.attachMovie(linkageName, id, depth, initobj);
};
v2.createClassObject = function (className, id, depth, initobj) {
var v3 = className.symbolName == undefined;
if (v3) {
Object.registerClass(className.symbolOwner.symbolName, className);
}
var v4 = mx.core.UIObject(this.createObject(className.symbolOwner.symbolName, id, depth, initobj));
if (v3) {
Object.registerClass(className.symbolOwner.symbolName, className.symbolOwner);
}
return v4;
};
v2.createEmptyObject = function (id, depth) {
return this.createClassObject(mx.core.UIObject, id, depth);
};
v2.destroyObject = function (id) {
var v2 = this[id];
if (v2.getDepth() < 0) {
var v4 = this.buildDepthTable();
var v5 = this.findNextAvailableDepth(0, v4, 'up');
var v3 = v5;
v2.swapDepths(v3);
}
v2.removeMovieClip();
delete this[id];
};
v2.getSkinIDName = function (tag) {
return this.idNames[tag];
};
v2.setSkin = function (tag, linkageName, initObj) {
if (_global.skinRegistry[linkageName] == undefined) {
mx.skins.SkinElement.registerElement(linkageName, mx.skins.SkinElement);
}
return this.createObject(linkageName, this.getSkinIDName(tag), tag, initObj);
};
v2.createSkin = function (tag) {
var v2 = this.getSkinIDName(tag);
this.createEmptyObject(v2, tag);
return this[v2];
};
v2.createChildren = function (Void) {};
v2._createChildren = function (Void) {
this.createChildren();
this.childrenCreated = true;
};
v2.constructObject = function (Void) {
if (this._name == undefined) {
return undefined;
}
this.init();
this._createChildren();
this.createAccessibilityImplementation();
this._endInit();
if (this.validateNow) {
this.redraw(true);
} else {
this.invalidate();
}
};
v2.initFromClipParameters = function (Void) {
var v4 = false;
var v2;
for (v2 in this.clipParameters) {
if (this.hasOwnProperty(v2)) {
v4 = true;
this['def_' + v2] = this[v2];
delete this[v2];
}
}
if (v4) {
for (v2 in this.clipParameters) {
var v3 = this['def_' + v2];
if (v3 != undefined) {
this[v2] = v3;
}
}
}
};
v2.init = function (Void) {
this.__width = this._width;
this.__height = this._height;
if (this.initProperties == undefined) {
this.initFromClipParameters();
} else {
this.initProperties();
}
if (_global.cascadingStyles == true) {
this.stylecache = new Object();
}
};
v2.getClassStyleDeclaration = function (Void) {
var v4 = this;
var v3 = this.className;
while (v3 != undefined) {
if (this.ignoreClassStyleDeclaration[v3] == undefined) {
if (_global.styles[v3] != undefined) {
return _global.styles[v3];
}
}
v4 = v4.__proto__;
v3 = v4.className;
}
};
v2.setColor = function (color) {};
v2.__getTextFormat = function (tf, bAll) {
var v8 = this.stylecache.tf;
if (v8 != undefined) {
var v3;
for (v3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || mx.styles.StyleManager.TextFormatStyleProps[v3]) {
if (tf[v3] == undefined) {
tf[v3] = v8[v3];
}
}
}
return false;
}
var v6 = false;
for (v3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || mx.styles.StyleManager.TextFormatStyleProps[v3]) {
if (tf[v3] == undefined) {
var v5 = this._tf[v3];
if (v5 != undefined) {
tf[v3] = v5;
} else {
if (v3 == 'font' && this.fontFamily != undefined) {
tf[v3] = this.fontFamily;
} else {
if (v3 == 'size' && this.fontSize != undefined) {
tf[v3] = this.fontSize;
} else {
if (v3 == 'color' && this.color != undefined) {
tf[v3] = this.color;
} else {
if (v3 == 'leftMargin' && this.marginLeft != undefined) {
tf[v3] = this.marginLeft;
} else {
if (v3 == 'rightMargin' && this.marginRight != undefined) {
tf[v3] = this.marginRight;
} else {
if (v3 == 'italic' && this.fontStyle != undefined) {
tf[v3] = this.fontStyle == v3;
} else {
if (v3 == 'bold' && this.fontWeight != undefined) {
tf[v3] = this.fontWeight == v3;
} else {
if (v3 == 'align' && this.textAlign != undefined) {
tf[v3] = this.textAlign;
} else {
if (v3 == 'indent' && this.textIndent != undefined) {
tf[v3] = this.textIndent;
} else {
if (v3 == 'underline' && this.textDecoration != undefined) {
tf[v3] = this.textDecoration == v3;
} else {
if (v3 == 'embedFonts' && this.embedFonts != undefined) {
tf[v3] = this.embedFonts;
} else {
v6 = true;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
if (v6) {
var v9 = this.styleName;
if (v9 != undefined) {
if (typeof v9 != 'string') {
v6 = v9.__getTextFormat(tf, true, this);
} else {
if (_global.styles[v9] != undefined) {
v6 = _global.styles[v9].__getTextFormat(tf, true, this);
}
}
}
}
if (v6) {
var v10 = this.getClassStyleDeclaration();
if (v10 != undefined) {
v6 = v10.__getTextFormat(tf, true, this);
}
}
if (v6) {
if (_global.cascadingStyles) {
if (this._parent != undefined) {
v6 = this._parent.__getTextFormat(tf, false);
}
}
}
if (v6) {
v6 = _global.style.__getTextFormat(tf, true, this);
}
return v6;
};
v2._getTextFormat = function (Void) {
var v2 = this.stylecache.tf;
if (v2 != undefined) {
return v2;
}
v2 = new TextFormat();
this.__getTextFormat(v2, true);
this.stylecache.tf = v2;
if (this.enabled == false) {
var v3 = this.getStyle('disabledColor');
v2.color = v3;
}
return v2;
};
v2.getStyleName = function (Void) {
var v2 = this.styleName;
if (v2 != undefined) {
if (typeof v2 != 'string') {
return v2.getStyleName();
} else {
return v2;
}
}
if (this._parent != undefined) {
return this._parent.getStyleName();
} else {
return undefined;
}
};
v2.getStyle = function (styleProp) {
var v3;
++_global.getStyleCounter;
if (this[styleProp] != undefined) {
return this[styleProp];
}
var v6 = this.styleName;
if (v6 != undefined) {
if (typeof v6 != 'string') {
v3 = v6.getStyle(styleProp);
} else {
var v7 = _global.styles[v6];
v3 = v7.getStyle(styleProp);
}
}
if (v3 != undefined) {
return v3;
}
v7 = this.getClassStyleDeclaration();
if (v7 != undefined) {
v3 = v7[styleProp];
}
if (v3 != undefined) {
return v3;
}
if (_global.cascadingStyles) {
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || mx.styles.StyleManager.isColorStyle(styleProp)) {
var v5 = this.stylecache;
if (v5 != undefined) {
if (v5[styleProp] != undefined) {
return v5[styleProp];
}
}
if (this._parent != undefined) {
v3 = this._parent.getStyle(styleProp);
} else {
v3 = _global.style[styleProp];
}
if (v5 != undefined) {
v5[styleProp] = v3;
}
return v3;
}
}
if (v3 == undefined) {
v3 = _global.style[styleProp];
}
return v3;
};
v1.mergeClipParameters = function (o, p) {
for (var v3 in p) {
o[v3] = p[v3];
}
return true;
};
v1.symbolName = 'UIObject';
v1.symbolOwner = mx.core.UIObject;
v1.version = '2.0.2.127';
v1.textColorList = {'color': 1, 'disabledColor': 1};
v2.invalidateFlag = false;
v2.lineWidth = 1;
v2.lineColor = 0;
v2.tabEnabled = false;
v2.clipParameters = {'visible': 1, 'minHeight': 1, 'minWidth': 1, 'maxHeight': 1, 'maxWidth': 1, 'preferredHeight': 1, 'preferredWidth': 1};
v2.addProperty('bottom', v2.__get__bottom, function () {});
v2.addProperty('height', v2.__get__height, function () {});
v2.addProperty('left', v2.__get__left, function () {});
v2.addProperty('minHeight', v2.__get__minHeight, v2.__set__minHeight);
v2.addProperty('minWidth', v2.__get__minWidth, v2.__set__minWidth);
v2.addProperty('right', v2.__get__right, function () {});
v2.addProperty('scaleX', v2.__get__scaleX, v2.__set__scaleX);
v2.addProperty('scaleY', v2.__get__scaleY, v2.__set__scaleY);
v2.addProperty('top', v2.__get__top, function () {});
v2.addProperty('visible', v2.__get__visible, v2.__set__visible);
v2.addProperty('width', v2.__get__width, function () {});
v2.addProperty('x', v2.__get__x, function () {});
v2.addProperty('y', v2.__get__y, function () {});
ASSetPropFlags(mx.core.UIObject.prototype, null, 1);
}
#endinitclip
}
movieClip 2 __Packages.mx.core.UIComponent {
#initclip
if (!_global.mx) {
_global.mx = new Object();
}
if (!_global.mx.core) {
_global.mx.core = new Object();
}
if (!_global.mx.core.UIComponent) {
var v1 = function () {
super();
};
mx.core.UIComponent = v1;
mx.core.UIComponent extends mx.core.UIObject;
var v2 = v1.prototype;
v2.__get__width = function () {
return this.__width;
};
v2.__get__height = function () {
return this.__height;
};
v2.setVisible = function (x, noEvent) {
super.setVisible(x, noEvent);
};
v2.enabledChanged = function (id, oldValue, newValue) {
this.setEnabled(newValue);
this.invalidate();
delete this.stylecache.tf;
return newValue;
};
v2.setEnabled = function (enabled) {
this.invalidate();
};
v2.getFocus = function () {
var selFocus = Selection.getFocus();
return (selFocus === null) ? null : eval(selFocus);
};
v2.setFocus = function () {
Selection.setFocus(this);
};
v2.getFocusManager = function () {
var v2 = this;
while (v2 != undefined) {
if (v2.focusManager != undefined) {
return v2.focusManager;
}
v2 = v2._parent;
}
return undefined;
};
v2.onKillFocus = function (newFocus) {
this.removeEventListener('keyDown', this);
this.removeEventListener('keyUp', this);
this.dispatchEvent({'type': 'focusOut'});
this.drawFocus(false);
};
v2.onSetFocus = function (oldFocus) {
this.addEventListener('keyDown', this);
this.addEventListener('keyUp', this);
this.dispatchEvent({'type': 'focusIn'});
if ((this.getFocusManager()).bDrawFocus != false) {
this.drawFocus(true);
}
};
v2.findFocusInChildren = function (o) {
if (o.focusTextField != undefined) {
return o.focusTextField;
}
if (o.tabEnabled == true) {
return o;
}
return undefined;
};
v2.findFocusFromObject = function (o) {
if (o.tabEnabled != true) {
if (o._parent == undefined) {
return undefined;
}
if (o._parent.tabEnabled == true) {
o = o._parent;
return o;
}
if (o._parent.tabChildren) {
o = this.findFocusInChildren(o._parent);
return o;
}
o = this.findFocusFromObject(o._parent);
}
return o;
};
v2.pressFocus = function () {
var v3 = this.findFocusFromObject(this);
var v2 = this.getFocus();
if (v3 != v2) {
v2.drawFocus(false);
if ((this.getFocusManager()).bDrawFocus != false) {
v3.drawFocus(true);
}
}
};
v2.releaseFocus = function () {
var v2 = this.findFocusFromObject(this);
if (v2 != this.getFocus()) {
v2.setFocus();
}
};
v2.isParent = function (o) {
while (o != undefined) {
if (o == this) {
return true;
}
o = o._parent;
}
return false;
};
v2.size = function () {};
v2.init = function () {
super.init();
this._xscale = 100;
this._yscale = 100;
this._focusrect = _global.useFocusRect == false;
this.watch('enabled', this.enabledChanged);
if (this.enabled == false) {
this.setEnabled(false);
}
};
v2.dispatchValueChangedEvent = function (value) {
this.dispatchEvent({'type': 'valueChanged', 'value': value});
};
v1.symbolName = 'UIComponent';
v1.symbolOwner = mx.core.UIComponent;
v1.version = '2.0.2.127';
v1.kStretch = 5000;
v2.focusEnabled = true;
v2.tabEnabled = true;
v2.origBorderStyles = {'themeColor': 16711680};
v2.clipParameters = {};
v1.mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.core.UIComponent.prototype.clipParameters, mx.core.UIObject.prototype.clipParameters);
v2.addProperty('height', v2.__get__height, function () {});
v2.addProperty('width', v2.__get__width, function () {});
ASSetPropFlags(mx.core.UIComponent.prototype, null, 1);
}
#endinitclip
}
movieClip 3 __Packages.ZattikkaHiScores {
#initclip
if (!_global.ZattikkaHiScores) {
var v1 = function () {
super();
this.debug('[ZattikkaHiScores VERSION ' + ZattikkaHiScores.VERSION_NUM + ']');
this._visible = false;
};
_global.ZattikkaHiScores = v1;
_global.ZattikkaHiScores extends mx.core.UIComponent;
var v2 = v1.prototype;
v2.setDetails = function (gameId, levelId, gameCode, gameKey, lowIsBest, score, msg1, msg2, testMode) {
this.debug('[ZattikkaHiScores::setDetails], gameId = ' + gameId + ', levelId = ' + levelId + ', gameCode = ' + gameCode + ', lowIsBest = ' + lowIsBest + ', score = ' + score + ', testMode = ' + testMode);
this.initServerURL(testMode);
this.entryScreen = this.movEntryScreen;
this.infoScreen = this.movInfoScreen;
this.entryScreen._visible = false;
this.infoScreen._visible = false;
this.gameId = gameId;
this.levelId = levelId;
this.gameCode = gameCode;
this.gameKey = gameKey;
this.lowIsBest = lowIsBest;
this.score = score;
this.msg1 = msg1;
this.msg2 = msg2;
try {
this.grabG5User();
if (!this.g5UserExists) {
this.grabFacebookUser();
}
}
catch (v0) {
if (Error(v0) != null) {
var err = Error(v0);
} else {
throw v0;
}
}
var self = this;
this.btnGFTP.onRelease = function () {
self.btn_GFTP();
};
this.entryScreen.btnSubmit.onRelease = function () {
self.btn_submitScore();
};
this.entryScreen.btnTwitter.onRelease = function () {
self.btn_twitterTweet();
};
this.entryScreen.btnFacebook.onRelease = function () {
self.btn_facebookFeed();
};
this.infoScreen.btnView.onRelease = function () {
self.btn_viewScore();
};
this.infoScreen.btnBack.onRelease = function () {
self.btn_back();
};
if (this.fbUserExists) {
this.btn_submitScore();
} else {
this.showEntryScreen();
}
this._visible = true;
};
v2.getHiScoresRange = function (caller, gameId, startLevel, endLevel, startPos, endPos, lowIsBest, testMode) {
this.debug('[ZattikkaHiScores::getHiScoresRange] gameId = ' + gameId + ', startLevel = ' + startLevel + ', endLevel = ' + endLevel + ', startPos = ' + startPos + ', endPos = ' + endPos + ', lowIsBest = ' + lowIsBest);
this.initServerURL(testMode);
this.caller = caller;
var v2 = new LoadVars();
v2.gameId = gameId;
v2.startLevel = startLevel;
v2.endLevel = endLevel;
v2.startPos = startPos;
v2.endPos = endPos;
v2.lowIsBest = lowIsBest;
this.hitServer(ZattikkaHiScores.HS_ACTION, ZattikkaHiScores.EVENT_GET_HI_SCORES_RANGE, v2);
};
v2.viewHiScores = function (gameId, testMode) {
this.debug('[ZattikkaHiScores::viewHiScores] gameId = ' + gameId + ', testMode = ' + testMode);
this.initServerURL(testMode);
var v2 = ZattikkaHiScores.SERVER_URL + ZattikkaHiScores.HS_ACTION + ZattikkaHiScores.EVENT_VIEW_HI_SCORES;
v2 += '&gameId=' + gameId;
this.getURL(v2, '_blank');
};
v2.initServerURL = function (testMode) {
if (testMode != undefined && testMode) {
ZattikkaHiScores.SERVER_URL = ZattikkaHiScores.TEST_SERVER_URL;
} else {
try {
if (_root.svrUrl != null && _root.svrUrl.length > 0) {
ZattikkaHiScores.SERVER_URL = String(_root.svrUrl);
}
}
catch (v0) {
if (Error(v0) != null) {
var err = Error(v0);
} else {
throw v0;
}
}
}
this.debug('[ZattikkaHiScores::initServerURL] SERVER_URL = ' + ZattikkaHiScores.SERVER_URL);
};
v2.grabG5User = function () {
this.g5User = flash.external.ExternalInterface.call('getG5User');
this.g5UserExists = (this.g5User == null) ? false : !isNaN(this.g5User[0]);
if (this.devTestMode == ZattikkaHiScores.DEV_TEST_MODE_G5) {
this.g5User = new Array('9', 'RocketRonz');
this.g5UserExists = (this.g5User == null) ? false : !isNaN(this.g5User[0]);
}
this.debug('[ZattikkaHiScores::grabG5User] ' + (this.g5UserExists ? 'userId = ' + this.g5User[0] + ', userName = ' + this.g5User[1] : 'g5User is empty'));
};
v2.grabFacebookUser = function () {
this.fbUser = flash.external.ExternalInterface.call('getFBUser');
this.fbUserExists = (this.fbUser == null) ? false : !isNaN(this.fbUser[0]);
this.fbSessionKey = flash.external.ExternalInterface.call('getFBSessionKey');
if (this.devTestMode == ZattikkaHiScores.DEV_TEST_MODE_FB) {
this.fbUser = new Array('1383775213', 'Dolphin Gimme-Five');
this.fbUserExists = (this.fbUser == null) ? false : !isNaN(this.fbUser[0]);
this.fbSessionKey = 'ad4dff81c4d2467efc456072-1383775213';
}
this.debug('[ZattikkaHiScores::grabFacebookUser] ' + (this.fbUserExists ? 'userId = ' + this.fbUser[0] + ', userName = ' + this.fbUser[1] + ', sessionKey = ' + this.fbSessionKey : 'fbUser is empty'));
};
v2.showEntryScreen = function () {
this.entryScreen.txtMsgLine1.text = this.msg1;
this.entryScreen.txtMsgLine2.text = this.msg2;
this.entryScreen.movNameAuto._visible = this.g5UserExists || this.fbUserExists;
this.entryScreen.movNameManual._visible = !this.g5UserExists && !this.fbUserExists;
this.entryScreen.movNameAuto.txtName.text = this.g5UserExists ? this.g5User[1] : (this.fbUserExists ? this.fbUser[1] : '');
this.entryScreen.movNameManual.txtName.text = '';
this.entryScreen._visible = true;
this.infoScreen._visible = false;
};
v2.showInfoMessage = function (msg, error) {
this.infoScreen.txtInfo.text = msg;
this.infoScreen.btnBack._visible = error;
this.infoScreen.btnView._visible = !error && !this.fbUserExists;
this.infoScreen._visible = true;
this.entryScreen._visible = false;
};
v2.btn_GFTP = function () {
this.getURL(ZattikkaHiScores.GFTP_URL, '_blank');
};
v2.btn_submitScore = function () {
if (!this.g5UserExists && !this.fbUserExists && this.entryScreen.movNameManual.txtName.text.length == 0) {
this.showInfoMessage(ZattikkaHiScores.MSG_PLEASE_ENTER_NICKNAME, true);
} else {
this.submitScore();
}
};
v2.btn_twitterTweet = function () {
if (!this.g5UserExists && !this.fbUserExists && this.entryScreen.movNameManual.txtName.text.length == 0) {
this.showInfoMessage(ZattikkaHiScores.MSG_PLEASE_ENTER_NICKNAME, true);
} else {
this.twitterTweet();
}
};
v2.btn_facebookFeed = function () {
if (this.fbUserExists) {
this.facebookFeed();
} else {
this.facebookFeedExternal();
}
};
v2.btn_viewScore = function () {
this.viewScore();
};
v2.btn_back = function () {
this.setDetails(this.gameId, this.levelId, this.gameCode, this.gameKey, this.lowIsBest, this.score, this.msg1, this.msg2);
};
v2.submitScore = function () {
this.showInfoMessage(ZattikkaHiScores.MSG_SUBMITTING_DETAILS, false);
this.infoScreen._visible = true;
this.entryScreen._visible = false;
var v9 = this.fbUserExists ? ZattikkaHiScores.HS_PLATFORM_FACEBOOK : ZattikkaHiScores.HS_PLATFORM_WEB;
var v5 = '';
var v7 = '';
if (this.fbUserExists) {
v7 = this.fbUser[0];
v5 = this.fbUser[1];
} else {
if (this.g5UserExists) {
v7 = this.g5User[0];
v5 = this.g5User[1];
} else {
v5 = this.entryScreen.movNameManual.txtName.text;
}
}
var v8 = String((new Date()).getTime());
var v10 = v8.split('');
v10.reverse();
var v6 = this.xor(v10.join(''), this.gameKey, false);
var v2 = '';
v2 += this.gameId + ',';
v2 += this.levelId + ',';
v2 += v9 + ',';
v2 += this.score + ',';
v2 += v7 + ',';
v2 += this.replaceAll(v5, ',', '') + ',';
v2 += ',';
v2 += String(this.lowIsBest);
var v4 = this.xor(v2, v6, false);
this.debug('key [' + v6.length + '] = ' + v6);
this.debug('plain [' + v2.length + '] = ' + v2);
this.debug('cipher [' + v4.length + '] = ' + v4);
v4 = this.getRandomString(5) + v4 + this.getRandomString(5);
var v3 = new LoadVars();
v3.gameId = this.gameId;
v3.platformId = v9;
v3.time = v8;
v3.data = v4;
v3.returnMessage = true;
this.hitServer(ZattikkaHiScores.HS_ACTION, ZattikkaHiScores.EVENT_SUBMIT_HI_SCORE, v3);
};
v2.twitterTweet = function () {
var v2 = ZattikkaHiScores.SERVER_URL + ZattikkaHiScores.TW_ACTION + ZattikkaHiScores.EVENT_POST_TWEET;
v2 += '&gameId=' + this.gameId;
v2 += '&levelId=' + this.levelId;
v2 += '&score=' + this.score;
this.getURL(v2, '_blank');
this.submitScore();
};
v2.facebookFeed = function () {
var v2 = new LoadVars();
v2.gameId = this.gameId;
v2.levelId = this.levelId;
v2.score = this.score;
v2.sessionKey = this.fbSessionKey;
v2.returnMessage = true;
this.hitServer(ZattikkaHiScores.FB_ACTION, ZattikkaHiScores.EVENT_PUBLISH_HI_SCORE_FEED, v2);
};
v2.facebookFeedExternal = function () {
this.getURL(ZattikkaHiScores.SERVER_URL + ZattikkaHiScores.FB_ACTION + ZattikkaHiScores.EVENT_PUBLISH_HI_SCORE_FEED_EXTERNAL, '_blank');
try {
var self = this;
this.cxn = new LocalConnection();
this.cxn.allowDomain = function (sendingDomain) {
return true;
};
this.cxn.setFBUser = function (fbUserId, fbSessionKey) {
self.setFBUser(fbUserId, fbSessionKey);
};
this.cxn.connect('_cxnZattikkaHS');
}
catch (v0) {
if (Error(v0) != null) {
var err = Error(v0);
} else {
throw v0;
}
}
};
v2.hitServer = function (stripesAction, stripesEvent, vars) {
this.debug('[ZattikkaHiScores::hitServer] url = ' + ZattikkaHiScores.SERVER_URL + stripesAction + stripesEvent);
var self = this;
var v2 = new XML();
vars.addRequestHeader(['Content-Type', 'application/x-www-form-urlencoded; charset=utf-8']);
vars.sendAndLoad(ZattikkaHiScores.SERVER_URL + stripesAction + stripesEvent, v2, 'POST');
v2.onLoad = function (success) {
self.loadHandler(stripesEvent, success, this);
};
};
v2.setFBUser = function (fbUserId, fbSessionKey) {
this.debug('[ZattikkaHiScores::setFBUser] fbUserId = ' + fbUserId + ', fbSessionKey = ' + fbSessionKey);
this.fbUser = new Array(fbUserId, '');
this.fbUserExists = true;
this.fbSessionKey = fbSessionKey;
this.cxn.close();
this.facebookFeed();
};
v2.viewScore = function () {
var v2 = ZattikkaHiScores.SERVER_URL + ZattikkaHiScores.HS_ACTION + ZattikkaHiScores.EVENT_VIEW_HI_SCORE;
v2 += '&gameId=' + this.gameId;
v2 += '&levelId=' + this.levelId;
v2 += '&platformId=' + ZattikkaHiScores.HS_PLATFORM_WEB;
v2 += '&gameCode=' + this.gameCode;
if (this.g5UserExists) {
v2 += '&userId=' + this.g5User[0];
} else {
v2 += '&name=' + this.entryScreen.movNameManual.txtName.text;
}
this.getURL(v2, '_blank');
};
v2.loadHandler = function (stripesEvent, success, xml) {
this.debug('[ZattikkaHiScores::loadHandler] stripesEvent = ' + stripesEvent + ', success = ' + success + ', xml = ' + xml.toString());
if (!success) {
if (stripesEvent == ZattikkaHiScores.EVENT_GET_HI_SCORES_RANGE) {
this.caller.getHiScoresRange_Error();
} else {
this.showInfoMessage(ZattikkaHiScores.MSG_SERVER_ERROR, true);
}
} else {
var v3 = xml.firstChild;
var v2 = v3.attributes.code;
switch (stripesEvent) {
case ZattikkaHiScores.EVENT_SUBMIT_HI_SCORE:
this.showInfoMessage(v3.attributes.msg, v2 == -1);
if (this.fbUserExists && (v2 == 1 || v2 == 2)) {
try {
flash.external.ExternalInterface.call('refreshFBHiScores', this.score, this.levelId);
flash.external.ExternalInterface.call('streamPublish_FBConnect', this.msg1, this.levelId);
}
catch (stripesEvent) {
if (Error(stripesEvent) != null) {
var err = Error(stripesEvent);
} else {
throw stripesEvent;
}
}
}
break;
case ZattikkaHiScores.EVENT_PUBLISH_HI_SCORE_FEED:
this.submitScore();
break;
case ZattikkaHiScores.EVENT_GET_HI_SCORES_RANGE:
this.caller.getHiScoresRange_Callback(xml);
}
}
};
v2.xor = function (plain, key, traceChar) {
var v7 = '';
var v4 = 0;
var v2 = 0;
while (v4 < plain.length) {
if (v2 >= key.length) {
v2 = 0;
}
var v3 = (plain.charCodeAt(v4) ^ key.charCodeAt(v2)) + 1;
if (traceChar) {
this.debug('charCode = ' + v3 + ' = ' + String.fromCharCode(v3));
}
v7 += String.fromCharCode(v3);
v4++;
v2++;
}
return v7;
};
v2.getRandom = function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
v2.getRandomString = function (len) {
var v3 = '';
var v2 = 0;
while (v2 < len) {
v3 += String.fromCharCode(this.getRandom(48, 122));
++v2;
}
return v3;
};
v2.replaceAll = function (str, toReplace, replaceWith) {
var v3 = '';
var v1 = 0;
while (v1 < str.length) {
if (str.charAt(v1) == toReplace) {
v3 += replaceWith;
} else {
v3 += str.charAt(v1);
}
++v1;
}
return v3;
};
v2.debug = function (msg) {
trace(msg);
com.hexagonstar.util.debug.Debug.trace(msg);
};
v1.VERSION_NUM = '1.0.15 (AS2)';
v1.LIVE_SERVER_URL = 'http://api.zattikka.com';
v1.TEST_SERVER_URL = 'http://api.staging.zattikka.com';
v1.SERVER_URL = ZattikkaHiScores.LIVE_SERVER_URL;
v1.GFTP_URL = 'http://www.gamesfortheplanet.com';
v1.DEV_TEST_MODE_OFF = 0;
v1.DEV_TEST_MODE_G5 = 1;
v1.DEV_TEST_MODE_FB = 2;
v2.devTestMode = ZattikkaHiScores.DEV_TEST_MODE_OFF;
v1.HS_PLATFORM_WEB = 0;
v1.HS_PLATFORM_FACEBOOK = 1;
v1.HS_ACTION = '/HiScore.action?';
v1.EVENT_SUBMIT_HI_SCORE = 'SubmitHiScore=';
v1.EVENT_VIEW_HI_SCORE = 'ViewHiScore=';
v1.EVENT_VIEW_HI_SCORES = 'ViewHiScores=';
v1.EVENT_GET_HI_SCORES_RANGE = 'GetHiScoresRange=';
v1.FB_ACTION = '/Facebook.action?';
v1.EVENT_PUBLISH_HI_SCORE_FEED = 'PublishHiScoreFeed=';
v1.EVENT_PUBLISH_HI_SCORE_FEED_EXTERNAL = 'PublishHiScoreFeedExternal=';
v1.TW_ACTION = '/Twitter.action?';
v1.EVENT_POST_TWEET = 'PostTweet=';
v1.MSG_PLEASE_ENTER_NICKNAME = 'Please enter your nickname.';
v1.MSG_SUBMITTING_DETAILS = 'Submitting hi-score details to the server, please wait.';
v1.MSG_SERVER_ERROR = 'Could not contact server, please try again in a few minutes.';
v2.entryScreen = null;
v2.infoScreen = null;
v1.symbolName = 'ZattikkaHiScores';
v1.symbolOwner = ZattikkaHiScores;
v2.className = 'ZattikkaHiScores';
ASSetPropFlags(_global.ZattikkaHiScores.prototype, null, 1);
}
#endinitclip
}
movieClip 46 __Packages.mx.skins.SkinElement {
#initclip
if (!_global.mx) {
_global.mx = new Object();
}
if (!_global.mx.skins) {
_global.mx.skins = new Object();
}
if (!_global.mx.skins.SkinElement) {
var v1 = function () {
super();
};
mx.skins.SkinElement = v1;
mx.skins.SkinElement extends MovieClip;
var v2 = v1.prototype;
v1.registerElement = function (name, className) {
Object.registerClass(name, (className == undefined) ? mx.skins.SkinElement : className);
_global.skinRegistry[name] = true;
};
v2.__set__visible = function (visible) {
this._visible = visible;
};
v2.move = function (x, y) {
this._x = x;
this._y = y;
};
v2.setSize = function (w, h) {
this._width = w;
this._height = h;
};
ASSetPropFlags(mx.skins.SkinElement.prototype, null, 1);
}
#endinitclip
}
movieClip 47 __Packages.mx.styles.CSSTextStyles {
#initclip
if (!_global.mx) {
_global.mx = new Object();
}
if (!_global.mx.styles) {
_global.mx.styles = new Object();
}
if (!_global.mx.styles.CSSTextStyles) {
var v1 = function () {};
mx.styles.CSSTextStyles = v1;
var v2 = v1.prototype;
v1.addTextStyles = function (o, bColor) {
o.addProperty('textAlign', function () {
return this._tf.align;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.align = x;
});
o.addProperty('fontWeight', function () {
return (this._tf.bold != undefined) ? (this._tf.bold ? 'bold' : 'none') : undefined;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.bold = x == 'bold';
});
if (bColor) {
o.addProperty('color', function () {
return this._tf.color;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.color = x;
});
}
o.addProperty('fontFamily', function () {
return this._tf.font;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.font = x;
});
o.addProperty('textIndent', function () {
return this._tf.indent;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.indent = x;
});
o.addProperty('fontStyle', function () {
return (this._tf.italic != undefined) ? (this._tf.italic ? 'italic' : 'none') : undefined;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.italic = x == 'italic';
});
o.addProperty('marginLeft', function () {
return this._tf.leftMargin;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.leftMargin = x;
});
o.addProperty('marginRight', function () {
return this._tf.rightMargin;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.rightMargin = x;
});
o.addProperty('fontSize', function () {
return this._tf.size;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.size = x;
});
o.addProperty('textDecoration', function () {
return (this._tf.underline != undefined) ? (this._tf.underline ? 'underline' : 'none') : undefined;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.underline = x == 'underline';
});
o.addProperty('embedFonts', function () {
return this._tf.embedFonts;
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.embedFonts = x;
});
};
ASSetPropFlags(mx.styles.CSSTextStyles.prototype, null, 1);
}
#endinitclip
}
movieClip 48 __Packages.mx.styles.StyleManager {
#initclip
if (!_global.mx) {
_global.mx = new Object();
}
if (!_global.mx.styles) {
_global.mx.styles = new Object();
}
if (!_global.mx.styles.StyleManager) {
var v1 = function () {};
mx.styles.StyleManager = v1;
var v2 = v1.prototype;
v1.registerInheritingStyle = function (styleName) {
mx.styles.StyleManager.inheritingStyles[styleName] = true;
};
v1.isInheritingStyle = function (styleName) {
return mx.styles.StyleManager.inheritingStyles[styleName] == true;
};
v1.registerColorStyle = function (styleName) {
mx.styles.StyleManager.colorStyles[styleName] = true;
};
v1.isColorStyle = function (styleName) {
return mx.styles.StyleManager.colorStyles[styleName] == true;
};
v1.registerColorName = function (colorName, colorValue) {
mx.styles.StyleManager.colorNames[colorName] = colorValue;
};
v1.isColorName = function (colorName) {
return mx.styles.StyleManager.colorNames[colorName] != undefined;
};
v1.getColorName = function (colorName) {
return mx.styles.StyleManager.colorNames[colorName];
};
v1.inheritingStyles = {'color': true, 'direction': true, 'fontFamily': true, 'fontSize': true, 'fontStyle': true, 'fontWeight': true, 'textAlign': true, 'textIndent': true};
v1.colorStyles = {'barColor': true, 'trackColor': true, 'borderColor': true, 'buttonColor': true, 'color': true, 'dateHeaderColor': true, 'dateRollOverColor': true, 'disabledColor': true, 'fillColor': true, 'highlightColor': true, 'scrollTrackColor': true, 'selectedDateColor': true, 'shadowColor': true, 'strokeColor': true, 'symbolBackgroundColor': true, 'symbolBackgroundDisabledColor': true, 'symbolBackgroundPressedColor': true, 'symbolColor': true, 'symbolDisabledColor': true, 'themeColor': true, 'todayIndicatorColor': true, 'shadowCapColor': true, 'borderCapColor': true, 'focusColor': true};
v1.colorNames = {'black': 0, 'white': 16777215, 'red': 16711680, 'green': 65280, 'blue': 255, 'magenta': 16711935, 'yellow': 16776960, 'cyan': 65535, 'haloGreen': 8453965, 'haloBlue': 2881013, 'haloOrange': 16761344};
v1.TextFormatStyleProps = {'font': true, 'size': true, 'color': true, 'leftMargin': false, 'rightMargin': false, 'italic': true, 'bold': true, 'align': true, 'indent': true, 'underline': false, 'embedFonts': false};
v1.TextStyleMap = {'textAlign': true, 'fontWeight': true, 'color': true, 'fontFamily': true, 'textIndent': true, 'fontStyle': true, 'lineHeight': true, 'marginLeft': true, 'marginRight': true, 'fontSize': true, 'textDecoration': true, 'embedFonts': true};
ASSetPropFlags(mx.styles.StyleManager.prototype, null, 1);
}
#endinitclip
}
movieClip 49 __Packages.mx.styles.CSSStyleDeclaration {
#initclip
if (!_global.mx) {
_global.mx = new Object();
}
if (!_global.mx.styles) {
_global.mx.styles = new Object();
}
if (!_global.mx.styles.CSSStyleDeclaration) {
var v1 = function () {};
mx.styles.CSSStyleDeclaration = v1;
var v2 = v1.prototype;
v2.__getTextFormat = function (tf, bAll) {
var v5 = false;
if (this._tf != undefined) {
var v2;
for (v2 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || mx.styles.StyleManager.TextFormatStyleProps[v2]) {
if (tf[v2] == undefined) {
var v3 = this._tf[v2];
if (v3 != undefined) {
tf[v2] = v3;
} else {
v5 = true;
}
}
}
}
return v5;
}
v5 = true;
return v5;
};
v2.getStyle = function (styleProp) {
var v2 = this[styleProp];
var v3 = mx.styles.StyleManager.getColorName(v2);
return (v3 == undefined) ? v2 : v3;
};
v1.classConstruct = function () {
mx.styles.CSSTextStyles.addTextStyles(mx.styles.CSSStyleDeclaration.prototype, true);
return true;
};
v1.classConstructed = mx.styles.CSSStyleDeclaration.classConstruct();
v1.CSSTextStylesDependency = mx.styles.CSSTextStyles;
ASSetPropFlags(mx.styles.CSSStyleDeclaration.prototype, null, 1);
}
#endinitclip
}
movieClip 50 __Packages.com.hexagonstar.util.debug.Debug {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.hexagonstar) {
_global.com.hexagonstar = new Object();
}
if (!_global.com.hexagonstar.util) {
_global.com.hexagonstar.util = new Object();
}
if (!_global.com.hexagonstar.util.debug) {
_global.com.hexagonstar.util.debug = new Object();
}
if (!_global.com.hexagonstar.util.debug.Debug) {
var v1 = function () {};
com.hexagonstar.util.debug.Debug = v1;
var v2 = v1.prototype;
v1.trace = function () {
var v2 = (arguments[1] != undefined) ? arguments[1] : 1;
if (v2 >= com.hexagonstar.util.debug.Debug._filterLevel && v2 < 7) {
com.hexagonstar.util.debug.Debug.send('onData', arguments[0], v2, 0);
}
};
v1.traceObj = function (obj, depth, level) {
if (!depth) {
depth = 64;
}
if (!level) {
level = 1;
}
if (level >= com.hexagonstar.util.debug.Debug._filterLevel && level < 7) {
com.hexagonstar.util.debug.Debug.send('onData', obj, level, depth);
}
};
v1.inspect = function (obj) {
com.hexagonstar.util.debug.Debug.send('onInspect', obj, 1, -1);
};
v1.hexDump = function (obj) {
com.hexagonstar.util.debug.Debug.send('onHexDump', obj, 0, 0);
};
v1.clear = function () {
com.hexagonstar.util.debug.Debug.trace('[%CLR%]', 5);
};
v1.delimiter = function () {
com.hexagonstar.util.debug.Debug.trace('[%DLT%]', 5);
};
v1.pause = function () {
com.hexagonstar.util.debug.Debug.trace('[%PSE%]', 5);
};
v1.time = function () {
com.hexagonstar.util.debug.Debug.trace('[%TME%]', 5);
};
v1.monitor = function (stage, topFPS, pollInterval) {
if (com.hexagonstar.util.debug.Debug._isPollingFPS) {
com.hexagonstar.util.debug.Debug.stop();
}
if (com.hexagonstar.util.debug.Debug._isEnabled && !com.hexagonstar.util.debug.Debug._fpsMeter) {
com.hexagonstar.util.debug.Debug._isPollingFPS = true;
com.hexagonstar.util.debug.Debug._topFPS = topFPS;
com.hexagonstar.util.debug.Debug._stage = stage;
com.hexagonstar.util.debug.Debug._fpsMeter = new com.hexagonstar.util.debug.FPSMeter(com.hexagonstar.util.debug.Debug._stage, pollInterval);
com.hexagonstar.util.debug.Debug._fpsMeter.start();
}
};
v1.mark = function (color) {
if (!color) {
color = 16711935;
}
com.hexagonstar.util.debug.Debug.send('onMarker', color, 1, -1);
};
v1.stop = function () {
if (com.hexagonstar.util.debug.Debug._fpsMeter) {
com.hexagonstar.util.debug.Debug._isPollingFPS = false;
com.hexagonstar.util.debug.Debug._fpsMeter.stop();
com.hexagonstar.util.debug.Debug._fpsMeter = null;
com.hexagonstar.util.debug.Debug._stage = null;
}
};
v1.timerStart = function (title) {
if (com.hexagonstar.util.debug.Debug._isEnabled) {
if (!com.hexagonstar.util.debug.Debug._stopWatch) {
com.hexagonstar.util.debug.Debug._stopWatch = new com.hexagonstar.util.debug.StopWatch();
}
com.hexagonstar.util.debug.Debug._stopWatch.start(title);
}
};
v1.timerStop = function () {
if (com.hexagonstar.util.debug.Debug._stopWatch) {
com.hexagonstar.util.debug.Debug._stopWatch.stop();
}
};
v1.timerReset = function () {
if (com.hexagonstar.util.debug.Debug._stopWatch) {
com.hexagonstar.util.debug.Debug._stopWatch.reset();
}
};
v1.timerInMilliSeconds = function () {
if (com.hexagonstar.util.debug.Debug._stopWatch) {
com.hexagonstar.util.debug.Debug.trace(com.hexagonstar.util.debug.Debug._stopWatch.__get__timeInMilliSeconds() + 'ms');
}
};
v1.timerInSeconds = function () {
if (com.hexagonstar.util.debug.Debug._stopWatch) {
com.hexagonstar.util.debug.Debug.trace(com.hexagonstar.util.debug.Debug._stopWatch.__get__timeInSeconds() + 's');
}
};
v1.timerToString = function () {
if (com.hexagonstar.util.debug.Debug._stopWatch) {
com.hexagonstar.util.debug.Debug.trace(com.hexagonstar.util.debug.Debug._stopWatch.toString());
}
};
v1.timerStopToString = function (reset) {
if (com.hexagonstar.util.debug.Debug._stopWatch) {
com.hexagonstar.util.debug.Debug._stopWatch.stop();
com.hexagonstar.util.debug.Debug.trace(com.hexagonstar.util.debug.Debug._stopWatch.toString());
if (reset) {
com.hexagonstar.util.debug.Debug._stopWatch.reset();
}
}
};
v1.__get__filterLevel = function () {
return com.hexagonstar.util.debug.Debug._filterLevel;
};
v1.__set__filterLevel = function (v) {
if (v >= 0 && v < 5) {
com.hexagonstar.util.debug.Debug._filterLevel = v;
}
return com.hexagonstar.util.debug.Debug.__get__filterLevel();
};
v1.__get__enabled = function () {
return com.hexagonstar.util.debug.Debug._isEnabled;
};
v1.__set__enabled = function (v) {
com.hexagonstar.util.debug.Debug._isEnabled = v;
return com.hexagonstar.util.debug.Debug.__get__enabled();
};
v1.onFPSUpdate = function () {
com.hexagonstar.util.debug.Debug.send('onFPS', com.hexagonstar.util.debug.Debug._fpsMeter.__get__fps() + ',' + com.hexagonstar.util.debug.Debug._topFPS + ',' + com.hexagonstar.util.debug.Debug._fpsMeter.__get__frt() + ',0');
};
v1.onStatus = function () {};
v1.send = function (m, d, l, r) {
if (com.hexagonstar.util.debug.Debug._isEnabled) {
if (!com.hexagonstar.util.debug.Debug._isConnected) {
com.hexagonstar.util.debug.Debug._isConnected = true;
com.hexagonstar.util.debug.Debug._connection = new LocalConnection();
}
if (r == undefined) {
r = 0;
}
var v2 = 0;
if (typeof d == 'string') {
v2 = (String(d)).length;
} else {
if (typeof d == 'object') {
}
}
if (v2 > 39000) {
com.hexagonstar.util.debug.Debug.storeDataLSO(m, d);
m = 'onLargeData';
d = null;
}
var v4 = com.hexagonstar.util.debug.Debug._connection.send('_alcon_lc', m, d, l, r, '');
if (!v4) {
com.hexagonstar.util.debug.Debug.trace('[%ERR%]');
}
}
};
v1.storeDataLSO = function (m, d) {
var v1 = SharedObject.getLocal('alcon', '/');
v1.data.alconMethod = m;
v1.data.alconData = d;
try {
var v2 = String(v1.flush());
if (v2 == 'pending') {
return undefined;
}
}
catch (v0) {
if (Error(v0) != null) {
var e = Error(v0);
} else {
throw v0;
}
}
};
v1.LEVEL_DEBUG = 0;
v1.LEVEL_INFO = 1;
v1.LEVEL_WARN = 2;
v1.LEVEL_ERROR = 3;
v1.LEVEL_FATAL = 4;
v1._filterLevel = 0;
v1._isConnected = false;
v1._isPollingFPS = false;
v1._isEnabled = true;
v1._topFPS = 25;
v1.addProperty('enabled', v1.__get__enabled, v1.__set__enabled);
v1.addProperty('filterLevel', v1.__get__filterLevel, v1.__set__filterLevel);
ASSetPropFlags(com.hexagonstar.util.debug.Debug.prototype, null, 1);
}
#endinitclip
}
movieClip 51 __Packages.com.hexagonstar.util.debug.FPSMeter {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.hexagonstar) {
_global.com.hexagonstar = new Object();
}
if (!_global.com.hexagonstar.util) {
_global.com.hexagonstar.util = new Object();
}
if (!_global.com.hexagonstar.util.debug) {
_global.com.hexagonstar.util.debug = new Object();
}
if (!_global.com.hexagonstar.util.debug.FPSMeter) {
var v1 = function (stage, pollInterval) {
this._stage = stage;
this._pollInterval = !pollInterval ? 500 : pollInterval;
this.reset();
};
com.hexagonstar.util.debug.FPSMeter = v1;
var v2 = v1.prototype;
v2.start = function () {
if (!this._isRunning) {
this._isRunning = true;
var ref = this;
this._intervalID = setInterval(function () {
com.hexagonstar.util.debug.Debug.onFPSUpdate();
}, this._pollInterval);
this._stage.onEnterFrame = function () {
var v1 = getTimer();
++ref._delay;
if (ref._delay >= ref._delayMax) {
ref._delay = 0;
ref._fps = 1000 * ref._delayMax / (v1 - ref._prev);
ref._prev = v1;
}
ref._frt = v1 - ref._ms;
ref._ms = v1;
};
}
};
v2.stop = function () {
if (this._isRunning) {
clearInterval(this._intervalID);
this.reset();
}
};
v2.reset = function () {
this._fps = 0;
this._frt = 0;
this._ms = 0;
this._isRunning = false;
};
v2.__get__fps = function () {
return this._fps;
};
v2.__get__frt = function () {
return this._frt;
};
v2._delayMax = 10;
v2.addProperty('fps', v2.__get__fps, function () {});
v2.addProperty('frt', v2.__get__frt, function () {});
ASSetPropFlags(com.hexagonstar.util.debug.FPSMeter.prototype, null, 1);
}
#endinitclip
}
movieClip 52 __Packages.com.hexagonstar.util.debug.StopWatch {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.hexagonstar) {
_global.com.hexagonstar = new Object();
}
if (!_global.com.hexagonstar.util) {
_global.com.hexagonstar.util = new Object();
}
if (!_global.com.hexagonstar.util.debug) {
_global.com.hexagonstar.util.debug = new Object();
}
if (!_global.com.hexagonstar.util.debug.StopWatch) {
var v1 = function () {
this.reset();
};
com.hexagonstar.util.debug.StopWatch = v1;
var v2 = v1.prototype;
v2.start = function (title) {
if (!this._started) {
this._title = title ? title : '';
this._started = true;
this._startTimeKeys.push(getTimer());
}
};
v2.stop = function () {
if (this._started) {
var v2 = getTimer();
this._stopTimeKeys[this._startTimeKeys.length - 1] = v2;
this._started = false;
}
};
v2.reset = function () {
this._startTimeKeys = [];
this._stopTimeKeys = [];
this._started = false;
};
v2.toString = function () {
var v5 = '\n ********************* [STOPWATCH] *********************';
if (this._title != '') {
v5 += '\n * ' + this._title;
}
var v2 = 0;
v2 = 0;
while (v2 < this._startTimeKeys.length) {
var v4 = this._startTimeKeys[v2];
var v3 = this._stopTimeKeys[v2];
v5 += '\n * started [' + this.format(v4) + 'ms] stopped [' + this.format(v3) + 'ms] time [' + this.format(v3 - v4) + 'ms]';
++v2;
}
if (v2 == 0) {
v5 += '\n * never started.';
v5 += '\n *******************************************************';
return v5;
}
v5 += '\n * total runnning time: ' + this.__get__timeInSeconds() + 's';
v5 += '\n *******************************************************';
return v5;
};
v2.__get__started = function () {
return this._started;
};
v2.__get__timeInMilliSeconds = function () {
if (this._started) {
this._stopTimeKeys[this._startTimeKeys.length - 1] = getTimer();
}
var v3 = 0;
var v2 = 0;
while (v2 < this._startTimeKeys.length) {
v3 += this._stopTimeKeys[v2] - this._startTimeKeys[v2];
++v2;
}
return v3;
};
v2.__get__timeInSeconds = function () {
return this.__get__timeInMilliSeconds() / 1000;
};
v2.format = function (v) {
var v2 = '';
var v3 = (v.toString()).length;
var v1 = 0;
while (v1 < 5 - v3) {
v2 += '0';
++v1;
}
return v2 + v;
};
v2._started = false;
v2.addProperty('started', v2.__get__started, function () {});
v2.addProperty('timeInMilliSeconds', v2.__get__timeInMilliSeconds, function () {});
v2.addProperty('timeInSeconds', v2.__get__timeInSeconds, function () {});
ASSetPropFlags(com.hexagonstar.util.debug.StopWatch.prototype, null, 1);
}
#endinitclip
}
frame 2 {
stop();
}
movieClip 60 {
}
movieClip 62 {
}
movieClip 64 {
}
movieClip 66 {
}
movieClip 68 {
}
movieClip 70 {
}
button 72 {
on (release) {
getURL('http://www.gimme5games.com?ref=sugar-rush_SPLASH', '_blank');
}
}
movieClip 74 {
}
movieClip 77 {
}
button 79 {
on (release) {
_root.gotoplay();
}
}
movieClip 80 {
frame 110 {
stop();
}
}
movieClip 83 {
}
movieClip 84 {
}
movieClip 86 {
}
movieClip 89 {
}
movieClip 95 {
}
movieClip 97 bonusBar {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
}
movieClip 99 bullet {
frame 1 {
onEnterFrame = function () {
i = _root.mc - 8;
while (i < _root.mc + 9) {
if (this.hitTest(_root.holder.scene['m' + i].monster.face)) {
removeMovieClip(_root.holder.scene['m' + i]);
removeMovieClip(this);
_root.sfx(6);
}
++i;
}
this._y -= 25;
if (this._y < _root.miny - 800) {
removeMovieClip(this);
}
};
}
}
movieClip 102 {
}
movieClip 104 {
}
movieClip 106 {
frame 1 {
nyk = false;
rotspeed = 20;
onEnterFrame = function () {
if (nyk) {
this._parent._alpha -= 10;
if (this._parent._alpha < 10) {
removeMovieClip(this._parent);
}
}
if (this._parent._y > _root.miny + 200) {
removeMovieClip(this._parent);
}
if (!_root.isPaused) {
if (this._parent.tipas == 1) {
this._parent._rotation += rotspeed;
if (Math.abs(this._parent._rotation) > 30) {
rotspeed = -rotspeed;
}
}
if (this._parent.tipas == 2) {
this._parent._rotation += rotspeed / 4;
}
if (_root.attract) {
if (Math.sqrt(Math.pow(_root.holder.hero._y - 20 - this._parent._y, 2) + Math.pow(_root.holder.hero._x - this._parent._x, 2)) < 300 and Math.abs(_root.holder.hero._y - this._parent._y) < 100) {
this._parent._y += (_root.holder.hero._y - 20 - this._parent._y) / 10;
this._parent._x += (_root.holder.hero._x - this._parent._x) / 8;
}
}
}
if (this.hitTest(_root.holder.hero.area)) {
if (this._parent.tipas == 2) {
_root.hitBigCandy();
}
if (this._parent.tipas == 3) {
_root.hitMegaCandy();
}
if (this._parent.tipas == 4) {
_root.hitCupcake();
}
if (this._parent.tipas > 4) {
_root.bonusTime = _root.bonusTimes[this._parent.tipas - 5];
_root.bonus = _root.bonusTime;
_root.bonusBar.gotoAndStop(this._parent.tipas - 4);
_root.power = this._parent.tipas - 4;
_root.hitBigCandy();
} else {
_root.hitCandy();
}
removeMovieClip(this._parent);
}
};
}
}
movieClip 109 {
}
movieClip 111 {
}
movieClip 114 {
}
movieClip 116 {
}
movieClip 119 {
}
movieClip 121 {
}
movieClip 124 {
}
movieClip 126 {
}
movieClip 131 {
}
movieClip 135 {
}
movieClip 139 {
}
movieClip 143 {
}
movieClip 146 {
}
movieClip 149 {
}
movieClip 153 {
}
movieClip 156 {
}
movieClip 159 {
}
movieClip 161 {
}
movieClip 166 {
}
movieClip 167 {
}
movieClip 170 {
}
movieClip 171 {
}
movieClip 173 {
}
movieClip 177 {
}
movieClip 179 {
}
movieClip 183 {
}
movieClip 186 {
}
movieClip 188 {
}
movieClip 194 candy {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
frame 5 {
stop();
}
frame 6 {
stop();
}
frame 7 {
stop();
}
frame 8 {
stop();
}
frame 9 {
stop();
}
frame 10 {
stop();
}
frame 11 {
stop();
}
frame 12 {
stop();
}
frame 13 {
stop();
}
frame 14 {
stop();
}
frame 15 {
stop();
}
}
movieClip 196 {
}
movieClip 199 {
}
movieClip 206 {
frame 1 {
stop();
}
frame 11 {
gotoAndPlay(1);
}
frame 12 {
stop();
}
}
movieClip 207 hero {
}
movieClip 209 MainSoundLoop {
frame 1 {
stop();
}
}
// unknown tag 88 length 165
movieClip 214 {
frame 15 {
stop();
}
}
button 219 {
on (release) {
_root.newGame();
}
}
button 229 {
on (release) {
_root.gotoAndPlay(4);
_root.clearStage();
}
}
movieClip 230 overGround {
}
movieClip 234 {
}
movieClip 235 {
}
button 242 {
on (release) {
nextFrame();
}
}
// unknown tag 88 length 157
button 247 {
on (release) {
_root.newGame();
}
}
movieClip 248 overScore {
frame 1 {
stop();
}
frame 2 {
stop();
removeMovieClip(_root.holder);
hiScores.setDetails(420, 0, 'sugar-rush', 'NonPH6wWyb0OFxi', false, _root.score, _root.score, ' up in the sky!', false);
}
instance hiScores of movieClip 45 ZattikkaHiScores {
onClipEvent (construct) {
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
}
frame 3 {
_root.gotoMenu();
}
}
movieClip 251 Parallax1 {
}
movieClip 260 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
button 261 {
on (release) {
_root.flipSound();
}
}
movieClip 262 control {
frame 1 {
s = new Sound();
s.attachSound('mysound');
s.setVolume(100);
s.start(0, 50000);
}
frame 2 {
stop();
}
frame 3 {
s.setVolume(0);
stop();
}
frame 4 {
s.setVolume(100);
gotoAndStop(2);
}
}
button 265 {
on (release) {
_root.pauze();
_root.gotoMenu();
_root.clearStage();
}
}
button 267 {
on (release) {
_root.pauze();
}
}
movieClip 272 {
}
movieClip 273 {
}
movieClip 276 {
}
movieClip 277 {
}
movieClip 279 pauzeMC {
}
movieClip 281 puff {
frame 14 {
removeMovieClip(this);
}
}
movieClip 283 {
}
movieClip 290 {
}
movieClip 291 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 293 {
}
button 294 {
on (release) {
getURL('http://www.gimme5games.com?ref=sugar-rush_INGAMELOGO', '_blank');
}
}
movieClip 295 score {
}
movieClip 297 sfx1 {
frame 1 {
if (_root.started == undefined) {
removeMovieClip(this);
}
}
frame 14 {
removeMovieClip(this);
}
}
movieClip 299 sfx2 {
frame 1 {
if (_root.started == undefined) {
removeMovieClip(this);
}
}
frame 48 {
removeMovieClip(this);
}
}
movieClip 301 sfx3 {
frame 1 {
if (_root.started == undefined) {
removeMovieClip(this);
}
}
frame 17 {
removeMovieClip(this);
}
}
movieClip 303 sfx4 {
frame 1 {
if (_root.started == undefined) {
removeMovieClip(this);
}
}
frame 17 {
removeMovieClip(this);
}
}
movieClip 305 sfx5 {
frame 1 {
if (_root.started == undefined) {
removeMovieClip(this);
}
}
frame 23 {
removeMovieClip(this);
}
}
movieClip 306 sfx6 {
frame 1 {
if (_root.started == undefined) {
removeMovieClip(this);
}
}
frame 23 {
removeMovieClip(this);
}
}
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;
var pv;
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);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&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);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
__com_mochibot__('c348fdb1', this, 10301, true);
}
frame 4 {
function startPlay() {
gotoAndPlay(5);
}
stop();
menuPos = 0;
started = true;
onEnterFrame = function () {
mainmenu._x += (menuPos - mainmenu._x) / 5;
};
}
movieClip 309 {
}
movieClip 310 {
}
button 311 {
on (release) {
_root.startPlay();
}
}
// unknown tag 88 length 75
button 328 {
on (release) {
getURL('http://flixic.com', '_blank');
}
}
movieClip 331 {
}
movieClip 334 {
}
button 336 {
on (release) {
_root.menuPos = 0;
}
}
button 341 {
on (release) {
_root.menuPos = -360;
}
}
button 342 {
on (release) {
getURL('http://www.gimme5games.com?ref=sugar-rush_TITLE', '_blank');
}
}
movieClip 344 {
}
movieClip 345 {
}
frame 5 {
function gotoMenu() {
_root.gotoAndPlay(2);
}
function newPlatform(xpos, ypos, type) {
_root.holder.scene.attachMovie('candy', 'p' + _root.pc, _root.holder.scene.getNextHighestDepth());
_root.holder.scene['p' + _root.pc]._x = xpos;
_root.holder.scene['p' + _root.pc]._y = ypos;
_root.holder.scene['p' + _root.pc].tipas = type;
if (type == 1) {
_root.holder.scene['p' + _root.pc].gotoAndPlay(random(5) + 1);
} else {
if (type == 2) {
_root.holder.scene['p' + _root.pc].gotoAndPlay(random(3) + 6);
} else {
if (type == 3) {
_root.holder.scene['p' + _root.pc].gotoAndPlay(random(2) + 9);
} else {
if (type == 4) {
_root.holder.scene['p' + _root.pc].gotoAndPlay(11);
} else {
if (type == 5) {
_root.holder.scene['p' + _root.pc].gotoAndPlay(12);
} else {
if (type == 6) {
_root.holder.scene['p' + _root.pc].gotoAndPlay(13);
} else {
if (type == 7) {
_root.holder.scene['p' + _root.pc].gotoAndPlay(14);
} else {
if (type == 8) {
_root.holder.scene['p' + _root.pc].gotoAndPlay(15);
}
}
}
}
}
}
}
}
++_root.pc;
_root.minUpper = ypos;
}
function makePlatforms(mega) {
_root.lastMega = mega;
mega *= -1;
upper = _root.minUpper - 50;
newCupcake = true;
while (upper > (mega - 1) * 1000) {
iks = Math.random() * 280 - 140;
tipas = 1;
randomNumber = Math.random() * 100;
if (randomNumber > 95 and mega % 5 == 0 and newCupcake and mega < -4) {
tipas = 4;
newCupcake = false;
} else {
if (randomNumber > 90 and mega % 4 == 0 and newCupcake and mega < -2) {
tipas = random(4) + 5;
newCupcake = false;
} else {
if (randomNumber > 95) {
tipas = 3;
} else {
if (randomNumber > 90) {
tipas = 2;
}
}
}
}
newPlatform(iks, upper, tipas);
upper -= lvlDismin[level] + random(lvlDismax[level] - lvlDismin[level]);
}
}
function startJump() {
_root.onMouseDown = function () {
if (!isPaused) {
if (_root.mana >= 100) {
mana -= 100;
if (_root.holder.hero.yspeed < 30 * jumpPower) {
_root.holder.hero.yspeed = 30 * jumpPower;
}
sfx(3);
puff();
} else {
sfx(4);
}
}
};
}
function puff() {
i = 1;
while (i < 10) {
_root.holder.scene.attachMovie('puff', 'puff' + _root.bc, _root.holder.scene.getNextHighestDepth());
_root.holder.scene['puff' + _root.bc]._x = _root.holder.hero._x + random(60) - 30;
_root.holder.scene['puff' + _root.bc]._y = _root.holder.hero._y - 40 - random(80);
_root.holder.scene['puff' + _root.bc]._width = random(50) + 15;
_root.holder.scene['puff' + _root.bc]._height = _root.holder.scene['puff' + _root.bc]._width;
++_root.bc;
++i;
}
}
function hitCandy() {
if (_root.holder.hero.yspeed < 20 * jumpPower) {
_root.holder.hero.yspeed = 20 * jumpPower;
}
_root.holder.hero.mouth.gotoAndPlay(2);
sfx(1);
mana += 1;
}
function hitBigCandy() {
if (_root.holder.hero.yspeed < 28 * jumpPower) {
_root.holder.hero.yspeed = 28 * jumpPower;
}
_root.holder.hero.mouth.gotoAndPlay(2);
sfx(1);
mana += 3;
}
function hitMegaCandy() {
if (_root.holder.hero.yspeed < 36 * jumpPower) {
_root.holder.hero.yspeed = 36 * jumpPower;
}
_root.holder.hero.mouth.gotoAndPlay(2);
sfx(1);
mana += 5;
}
function hitCupcake() {
if (_root.holder.hero.yspeed < 60 * jumpPower) {
_root.holder.hero.yspeed = 60 * jumpPower;
}
_root.holder.hero.mouth.gotoAndPlay(2);
sfx(1);
mana += 10;
}
function clearStage() {
removeMovieClip(_root.holder.hero);
removeMovieClip(_root.scoreMC);
removeMovieClip(_root.pauzeMC);
removeMovieClip(_root.holder);
removeMovieClip(_root.px);
removeMovieClip(_root.overScore);
removeMovieClip(_root.bonusBar);
stopAllSounds();
_root.onMouseDown = function () {};
}
function gameOver() {
mochi.as2.MochiEvents.endPlay();
_root.scored = _root.score;
scoretext = score.toString();
_root.overSocre.rezultatas.text = scored;
_root.overScore._x = 0;
removeMovieClip(_root.holder.hero);
removeMovieClip(_root.pauzeMC);
removeMovieClip(_root.bonusBar);
isPaused = true;
isOver = true;
}
function newGame() {
clearStage();
pc = 1;
bc = 1;
sfxc = 1;
score = 0;
mana = 0;
level = 0;
isPaused = false;
isOver = false;
screamed = false;
bonus = 0;
power = 1;
bonusTime = 200;
_root.createEmptyMovieClip('px', _root.getNextHighestDepth());
_root.px.attachMovie('Parallax1', 'px11', _root.px.getNextHighestDepth());
px.px11._x = 0;
px.px11._y = 600;
px11s = 0;
_root.px.attachMovie('Parallax1', 'px12', _root.px.getNextHighestDepth());
px.px12._x = 0;
px.px12._y = 600 - px.px11._height;
px12s = 0;
_root.px.attachMovie('Parallax1', 'px1a', _root.px.getNextHighestDepth());
px.px1a._x = 0;
px.px1a._y = 600 + px.px11._height;
_root.px.attachMovie('Parallax1', 'px1b', _root.px.getNextHighestDepth());
px.px1b._x = 0;
px.px1b._x = 600 + 2 * px.px11._height;
_root.attachMovie('overScore', 'overScore', _root.getNextHighestDepth());
_root.overScore._alpha = 0;
_root.overScore._x = 5000;
_root.createEmptyMovieClip('holder', _root.getNextHighestDepth());
_root.holder.createEmptyMovieClip('scene', _root.getNextHighestDepth());
_root.holder.attachMovie('hero', 'hero', _root.holder.getNextHighestDepth());
_root.attachMovie('score', 'scoreMC', _root.getNextHighestDepth());
_root.holder.attachMovie('overGround', 'overGround', _root.holder.getNextHighestDepth());
_root.attachMovie('bonusBar', 'bonusBar', _root.getNextHighestDepth());
_root.attachMovie('pauzeMC', 'pauzeMC', _root.getNextHighestDepth());
holder._x = 180;
holder._y = 0;
holder.hero._x = 0;
holder.hero._y = 0;
holder.hero.yspeed = 20;
holder.overGround._x = -180;
holder.overGround._y = 5000;
pauzeMC._x = 180;
pauzeMC._y = 300;
pauzeMC._visible = false;
miny = 300;
bonusBar._y = 700;
normalWidth = 100;
normalHeight = 100;
attract = false;
jumpPower = 1;
followPower = 0.5;
if (!yraGarsas) {
_root.pauzeMC.soundStatus.gotoAndPlay(2);
_root.pauzeMC.soundControl.gotoAndPlay(3);
}
attachMovie('MainSoundLoop', 'sfxas' + sfxc, _root.getNextHighestDepth());
++sfxc;
newPlatform(0, 450, 1);
makePlatforms(-1);
mochi.as2.MochiEvents.startPlay('normal');
startJump();
}
function flipSound() {
if (_root.yraGarsas) {
_root.pauzeMC.soundStatus.gotoAndPlay(2);
_root.pauzeMC.soundControl.gotoAndPlay(3);
} else {
_root.pauzeMC.soundStatus.gotoAndPlay(1);
_root.pauzeMC.soundControl.gotoAndPlay(4);
}
_root.yraGarsas = !_root.yraGarsas;
}
function pauze() {
i = 1;
while (i <= _root.bc) {
removeMovieClip(_root.holder.scene['b' + i]);
++i;
}
if (!isPaused) {
isPaused = true;
pauzeMC._visible = true;
} else {
isPaused = false;
pauzeMC._visible = false;
}
}
function sfx(type) {
if (yraGarsas) {
attachMovie('sfx' + type, 'sfxas' + sfxc, _root.getNextHighestDepth());
++sfxc;
}
}
stop();
lvlHeight = [0, 3, 6, 10, 18, 30, 50, 70, 100, 1000000000];
lvlDismin = [40, 40, 45, 50, 55, 65, 100, 120, 140];
lvlDismax = [70, 80, 100, 120, 140, 160, 170, 175, 180];
timerWidth = 260;
bonusTimes = [180, 250, 200, 140];
onEnterFrame = function () {
if (_root.holder.hero._y - 1800 < miny) {
if (_root.holder.hero.yspeed > 0) {
zone = 300;
} else {
zone = 300;
}
holdersmooth = -1 * _root.holder.hero._y + zone;
_root.holder._y += (holdersmooth - _root.holder._y) / 1;
_root.px.px11._y = 600 + _root.holder._y / 4 + px11s;
_root.px.px12._y = 600 + _root.holder._y / 4 - _root.px.px11._height + px12s;
if (_root.px.px11._y > _root.px.px11._height + 600) {
_root.px11s -= 2 * _root.px.px11._height;
}
if (_root.px.px12._y > _root.px.px11._height + 600) {
_root.px12s -= 2 * _root.px.px11._height;
}
if (_root.px.px11._y > _root.px.px12._y) {
_root.px.px1a._y = _root.px.px11._y + _root.px.px11._height;
} else {
_root.px.px1a._y = _root.px.px12._y + _root.px.px11._height;
}
_root.px.px1b._y = _root.px.px1a._y + _root.px.px11._height;
_root.px.px21._y = 600 + _root.holder._y / 2 + px21s;
_root.px.px22._y = 600 + _root.holder._y / 2 - _root.px.px21._height + px22s;
if (_root.px.px21._y > _root.px.px21._height + 600) {
_root.px21s -= 2 * _root.px.px21._height;
}
if (_root.px.px22._y > _root.px.px21._height + 600) {
_root.px22s -= 2 * _root.px.px21._height;
}
if (_root.px.px21._y > _root.px.px22._y) {
_root.px.px2a._y = _root.px.px21._y + _root.px.px21._height;
} else {
_root.px.px2a._y = _root.px.px22._y + _root.px.px21._height;
}
_root.px.px2b._y = _root.px.px2a._y + _root.px.px21._height;
}
if (_root.holder.hero._y + 400 < miny) {
score = _root.holder._y;
miny = _root.holder.hero._y + 400;
}
if (miny < _root.lastMega * -1000) {
if (_root.lastMega + 1 == lvlHeight[level + 1]) {
level += 1;
}
makePlatforms(_root.lastMega + 1);
}
if (!isPaused) {
_root.holder.hero.xspeed = Math.pow(Math.abs(_root._xmouse - _root.holder.hero._x - 180) / 2, followPower);
if (_root._xmouse - _root.holder.hero._x - 180 < 0) {
_root.holder.hero.xspeed *= -1;
}
_root.holder.hero.yspeed -= 1;
if (_root.mana >= 100) {
_root.scoreMC.energy.gotoAndPlay(2);
} else {
_root.scoreMC.energy.gotoAndPlay(1);
}
if (_root.holder.hero.yspeed < -15) {
_root.holder.hero.mouth.gotoAndPlay(12);
}
if (_root.holder.hero._y > miny + 600 and !screamed) {
sfx(5);
screamed = true;
}
_root.holder.hero._x += _root.holder.hero.xspeed;
_root.holder.hero._y -= _root.holder.hero.yspeed;
_root.holder.hero._rotation = _root.holder.hero.xspeed * 2;
_root.holder.hero.eye1._rotation = -_root.holder.hero._rotation;
_root.holder.hero.eye2._rotation = -_root.holder.hero._rotation;
_root.holder.overGround._y = miny + 2060;
if (bonus <= 0 and bonusBar._y < 700) {
bonusBar._y += (702 - bonusBar._y) / 10;
}
if (bonus > 0 and bonusBar._y > 600) {
bonusBar._y += (598 - bonusBar._y) / 10;
}
bonusBar['timer' + power]._width = (bonus / bonusTime) * timerWidth;
if (bonus > 0) {
--bonus;
}
if (power == 1 and bonus > 0) {
attract = true;
} else {
attract = false;
}
if (power == 2 and bonus > 0) {
heroWidth = 200;
heroHeight = 200;
} else {
heroWidth = 100;
heroHeight = 100;
}
if (power == 3 and bonus > 0) {
followPower = 0.8;
} else {
followPower = 0.5;
}
if (power == 4 and bonus > 0) {
jumpPower = 2;
} else {
jumpPower = 1;
}
_root.holder.hero._xscale += (heroWidth - _root.holder.hero._xscale) / 5;
_root.holder.hero._yscale += (heroHeight - _root.holder.hero._yscale) / 5;
if (_root.holder.hero._y > miny + 2000) {
gameOver();
}
}
if (isOver) {
if (_root.px._alpha > 0) {
_root.px._alpha -= 5;
} else {
removeMovieClip(_root.px);
}
if (_root.scoreMC._y > -50) {
_root.scoreMC._y -= 2;
_root.scoreMC._alpha -= 5;
} else {
removeMovieClip(_root.scoreMC);
}
if (_root.overScore._alpha < 100) {
_root.overScore._alpha += 5;
}
}
};
newGame();
}
button 347 {
on (keyPress '<Space>') {
_root.pauze();
}
on (keyPress 'm') {
_root.flipSound();
}
}