Combined Code
frame 1 {
_root.API_Settings = {'movie_id': 7281, 'enc_key': '59z4IdM9LAUMZgfHGKQV83pGiiZkl8Rb', 'debug_mode': false, 'movie_version': ''};
}
// unknown tag 88 length 68
movieClip 16 {
}
movieClip 21 {
}
movieClip 22 {
}
movieClip 25 {
}
movieClip 26 {
}
movieClip 28 {
}
movieClip 32 {
}
movieClip 33 {
}
movieClip 36 {
}
movieClip 40 {
}
movieClip 43 {
}
movieClip 44 {
}
movieClip 46 {
}
movieClip 47 {
}
movieClip 48 {
}
movieClip 49 {
}
movieClip 51 {
}
button 52 {
on (release) {
getURL('http://www.newgrounds.com', '_blank');
}
}
movieClip 55 {
}
button 61 {
on (release) {
startMovie();
}
}
movieClip 63 {
frame 1 {
function timerHandler() {
if (!loadingComplete) {
var v4 = _root.getBytesLoaded() / _root.getBytesTotal();
bar._xscale = 100 * v4;
if (v4 == 1) {
loadingComplete = true;
if (AUTO_PLAY) {
startMovie();
} else {
gotoAndStop('loaded');
}
return undefined;
}
}
dt = getTimer() - time;
time += dt;
frameAccum += dt;
var v3 = 0;
for (;;) {
if (!(frameAccum >= FRAME_TIME && v3 < MAX_FRAME_SKIP)) break;
advanceFrame(tankLogo, true, true);
advanceFrame(loadingText, false, true);
advanceFrame(barGfx, false, true);
if (loadingComplete) {
advanceFrame(this, false, false);
}
frameAccum -= FRAME_TIME;
v3++;
}
updateAfterEvent();
}
function advanceFrame(clip, recurse, loop) {
if (!clip) {
return undefined;
}
clip.stop();
if (clip._currentframe == clip._totalframes) {
if (loop) {
clip.gotoAndStop(1);
}
} else {
clip.nextFrame();
}
if (recurse) {
for (childName in clip) {
if (typeof clip[childName] == 'movieclip') {
advanceFrame(clip[childName], recurse, loop);
}
}
}
}
function startMovie() {
clearInterval(intervalId);
_root.play();
}
_root.stop();
stop();
var FRAME_TIME = 33.33333333333334;
var AUTO_PLAY = false;
var MAX_FRAME_SKIP = 5;
var loadingComplete;
var intervalId;
var time;
var frameAccum;
loadingComplete = false;
intervalId = setInterval(this, 'timerHandler', FRAME_TIME / 2);
frameAccum = 0;
time = getTimer();
timerHandler();
}
frame 2 {
stop();
}
}
button 66 {
on (release) {
this._visible = false;
}
}
// unknown tag 88 length 68
// unknown tag 88 length 62
movieClip 75 {
frame 1 {
_visible = false;
var checkConnection = function (event) {
if (!event.success) {
_visible = true;
gotoAndStop(3);
}
};
if (com.Newgrounds.NewgroundsAPI.isNewgrounds() || _root.API_Settings.debug_mode) {
com.Newgrounds.NewgroundsAPI.addEventListener(com.Newgrounds.NewgroundsAPI.events.MOVIE_CONNECTED, checkConnection);
if (!com.Newgrounds.NewgroundsAPI.hasUserSession() && !_root.API_Settings.debug_mode) {
_visible = true;
gotoAndStop(2);
}
}
com.Newgrounds.NewgroundsAPI.setMovieVersion(_root.API_Settings.movie_version);
com.Newgrounds.NewgroundsAPI.connectMovie(_root.API_Settings.movie_id, _root.API_Settings.enc_key, _root.API_Settings.debug_mode);
com.Newgrounds.NewgroundsAPI.loadMedals();
stop();
}
}
movieClip 79 {
}
instance of movieClip 79 {
onClipEvent (load) {
this.swapDepths(100000001);
}
}
movieClip 217 __Packages.com.Newgrounds.BaseN {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.Newgrounds) {
_global.com.Newgrounds = new Object();
}
if (!_global.com.Newgrounds.BaseN) {
var v1 = function (hash) {
this.ceiling = 100000000000000.0;
if (hash) {
this.hashIndex = hash;
} else {
this.hashIndex = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/';
}
this.bitSize = this.hashIndex.length;
this.hashVal = new Object();
this.i = 0;
while (this.i < this.bitSize) {
this.hashVal[this.hashIndex.charAt(this.i)] = this.i;
++this.i;
}
};
com.Newgrounds.BaseN = v1;
var v2 = v1.prototype;
v2.verify = function (s) {
if (this.hashVal[s] != undefined) {
return true;
} else {
return false;
}
};
v2.encode = function (n, minchars) {
this.debug.lastencode = '';
if (typeof this.i != 'string') {
n = n.toString();
}
if (n.charAt(0) == '-') {
var v3 = '-';
n = n.substring(1);
} else {
var v3 = '';
}
if ((String(n)).indexOf('.') > -1) {
var v4 = (String(n)).split('.', 2);
return v3 + this.baseNEncoder(v4[0], minchars) + '.' + this.baseNEncoder(v4[1]);
} else {
this.debug.lastencode += '\tNo decimal\r';
return v3 + this.baseNEncoder(n, minchars);
}
};
v2.decode = function (s) {
var v4 = 1;
if (s.charAt(0) == '-') {
v4 = -1;
s = s.substring(1, s.length);
}
var v3 = s.indexOf('.');
if (v3 > -1) {
var v5 = Math.pow(10, this.baseNDecoder(s.substring(v3 + 1, s.length)));
return (this.baseNDecoder(s.substring(0, v3)) / v5) * v4;
} else {
return this.baseNDecoder(s) * v4;
}
};
v2.baseNEncoder = function (n, minchars) {
if (!minchars) {
minchars = 1;
}
var v4 = '';
while (n != 0) {
n = Math.round(n);
var v3 = n % this.bitSize;
if (Math.round(v3) != v3) {
trace('BaseN failed on ' + n + '%' + this.bitSize + ' = ' + v3 + ' ' + int(n) + ' ' + int(this.bitSize));
}
v4 = this.hashIndex.charAt(v3) + v4;
this.debug.lastencode += '\t-> n:' + n + ' % bitSize:' + this.bitSize + ' = ' + v3 + ', final char=' + v4 + '\n';
n -= v3;
n /= this.bitSize;
}
if (minchars) {
while (v4.length < minchars) {
v4 = this.hashIndex.charAt(0) + v4;
}
}
return v4;
};
v2.baseNDecoder = function (s) {
var v2 = 0;
var v6 = 0;
this.i = 0;
while (this.i < s.length) {
var v3 = s.charAt(s.length - this.i - 1);
if (v3 == this.hashIndex.charAt(0)) {
var v5 = 0;
} else {
var v5 = this.hashVal[v3] * Math.pow(this.bitSize, this.i);
}
v2 += v5;
if (v2 >= this.ceiling) {
v6 += (v2 - v2 % this.ceiling) / this.ceiling;
v2 %= this.ceiling;
}
++this.i;
}
if (v6 > 0) {
v2 = '' + v2;
while (v2.length < (this.ceiling.toString()).length - 1) {
v2 = '0' + v2;
}
v2 = '' + v6 + v2;
}
return v2;
};
v2.debug = new Object();
ASSetPropFlags(com.Newgrounds.BaseN.prototype, null, 1);
}
#endinitclip
}
movieClip 218 __Packages.com.Newgrounds.NewgroundsAPIError {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.Newgrounds) {
_global.com.Newgrounds = new Object();
}
if (!_global.com.Newgrounds.NewgroundsAPIError) {
var v1 = function (error, msg) {
if ((Number(error)).toString() == String(error)) {
error = Number(error);
} else {
if (com.Newgrounds.NewgroundsAPIError.error_codes[String(error)]) {
error = com.Newgrounds.NewgroundsAPIError.error_codes[String(error)];
} else {
error = 0;
}
}
this.code = error;
this.message = msg;
this.name = com.Newgrounds.NewgroundsAPIError.error_names[error];
this.alias = com.Newgrounds.NewgroundsAPIError.aliases[error];
};
com.Newgrounds.NewgroundsAPIError = v1;
var v2 = v1.prototype;
v1.init_codes = function () {
var v2 = new Object();
var v1 = 0;
while (v1 < com.Newgrounds.NewgroundsAPIError.aliases.length) {
v2[com.Newgrounds.NewgroundsAPIError.aliases[v1]] = v1;
++v1;
}
return v2;
};
v1.init_names = function () {
var v5 = new Array();
var v3 = 0;
while (v3 < com.Newgrounds.NewgroundsAPIError.aliases.length) {
var v2 = (com.Newgrounds.NewgroundsAPIError.aliases[v3].toLowerCase()).split('_');
var v1 = 0;
while (v1 < v2.length) {
v2[v1] = (v2[v1].substr(0, 1)).toUpperCase() + v2[v1].substr(1, v2[v1].length);
for (var v4 in com.Newgrounds.NewgroundsAPIError.always_caps) {
if (v2[v1].toUpperCase() == com.Newgrounds.NewgroundsAPIError.always_caps[v4]) {
v2[v1] = v2[v1].toUpperCase();
}
}
++v1;
}
v5[v3] = v2.join(' ');
++v3;
}
return v5;
};
v2.isError = function () {
return true;
};
v1.aliases = new Array('UNKNOWN_ERROR', 'INVALID_API_ID', 'MISSING_PARAM', 'INVALID_STAT_ID', 'INVALID_COMMAND_ID', 'FLASH_ADS_NOT_APPROVED', 'PERMISSION_DENIED', 'IDENTIFICATION_REQUIRED', 'INVALID_EMAIL_ADDRESS', 'BANNED_USER', 'SESSION_EXPIRED', 'INVALID_SCORE', 'INVALID_MEDAL', 'INVALID_FOLDER', 'FILE_NOT_FOUND', 'SITE_ID_REQUIRED', 'UPLOAD_IN_PROGRESS', 'USER_CANCELLED', 'CONFIRM_REQUEST', 'CONNECTION_FAILED');
v1.always_caps = new Array('API', 'URL', 'ID');
v1.error_codes = com.Newgrounds.NewgroundsAPIError.init_codes();
v1.error_names = com.Newgrounds.NewgroundsAPIError.init_names();
v2.code = 0;
ASSetPropFlags(com.Newgrounds.NewgroundsAPIError.prototype, null, 1);
}
#endinitclip
}
movieClip 219 __Packages.com.Newgrounds.NewgroundsAPI {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.Newgrounds) {
_global.com.Newgrounds = new Object();
}
if (!_global.com.Newgrounds.NewgroundsAPI) {
var v1 = function () {};
com.Newgrounds.NewgroundsAPI = v1;
var v2 = v1.prototype;
v1.setMovieVersion = function (v) {
if (v) {
com.Newgrounds.NewgroundsAPI.version = String(v);
}
};
v1.setUserEmail = function (e) {
com.Newgrounds.NewgroundsAPI.user_email = e;
};
v1.getOfficialVersionURL = function () {
var v1 = com.Newgrounds.NewgroundsAPI.GATEWAY_URL + '?tracker_id=' + com.Newgrounds.NewgroundsAPI.movie_id + '&command_id=' + com.Newgrounds.NewgroundsAPI.getCommandID('loadOfficalVersion') + '&seed=' + Math.random();
if (com.Newgrounds.NewgroundsAPI.debug) {
v1 += '&debug=1';
}
return v1;
};
v1.hasUserSession = function () {
if (com.Newgrounds.NewgroundsAPI.session_id && com.Newgrounds.NewgroundsAPI.publisher_id) {
return true;
return false;
}
if (_root.NewgroundsAPI_PublisherID && _root.NewgroundsAPI_SessionID) {
return true;
}
return false;
};
v1.isNewgrounds = function () {
return com.Newgrounds.NewgroundsAPI.publisher_id == 1 || _root.NewgroundsAPI_PublisherID == 1 || ((com.Newgrounds.NewgroundsAPI.getHost()).toLowerCase()).indexOf('ungrounded.net') > -1;
};
v1.hasPublisher = function () {
return com.Newgrounds.NewgroundsAPI.publisher_id || _root.NewgroundsAPI_PublisherID;
};
v1.hasUserEmail = function () {
if (com.Newgrounds.NewgroundsAPI.user_email) {
return true;
}
return false;
};
v1.connectionTimeOut = function () {
clearInterval(com.Newgrounds.NewgroundsAPI.timeout);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.MOVIE_CONNECTED, false, new com.Newgrounds.NewgroundsAPIError('CONNECTION_FAILED', 'Connection to NewgroundsAPI gateway timed out.'));
};
v1.connectMovie = function (m_id, encrypt_key, debug_mode) {
if (com.Newgrounds.NewgroundsAPI.connected) {
return undefined;
}
var v2 = function () {
com.Newgrounds.NewgroundsAPI.connectionTimeOut();
};
com.Newgrounds.NewgroundsAPI.timeout = setInterval(v2, 8000, null);
if (!m_id) {
com.Newgrounds.NewgroundsAPI.fatalError('NewgroundsAPI.connectMovie() - missing required movie_id parameter', 'connectMovie');
}
com.Newgrounds.NewgroundsAPI.movie_id = String(m_id);
com.Newgrounds.NewgroundsAPI.tracker_id = Number(com.Newgrounds.NewgroundsAPI.movie_id.substring(0, com.Newgrounds.NewgroundsAPI.movie_id.indexOf(':')));
com.Newgrounds.NewgroundsAPI.encryption_key = encrypt_key;
com.Newgrounds.NewgroundsAPI.debug = debug_mode;
if (_root.NewgroundsAPI_PublisherID) {
com.Newgrounds.NewgroundsAPI.publisher_id = _root.NewgroundsAPI_PublisherID;
if (_root.NewgroundsAPI_SessionID) {
com.Newgrounds.NewgroundsAPI.session_id = _root.NewgroundsAPI_SessionID;
}
} else {
com.Newgrounds.NewgroundsAPI.publisher_id = 1;
com.Newgrounds.NewgroundsAPI.session_id = null;
com.Newgrounds.NewgroundsAPI.user_id = 0;
com.Newgrounds.NewgroundsAPI.user_name = 'Guest';
}
if (_root.NewgroundsAPI_UserName) {
com.Newgrounds.NewgroundsAPI.user_name = _root.NewgroundsAPI_UserName;
}
if (_root.NewgroundsAPI_UserID) {
com.Newgrounds.NewgroundsAPI.user_id = _root.NewgroundsAPI_UserID;
}
com.Newgrounds.NewgroundsAPI.connected = true;
com.Newgrounds.NewgroundsAPI.sendCommand('connectMovie', {'host': com.Newgrounds.NewgroundsAPI.getHost(), 'movie_version': com.Newgrounds.NewgroundsAPI.version});
};
v1.getHost = function () {
if (!com.Newgrounds.NewgroundsAPI.host) {
var v1 = _url;
if (v1.indexOf('http://') > -1 or v1.indexOf('https://') > -1) {
com.Newgrounds.NewgroundsAPI.host = (v1.split('/'))[2].toLowerCase();
return com.Newgrounds.NewgroundsAPI.host;
}
com.Newgrounds.NewgroundsAPI.host = 'localhost';
}
return com.Newgrounds.NewgroundsAPI.host;
};
v1.loadNewgrounds = function () {
com.Newgrounds.NewgroundsAPI.sendCommand('loadNewgrounds', {'host': com.Newgrounds.NewgroundsAPI.getHost()}, true);
};
v1.loadMySite = function () {
com.Newgrounds.NewgroundsAPI.sendCommand('loadMySite', {'host': com.Newgrounds.NewgroundsAPI.getHost()});
};
v1.loadCustomLink = function (link) {
com.Newgrounds.NewgroundsAPI.sendCommand('loadCustomLink', {'host': com.Newgrounds.NewgroundsAPI.getHost(), 'link': link}, true);
};
v1.logCustomEvent = function (event) {
com.Newgrounds.NewgroundsAPI.sendCommand('logCustomEvent', {'host': com.Newgrounds.NewgroundsAPI.getHost(), 'event': event});
};
v1.postScore = function (score, value, get_best) {
if (!score or value == undefined) {
com.Newgrounds.NewgroundsAPI.sendError({'command_id': com.Newgrounds.NewgroundsAPI.getCommandID('postScore')}, new com.Newgrounds.NewgroundsAPIError('MISSING_PARAM', 'missing required parameter(s)'));
return undefined;
}
com.Newgrounds.NewgroundsAPI.sendSecureCommand('postScore', {'score': score, 'value': value, 'get_best': get_best});
};
v1.getTodaysScores = function (score, params) {
com.Newgrounds.NewgroundsAPI.getScores(score, 't', params, 'getTodaysScores');
};
v1.getYesterdaysScores = function (score, params) {
com.Newgrounds.NewgroundsAPI.getScores(score, 'y', params, 'getYesterdaysScores');
};
v1.getThisWeeksScores = function (score, params) {
com.Newgrounds.NewgroundsAPI.getScores(score, 'w', params, 'getThisWeeksScores');
};
v1.getThisMonthsScores = function (score, params) {
com.Newgrounds.NewgroundsAPI.getScores(score, 'm', params, 'getThisMonthsScores');
};
v1.getThisYearsScores = function (score, params) {
com.Newgrounds.NewgroundsAPI.getScores(score, 'y', params, 'getThisYearsScores');
};
v1.getAlltimeScores = function (score, params) {
com.Newgrounds.NewgroundsAPI.getScores(score, 'a', params, 'getAlltimeScores');
};
v1.getScores = function (score, period, params, command_name) {
if (!score) {
com.Newgrounds.NewgroundsAPI.sendError({'command_id': com.Newgrounds.NewgroundsAPI.getCommandID(command_name)}, new com.Newgrounds.NewgroundsAPIError('MISSING_PARAM', 'missing required score name'));
return undefined;
}
if (!params) {
params = new Object();
}
if (!com.Newgrounds.NewgroundsAPI.hasUserSession()) {
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.SCORES_LOADED, false, new com.Newgrounds.NewgroundsAPIError('SITE_ID_REQUIRED', 'Host \'' + com.Newgrounds.NewgroundsAPI.getHost() + '\' does not have high scores enabled'));
return undefined;
}
params.publisher_id = com.Newgrounds.NewgroundsAPI.publisher_id;
params.period = period;
params.score = score;
if (params.user_id) {
var v3 = period;
} else {
var v3 = period + '-u';
}
if (com.Newgrounds.NewgroundsAPI.score_page_counts[v3] == undefined) {
params.request_page_count = true;
}
com.Newgrounds.NewgroundsAPI.sendCommand('getScores', params);
};
v1.unlockMedal = function (medal, get_score) {
if (!medal) {
com.Newgrounds.NewgroundsAPI.sendError({'command_id': com.Newgrounds.NewgroundsAPI.getCommandID('unlockMedal')}, new com.Newgrounds.NewgroundsAPIError('MISSING_PARAM', 'missing required medal name'));
return undefined;
}
var v1 = new Object();
v1.medal = medal;
if (get_score) {
v1.get_score = get_score;
}
com.Newgrounds.NewgroundsAPI.sendSecureCommand('unlockMedal', v1);
};
v1.loadMedals = function () {
if (com.Newgrounds.NewgroundsAPI.medals) {
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.MEDALS_LOADED, true, {'medals': com.Newgrounds.NewgroundsAPI.medals});
return undefined;
}
var v1 = new Object();
if (com.Newgrounds.NewgroundsAPI.hasUserSession()) {
v1.publisher_id = com.Newgrounds.NewgroundsAPI.publisher_id;
v1.user_id = com.Newgrounds.NewgroundsAPI.user_id;
}
com.Newgrounds.NewgroundsAPI.sendCommand('getMedals', v1);
};
v1.getMedals = function () {
return com.Newgrounds.NewgroundsAPI.medals;
};
v1.saveLocal = function (save_id, save_data, size_allocation) {
if (!com.Newgrounds.NewgroundsAPI.sharedObjects[save_id]) {
com.Newgrounds.NewgroundsAPI.sharedObjects[save_id] = SharedObject.getLocal('ng_ap_secure_' + com.Newgrounds.NewgroundsAPI.movie_id + '_' + save_id);
}
com.Newgrounds.NewgroundsAPI.sharedObjects[save_id].data[save_id] = com.Newgrounds.NewgroundsAPI.encodeData(save_data);
com.Newgrounds.NewgroundsAPI.sharedObjects[save_id].flush();
};
v1.loadLocal = function (save_id) {
if (!com.Newgrounds.NewgroundsAPI.sharedObjects[save_id]) {
com.Newgrounds.NewgroundsAPI.sharedObjects[save_id] = SharedObject.getLocal('ng_ap_secure_' + com.Newgrounds.NewgroundsAPI.movie_id + '_' + save_id);
}
com.Newgrounds.NewgroundsAPI.sharedObjects[save_id].flush();
if (com.Newgrounds.NewgroundsAPI.sharedObjects[save_id].data[save_id]) {
return com.Newgrounds.NewgroundsAPI.decodeData(com.Newgrounds.NewgroundsAPI.sharedObjects[save_id].data[save_id]);
} else {
return null;
}
};
v1.encodeData = function (data) {
return com.Newgrounds.NewgroundsAPI.compressHex(com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(data), com.Newgrounds.NewgroundsAPI.encryption_key));
};
v1.decodeData = function (base) {
return com.Newgrounds.JSON.decode(com.Newgrounds.RC4.decrypt(com.Newgrounds.NewgroundsAPI.uncompressHex(base), com.Newgrounds.NewgroundsAPI.encryption_key));
};
v1.compressHex = function (hex_value) {
var v5 = hex_value.length % 6;
var v4 = '';
var v1 = 0;
while (v1 < hex_value.length) {
var v2 = Number('0x' + hex_value.substr(v1, 6));
v4 += com.Newgrounds.NewgroundsAPI.compressor.encode(v2, 4);
v1 += 6;
}
return v5 + v4;
};
v1.uncompressHex = function (base_value) {
var v8 = Number(base_value.charAt(0));
var v7 = '';
var v3;
var v2 = 1;
while (v2 < base_value.length) {
var v6 = base_value.substr(v2, 4);
var v5 = com.Newgrounds.NewgroundsAPI.compressor.decode(v6);
var v1 = com.Newgrounds.NewgroundsAPI.dec2hex(v5);
if (v2 + 4 < base_value.length) {
v3 = 6;
} else {
v3 = v8;
}
while (v1.length < v3) {
v1 = '0' + v1;
}
v7 += v1;
v2 += 4;
}
return v7;
};
v1.dec2hex = function (dec) {
var v4 = '0123456789ABCDEF';
var v3 = '';
while (dec > 0) {
var v2 = dec % 16;
v3 = v4.charAt(v2) + v3;
dec = (dec - v2) / 16;
}
return v3;
};
v1.saveFile = function (folder, filename, contents, thumbnail_source) {
if (!com.Newgrounds.NewgroundsAPI.save_file) {
com.Newgrounds.NewgroundsAPI.save_file = new com.Newgrounds.NewgroundsAPISaveFile(com.Newgrounds.NewgroundsAPI.movie_id, folder, filename);
com.Newgrounds.NewgroundsAPI.save_file.setContents(contents);
if (thumbnail_source) {
com.Newgrounds.NewgroundsAPI.save_file.setThumbnail(thumbnail_source);
}
com.Newgrounds.NewgroundsAPI.save_file.onError = function (msg) {
var v1 = new com.Newgrounds.NewgroundsAPIError('PERMISSION_DENIED', msg);
com.Newgrounds.NewgroundsAPI.sendError({'command_id': com.Newgrounds.NewgroundsAPI.getCommandID('saveFile')}, v1);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, v1);
};
com.Newgrounds.NewgroundsAPI.save_file.onCancel = function (msg) {
var v1 = new com.Newgrounds.NewgroundsAPIError('USER_CANCELLED', msg);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, v1);
};
com.Newgrounds.NewgroundsAPI.save_file.submit();
} else {
var v1 = new com.Newgrounds.NewgroundsAPIError('UPLOAD_IN_PROGRESS', 'Please wait for the previous file to finish uploading');
com.Newgrounds.NewgroundsAPI.sendError({'command_id': com.Newgrounds.NewgroundsAPI.getCommandID('saveFile')}, v1);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, v1);
}
};
v1.checkFilePrivs = function (folder, filename) {
if (com.Newgrounds.NewgroundsAPI.user_id) {
var v1 = com.Newgrounds.NewgroundsAPI.user_id;
} else {
var v1 = 0;
}
var v2 = {'folder': folder, 'filename': filename, 'user_id': v1, 'publisher_id': com.Newgrounds.NewgroundsAPI.publisher_id};
com.Newgrounds.NewgroundsAPI.sendCommand('checkFilePrivs', v2);
};
v1.finishFileSave = function (folder, filename, description, share, file, thumbnail) {
var v2;
v2 = {'folder': folder, 'filename': filename, 'description': description, 'share': share};
var v1;
v1 = {'file': file, 'thumbnail': thumbnail};
com.Newgrounds.NewgroundsAPI.sendSecureCommand('saveFile', v2, null, v1);
};
v1.getFiles = function (folder, options) {
var v7 = {'name': 1, 'date': 2, 'score': 3};
var v2 = {'user_only': false, 'sort_on': 'date', 'page': 1, 'results_per_page': 20, 'sort_descending': true};
var v6 = new Array();
for (var v10 in v7) {
v6.push('\'' + v10 + '\'');
}
var v4 = new Array();
for (var v9 in v2) {
v4.push('\'' + v9 + '\'');
}
if (options.sort_descending && !v7[options.sort_descending]) {
var v3 = new com.Newgrounds.NewgroundsAPIError('MISSING_PARAM', '\'' + options.sort_descending + '\' is not a valid sort_on value. Valid values are: ' + v6.join(', '));
com.Newgrounds.NewgroundsAPI.sendError({'command_id': com.Newgrounds.NewgroundsAPI.getCommandID('getFiles')}, v3);
delete options.sort_descending;
}
var v8;
if (options) {
for (v10 in options) {
if (v2[v10] == undefined) {
v3 = new com.Newgrounds.NewgroundsAPIError('MISSING_PARAM', '\'' + v10 + '\' is not a valid option. Valid options are: ' + v4.join(', '));
com.Newgrounds.NewgroundsAPI.sendError({'command_id': com.Newgrounds.NewgroundsAPI.getCommandID('getFiles')}, v3);
delete options[v10];
} else {
if (typeof options[v10] != typeof v2[v10]) {
v3 = new com.Newgrounds.NewgroundsAPIError('MISSING_PARAM', 'option \'' + v10 + '\' should be the following type: ' + typeof v2[v10]);
com.Newgrounds.NewgroundsAPI.sendError({'command_id': com.Newgrounds.NewgroundsAPI.getCommandID('getFiles')}, v3);
delete options[v10];
}
}
}
v8 = options;
} else {
v8 = new Object();
}
if (com.Newgrounds.NewgroundsAPI.hasUserSession()) {
v8.publisher_id = com.Newgrounds.NewgroundsAPI.publisher_id;
v8.user_id = com.Newgrounds.NewgroundsAPI.user_id;
}
v8.folder = folder;
com.Newgrounds.NewgroundsAPI.sendCommand('getFiles', v8);
};
v1.getConfirmation = function (command_name, event, msg, target, confirm, cancel) {
var v1 = new com.Newgrounds.NewgroundsAPIError('CONFIRM_REQUEST', msg);
v1.confirm = function () {
target[confirm]();
};
v1.cancel = function () {
target[cancel]();
};
v1.command = com.Newgrounds.NewgroundsAPI.getCommandID(command_name);
com.Newgrounds.NewgroundsAPI.callListener(event, false, v1);
};
v1.doBlockHost = function (event) {
_root.stop();
com.Newgrounds.NewgroundsAPI.initTextFormats();
_root.createEmptyMovieClip('NGAPI_deny_host_overlay', _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var v2 = 'This movie has not been approved for use on ' + com.Newgrounds.NewgroundsAPI.getHost() + '.';
v2 += '\r\rFor an aproved copy, please visit:\r';
var v4 = v2.length;
v2 += event.data.movie_url;
var v3 = v2.length;
_root.NGAPI_deny_host_overlay.createTextField('mousekill', 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField('error', 101, (Stage.width - 400) / 2, Stage.height / 2 - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = 'ERROR!';
_root.NGAPI_deny_host_overlay.error.setTextFormat(com.Newgrounds.NewgroundsAPI.error_format);
_root.NGAPI_deny_host_overlay.createTextField('message', 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = v2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(com.Newgrounds.NewgroundsAPI.normal_format);
com.Newgrounds.NewgroundsAPI.link_format.url = event.data.redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(v4, v3, com.Newgrounds.NewgroundsAPI.link_format);
};
v1.onNewVersionAvailable = function (event) {
_root.stop();
com.Newgrounds.NewgroundsAPI.initTextFormats();
var v2 = new Object();
v2.x = Stage.width / 2;
v2.y = Stage.height / 2;
_root.createEmptyMovieClip('NGAPI_new_version_overlay', _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(v2.x - 240, v2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(v2.x + 240, v2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(v2.x + 240, v2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(v2.x - 240, v2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(v2.x - 240, v2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip('exit', 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(v2.x + 210, v2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 230, v2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 230, v2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 210, v2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 210, v2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(v2.x + 214, v2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 226, v2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(v2.x + 226, v2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(v2.x + 214, v2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var v3 = 'Version ' + event.data.movie_version + ' is now available at:' + '\n';
var v6 = v3.length;
v3 += event.data.movie_url;
var v4 = v3.length;
_root.NGAPI_new_version_overlay.createTextField('mouseblocker', 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField('newversion', 100, v2.x - 210, v2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = 'New Version Available!';
_root.NGAPI_new_version_overlay.newversion.setTextFormat(com.Newgrounds.NewgroundsAPI.header_format);
_root.NGAPI_new_version_overlay.createTextField('message', 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = v3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(com.Newgrounds.NewgroundsAPI.normal_format);
com.Newgrounds.NewgroundsAPI.link_format.url = event.data.redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(v6, v4, com.Newgrounds.NewgroundsAPI.link_format);
};
v1.initTextFormats = function () {
if (!com.Newgrounds.NewgroundsAPI.error_format) {
com.Newgrounds.NewgroundsAPI.error_format = new TextFormat();
com.Newgrounds.NewgroundsAPI.error_format.font = 'Arial Black';
com.Newgrounds.NewgroundsAPI.error_format.size = 48;
com.Newgrounds.NewgroundsAPI.error_format.color = 16711680;
}
if (!com.Newgrounds.NewgroundsAPI.header_format) {
com.Newgrounds.NewgroundsAPI.header_format = new TextFormat();
com.Newgrounds.NewgroundsAPI.header_format.font = 'Arial Black';
com.Newgrounds.NewgroundsAPI.header_format.size = 24;
com.Newgrounds.NewgroundsAPI.header_format.color = 16777215;
}
if (!com.Newgrounds.NewgroundsAPI.normal_format) {
com.Newgrounds.NewgroundsAPI.normal_format = new TextFormat();
com.Newgrounds.NewgroundsAPI.normal_format.font = 'Arial';
com.Newgrounds.NewgroundsAPI.normal_format.bold = true;
com.Newgrounds.NewgroundsAPI.normal_format.size = 12;
com.Newgrounds.NewgroundsAPI.normal_format.color = 16777215;
}
if (!com.Newgrounds.NewgroundsAPI.link_format) {
com.Newgrounds.NewgroundsAPI.link_format = new TextFormat();
com.Newgrounds.NewgroundsAPI.link_format.color = 16776960;
com.Newgrounds.NewgroundsAPI.link_format.underline = true;
}
};
v1.doEvent = function (e) {
switch (com.Newgrounds.NewgroundsAPI.getCommandName(e.command_id)) {
case 'connectMovie':
clearInterval(com.Newgrounds.NewgroundsAPI.timeout);
com.Newgrounds.NewgroundsAPI.sendMessage('You have successfully connected to the Newgrounds API Gateway');
com.Newgrounds.NewgroundsAPI.sendMessage('Movie identified as "' + e.movie_name + '"');
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.MOVIE_CONNECTED, e.success, {'movie_name': e.movie_name});
var v4 = false;
if (e.ad_status === -1) {
var v6 = 'This movie was not approved to run Flash Ads.';
com.Newgrounds.NewgroundsAPI.sendWarning(v6);
com.Newgrounds.NewgroundsAPI.sendWarning('visit ' + com.Newgrounds.NewgroundsAPI.AD_TERMS_URL + ' to view our approval guidelines');
if (!e.ad_url) {
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError('FLASH_ADS_NOT_APPROVED', v6));
} else {
v4 = true;
}
} else {
if (e.ad_status === 0) {
var v6 = 'Flash Ads are currently awaiting approval.';
com.Newgrounds.NewgroundsAPI.sendNotice(v6);
if (!e.ad_url) {
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError('FLASH_ADS_NOT_APPROVED', v6));
} else {
v4 = true;
}
}
}
if (e.ad_url) {
com.Newgrounds.NewgroundsAPI.ad_url = unescape(e.ad_url);
if (!v4) {
com.Newgrounds.NewgroundsAPI.sendMessage('This movie has been approved to run Flash Ads!');
}
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.ADS_APPROVED, true);
}
if (e.deny_host) {
v6 = com.Newgrounds.NewgroundsAPI.getHost() + ' does not have permission to run this movie!';
com.Newgrounds.NewgroundsAPI.sendWarning(v6);
com.Newgrounds.NewgroundsAPI.sendWarning('\tUpdate your API configuration to unblock ' + com.Newgrounds.NewgroundsAPI.getHost());
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.HOST_BLOCKED, true, {'movie_url': unescape(e.movie_url), 'redirect_url': com.Newgrounds.NewgroundsAPI.getOfficialVersionURL()});
}
if (e.movie_version) {
com.Newgrounds.NewgroundsAPI.sendWarning('According to your API Configuration, this version is out of date.');
if (com.Newgrounds.NewgroundsAPI.version) {
com.Newgrounds.NewgroundsAPI.sendWarning('\tThe this movie is version ' + com.Newgrounds.NewgroundsAPI.version);
}
com.Newgrounds.NewgroundsAPI.sendWarning('\tThe most current version is ' + e.movie_version);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.NEW_VERSION_AVAILABLE, true, {'movie_version': e.movie_version, 'movie_url': unescape(e.movie_url), 'redirect_url': com.Newgrounds.NewgroundsAPI.getOfficialVersionURL()});
}
if (e.request_portal_url) {
com.Newgrounds.NewgroundsAPI.sendCommand('setPortalID', {'portal_url': _url});
}
break;
case 'logCustomEvent':
if (e.success) {
com.Newgrounds.NewgroundsAPI.sendMessage('Event \'' + e.event + '\' was logged.');
}
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.EVENT_LOGGED, e.success, {'event': e.event});
break;
case 'postScore':
var v7;
if (e.success) {
var v3 = 'User';
if (com.Newgrounds.NewgroundsAPI.user_email) {
v3 = com.Newgrounds.NewgroundsAPI.user_email;
} else {
if (com.Newgrounds.NewgroundsAPI.user_name) {
v3 = com.Newgrounds.NewgroundsAPI.user_name;
}
}
com.Newgrounds.NewgroundsAPI.sendMessage(v3 + ' posted ' + e.value + ' to \'' + e.score + '\'');
v7 = {'score': e.score, 'value': e.value, 'username': v3};
}
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.SCORE_POSTED, e.success, v7);
break;
case 'getScores':
var v7 = new Object();
if (e.user_id) {
var v5 = e.period;
} else {
var v5 = e.period + '-u';
}
if (e.total_pages) {
com.Newgrounds.NewgroundsAPI.score_page_counts[v5] = e.total_pages;
}
v7.user_id = e.user_id;
v7.current_page = e.current_page;
v7.total_pages = com.Newgrounds.NewgroundsAPI.score_page_counts[v5];
v7.scores = e.scores;
v7.period = com.Newgrounds.NewgroundsAPI.getPeriodName(e.period);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.SCORES_LOADED, e.success, v7);
break;
case 'unlockMedal':
if (com.Newgrounds.NewgroundsAPI.medals) {
var v2 = 0;
while (v2 < com.Newgrounds.NewgroundsAPI.medals.length) {
if (com.Newgrounds.NewgroundsAPI.medals[v2].medal_name === e.medal_name) {
com.Newgrounds.NewgroundsAPI.medals[v2].medal_unlocked = true;
break;
}
++v2;
}
}
var v7 = {'medal_name': e.medal_name, 'medal_value': e.medal_value, 'medal_difficulty': e.medal_difficulty};
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.MEDAL_UNLOCKED, e.success, v7);
break;
case 'getMedals':
com.Newgrounds.NewgroundsAPI.medals = e.medals;
var v7 = {'medals': e.medals};
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.MEDALS_LOADED, e.success, v7);
break;
break;
case 'getFiles':
case 'getSystemFiles':
break;
case 'saveFile':
com.Newgrounds.NewgroundsAPI.save_file = null;
var v7 = {'file_id': e.file_id, 'filename': e.filename, 'file_url': e.file_url, 'thumbnail': e.thumbnail, 'icon': e.icon};
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, e.success, v7);
break;
case 'checkFilePrivs':
if (com.Newgrounds.NewgroundsAPI.save_file) {
com.Newgrounds.NewgroundsAPI.save_file.checkPrivs(e);
} else {
var v7 = {'filename': e.filename, 'folder': e.folder, 'can_read': e.can_read, 'can_write': e.can_write};
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_PRIVS_LOADED, e.success, v7);
}
}
};
v1.setDefaultListeners = function () {
var v1 = new Array();
v1[com.Newgrounds.NewgroundsAPI.events.HOST_BLOCKED] = {'listener': com.Newgrounds.NewgroundsAPI.doBlockHost};
v1[com.Newgrounds.NewgroundsAPI.events.NEW_VERSION_AVAILABLE] = {'listener': com.Newgrounds.NewgroundsAPI.onNewVersionAvailable};
return v1;
};
v1.addEventListener = function (event, listener, params) {
com.Newgrounds.NewgroundsAPI.listeners[event] = {'listener': listener, 'params': params};
};
v1.removeEventListener = function (event) {
delete com.Newgrounds.NewgroundsAPI.listeners[event];
};
v1.getEventName = function (event) {
for (var v2 in com.Newgrounds.NewgroundsAPI.events) {
if (com.Newgrounds.NewgroundsAPI.events[v2] == event) {
return v2;
}
}
return undefined;
};
v1.callListener = function (event, success, data, target) {
com.Newgrounds.NewgroundsAPI.echo('Fired Event: ' + com.Newgrounds.NewgroundsAPI.getEventName(event));
if (com.Newgrounds.NewgroundsAPI.listeners[event]) {
if (data.isError()) {
com.Newgrounds.NewgroundsAPI.listeners[event].listener({'event': event, 'success': success, 'error': data, 'target': target}, com.Newgrounds.NewgroundsAPI.listeners[event].params);
} else {
com.Newgrounds.NewgroundsAPI.listeners[event].listener({'event': event, 'success': success, 'data': data, 'target': target}, com.Newgrounds.NewgroundsAPI.listeners[event].params);
}
}
};
v1.getCommandName = function (id) {
return id;
};
v1.getCommandID = function (name) {
return name;
};
v1.getPeriodAliases = function () {
var v1 = new Object();
for (var v2 in com.Newgrounds.NewgroundsAPI.period_aliases) {
v1[com.Newgrounds.NewgroundsAPI.period_aliases[v2].alias] = v2;
}
return v1;
};
v1.getPeriodName = function (p) {
for (var v2 in com.Newgrounds.NewgroundsAPI.period_aliases) {
if (v2 == p) {
return com.Newgrounds.NewgroundsAPI.period_aliases[v2].name;
}
}
return null;
};
v1.getPeriodAlias = function (p) {
for (var v2 in com.Newgrounds.NewgroundsAPI.period_aliases) {
if (v2 == p) {
return com.Newgrounds.NewgroundsAPI.period_aliases[v2].alias;
}
}
return null;
};
v1.sendError = function (c, e) {
trace('[NewgroundsAPI ERROR] :: ' + com.Newgrounds.NewgroundsAPI.getCommandName(c.command_id) + '() - ' + e.name + ':' + '\n' + '\t\t\t\t' + e.message);
};
v1.sendWarning = function (m, c) {
if (c) {
m += '\r[NewgroundsAPI WARNING] :: \tSee ' + com.Newgrounds.NewgroundsAPI.COMMANDS_WIKI_URL + c.toLowerCase() + ' for additional information.';
}
trace('[NewgroundsAPI WARNING] :: ' + m);
};
v1.sendNotice = function (m, c) {
if (c) {
m += '\r[NewgroundsAPI NOTICE] :: \tSee ' + com.Newgrounds.NewgroundsAPI.COMMANDS_WIKI_URL + c.toLowerCase() + ' for additional information.';
}
trace('[NewgroundsAPI NOTICE] :: ' + m);
};
v1.fatalError = function (m, c) {
if (c) {
m += '\r\tSee ' + com.Newgrounds.NewgroundsAPI.COMMANDS_WIKI_URL + c.toLowerCase() + ' for additional information.';
}
throw '***ERROR*** frame=' + _root._currentframe + ', class=NewgroundsAPI' + '\n' + '\n' + m;
};
v1.sendSecureCommand = function (command, secure_params, unsecure_params, files) {
if (!com.Newgrounds.NewgroundsAPI.debug && !com.Newgrounds.NewgroundsAPI.hasUserSession() && !com.Newgrounds.NewgroundsAPI.hasUserEmail()) {
com.Newgrounds.NewgroundsAPI.sendError({'command_id': com.Newgrounds.NewgroundsAPI.getCommandID(command)}, new com.Newgrounds.NewgroundsAPIError('IDENTIFICATION_REQUIRED', 'You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail("name@domain.com"); ) to use ' + command + '().'));
return undefined;
}
if (!command) {
com.Newgrounds.NewgroundsAPI.fatalError('Missing command', 'sendSecureCommand');
}
if (!secure_params) {
com.Newgrounds.NewgroundsAPI.fatalError('Missing secure_params', 'sendSecureCommand');
}
if (!unsecure_params) {
unsecure_params = new Object();
}
var v2 = '';
var v1 = 0;
while (v1 < 16) {
v2 += com.Newgrounds.NewgroundsAPI.compression_radix.charAt(Math.floor(Math.random() * com.Newgrounds.NewgroundsAPI.compression_radix.length));
++v1;
}
if (com.Newgrounds.NewgroundsAPI.debug) {
secure_params.session_id = '';
} else {
secure_params.session_id = com.Newgrounds.NewgroundsAPI.session_id;
}
secure_params.as_version = 2;
secure_params.user_email = com.Newgrounds.NewgroundsAPI.user_email;
secure_params.publisher_id = com.Newgrounds.NewgroundsAPI.publisher_id;
secure_params.seed = v2;
secure_params.command_id = com.Newgrounds.NewgroundsAPI.getCommandID(command);
var v8 = com.Newgrounds.MD5.calculate(v2);
var v6 = com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(secure_params), com.Newgrounds.NewgroundsAPI.encryption_key);
var v7 = v8 + v6;
unsecure_params.secure = com.Newgrounds.NewgroundsAPI.compressHex(v7);
com.Newgrounds.NewgroundsAPI.sendCommand('securePacket', unsecure_params, false, files);
};
v1.sendCommand = function (command, params, open_browser, files) {
if (!com.Newgrounds.NewgroundsAPI.connected and command != 'connectMovie') {
var v11 = 'NewgroundsAPI.' + command + '() - NewgroundsAPI.connectMovie() must be called before this command can be called' + '\n';
com.Newgrounds.NewgroundsAPI.fatalError(v11, 'connectMovie');
}
if (open_browser) {
var v1 = new Object();
} else {
var v1 = new LoadVars();
}
v1.command_id = com.Newgrounds.NewgroundsAPI.getCommandID(command);
v1.tracker_id = com.Newgrounds.NewgroundsAPI.movie_id;
if (com.Newgrounds.NewgroundsAPI.debug) {
v1.debug = com.Newgrounds.NewgroundsAPI.debug;
}
if (params) {
for (var v8 in params) {
v1[v8] = params[v8];
}
}
if (files) {
for (v8 in files) {
v1[v8] = files[v8];
}
}
com.Newgrounds.NewgroundsAPI.echo('OUTPUT: \r' + com.Newgrounds.JSON.encode(v1) + '\n');
if (open_browser) {
var v5 = com.Newgrounds.NewgroundsAPI.GATEWAY_URL + '?seed=' + Math.random();
for (v8 in v1) {
v5 += '&' + escape(v8) + '=' + escape(v1[v8]);
}
getURL(v5, '_blank');
v1.removeMovieClip();
} else {
var v9 = new LoadVars();
v9.onData = function (data) {
com.Newgrounds.NewgroundsAPI.echo('INPUT: \r' + data + '\n');
if (data) {
var v1 = com.Newgrounds.JSON.decode(data);
} else {
var v1 = {'success': false};
}
if (!v1.success) {
var v3 = new com.Newgrounds.NewgroundsAPIError(v1.error_code, v1.error_msg);
com.Newgrounds.NewgroundsAPI.sendError(v1, v3);
} else {
com.Newgrounds.NewgroundsAPI.doEvent(v1);
}
};
var v4 = new Array();
for (var v7 in v1) {
v4.push(v7 + '=' + escape(v1[v7]));
}
com.Newgrounds.NewgroundsAPI.echo('POST ' + com.Newgrounds.NewgroundsAPI.GATEWAY_URL + '?' + v4.join('&'));
v1.sendAndLoad(com.Newgrounds.NewgroundsAPI.GATEWAY_URL + '?seed=' + Math.random(), v9, 'POST');
}
};
v1.renderAd = function (target) {
if (com.Newgrounds.NewgroundsAPI.ad_swf_url) {
target.background = target.createEmptyMovieClip('background', 100);
target.background.beginFill(0);
target.background.moveTo(0, 0);
target.background.lineTo(300, 0);
target.background.lineTo(300, 250);
target.background.lineTo(0, 250);
target.background.lineTo(0, 0);
target.background.endFill();
target.mask = target.createEmptyMovieClip('mask', 101);
target.mask.beginFill(0);
target.mask.moveTo(0, 0);
target.mask.lineTo(300, 0);
target.mask.lineTo(300, 250);
target.mask.lineTo(0, 250);
target.mask.lineTo(0, 0);
target.mask.endFill();
target.clip = target.createEmptyMovieClip('clip', 102);
target.clip.ad = target.clip.createEmptyMovieClip('ad', 100);
target.clip.setMask(target.mask);
loadMovie(com.Newgrounds.NewgroundsAPI.ad_swf_url, target.clip.ad);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.AD_ATTACHED, true, null, target);
} else {
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.AD_ATTACHED, false, new com.Newgrounds.NewgroundsAPIError('FLASH_ADS_NOT_APPROVED', 'Unable to render ad'));
}
};
v1.attachFlashAd = function (target) {
System.security.allowDomain('http://server.cpmstar.com');
System.security.allowDomain('http://www.cpmstar.com');
System.security.allowDomain('https://server.cpmstar.com');
System.security.allowDomain('https://www.cpmstar.com');
System.security.allowInsecureDomain('http://server.cpmstar.com');
System.security.allowInsecureDomain('http://www.cpmstar.com');
System.security.allowInsecureDomain('https://server.cpmstar.com');
System.security.allowInsecureDomain('https://www.cpmstar.com');
com.Newgrounds.NewgroundsAPI.sendMessage('You may get a security sandbox violation from this ad. This is nothing to worry about!');
if (com.Newgrounds.NewgroundsAPI.resetAdTimer()) {
if (com.Newgrounds.NewgroundsAPI.ad_url) {
var v1 = new LoadVars();
v1.onData = function (data) {
if (data) {
com.Newgrounds.NewgroundsAPI.ad_swf_url = data;
} else {
com.Newgrounds.NewgroundsAPI.ad_swf_url = null;
}
com.Newgrounds.NewgroundsAPI.renderAd(target);
};
if (com.Newgrounds.NewgroundsAPI.ad_url.indexOf('?') > -1) {
v1.load(com.Newgrounds.NewgroundsAPI.ad_url + '&random=' + Math.random());
} else {
v1.load(com.Newgrounds.NewgroundsAPI.ad_url + '?random=' + Math.random());
}
}
} else {
com.Newgrounds.NewgroundsAPI.renderAd(target);
}
};
v1.resetAdTimer = function () {
if (!com.Newgrounds.NewgroundsAPI.ad_url) {
return false;
}
var v1 = new Date();
if (v1.getTime() >= com.Newgrounds.NewgroundsAPI.ad_reset) {
com.Newgrounds.NewgroundsAPI.ad_reset = v1.getTime() + 300000;
return true;
}
return false;
};
v1.sendMessage = function (m, r) {
var v1 = '[NewgroundsAPI] :: ' + m;
if (r) {
return v1;
} else {
trace(v1);
}
};
v1.echo = function (m) {
if (com.Newgrounds.NewgroundsAPI.do_echo) {
trace(m);
}
};
v1.do_echo = false;
v1.GATEWAY_URL = 'http://www.ngads.com/gateway_v2.php';
v1.AD_TERMS_URL = 'http://www.newgrounds.com/wiki/flashads/terms/';
v1.COMMANDS_WIKI_URL = 'http://www.newgrounds.com/wiki/flashapi/commands/';
v1.ad_reset = 0;
v1.save_file = null;
v1.medals = null;
v1.score_page_counts = new Object();
v1.compression_radix = '/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X';
v1.compressor = new com.Newgrounds.BaseN(com.Newgrounds.NewgroundsAPI.compression_radix);
v1.errors = com.Newgrounds.NewgroundsAPIError.init_codes();
v1.sharedObjects = new Object();
v1.events = {'MOVIE_CONNECTED': 1, 'ADS_APPROVED': 2, 'AD_ATTACHED': 3, 'HOST_BLOCKED': 4, 'NEW_VERSION_AVAILABLE': 5, 'EVENT_LOGGED': 6, 'SCORE_POSTED': 7, 'SCORES_LOADED': 8, 'MEDAL_UNLOCKED': 9, 'MEDALS_LOADED': 10, 'FILE_PRIVS_LOADED': 11, 'FILE_SAVED': 12};
v1.listeners = com.Newgrounds.NewgroundsAPI.setDefaultListeners();
v1.periods = com.Newgrounds.NewgroundsAPI.getPeriodAliases();
v1.period_aliases = {'t': {'name': 'Today', 'alias': 'TODAY'}, 'p': {'name': 'Yesterday', 'alias': 'YESTERDAY'}, 'w': {'name': 'This Week', 'alias': 'THIS_WEEK'}, 'm': {'name': 'This Month', 'alias': 'THIS_MONTH'}, 'y': {'name': 'This Year', 'alias': 'THIS_YEAR'}, 'a': {'name': 'All-Time', 'alias': 'ALL_TIME'}};
ASSetPropFlags(com.Newgrounds.NewgroundsAPI.prototype, null, 1);
}
#endinitclip
}
movieClip 220 __Packages.com.Newgrounds.NewgroundsAPISaveFile {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.Newgrounds) {
_global.com.Newgrounds = new Object();
}
if (!_global.com.Newgrounds.NewgroundsAPISaveFile) {
var v1 = function (tracker_id, folder, filename) {
this.tracker_id = tracker_id;
this.folder = folder;
this.filename = filename;
this.contents = null;
this.thumbnail = null;
this.icon_url = null;
this.thumbnail_url = null;
};
com.Newgrounds.NewgroundsAPISaveFile = v1;
var v2 = v1.prototype;
v2.setDescription = function (description) {
this.description = description;
};
v2.setShared = function (share) {
this.share = share;
};
v2.setContents = function (contents) {
this.contents = contents;
};
v2.setThumbnail = function (thumb) {
if (thumb) {
this.thumbnail = thumb;
} else {
this.thumbnail = null;
}
};
v2.onError = function (msg) {
trace('[NewgroundsAPISaveFile ERROR] :: ' + msg);
};
v2.onCancel = function (msg) {
trace('[NewgroundsAPISaveFile] :: ' + msg);
};
v2.submit = function () {
this.scan = null;
com.Newgrounds.NewgroundsAPI.checkFilePrivs(this.folder, this.filename);
};
v2.checkPrivs = function (p) {
if (p.success) {
if (p.can_write) {
this.can_write = p.can_write;
if (p.exists) {
com.Newgrounds.NewgroundsAPI.getConfirmation('saveFile', com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, 'File \'' + this.filename + '\' exists, overwrite?', this, 'startFile', 'cancelFile');
} else {
this.startFile();
}
} else {
this.onError('This filename is owned by another user.');
}
} else {
this.onError('There was a problem looking up your file\'s details');
}
};
v2.cancelFile = function () {
this.onCancel('Overwrite was cancelled');
};
v2.startFile = function () {
if (this.can_write) {
if (this.thumbnail) {
this.scanner = new com.Newgrounds.ImageScanner(this.thumbnail);
this.scanner.setCallback(this, 'writeFile');
this.scanner.startScan(100, 100, true);
} else {
this.writeFile();
}
} else {
this.onError('You cannot write to filename "' + this.filename + '"');
}
};
v2.writeFile = function (img) {
trace('FINISHED');
com.Newgrounds.NewgroundsAPI.finishFileSave(this.folder, this.filename, this.description, this.share, com.Newgrounds.JSON.encode(this.contents), img);
};
v2.can_write = false;
v2.share = true;
ASSetPropFlags(com.Newgrounds.NewgroundsAPISaveFile.prototype, null, 1);
}
#endinitclip
}
movieClip 221 __Packages.com.Newgrounds.ImageScanner {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.Newgrounds) {
_global.com.Newgrounds = new Object();
}
if (!_global.com.Newgrounds.ImageScanner) {
var v1 = function (the_source) {
if (the_source) {
this.image_source = the_source;
} else {
this.image_source = _root;
}
this.reset();
if (typeof this.image_source == 'movieclip') {
if (this.image_source == _root) {
this.source_width = Stage.width;
this.source_height = Stage.height;
} else {
this.source_width = Math.floor(this.image_source._width);
this.source_height = Math.floor(this.image_source._height);
}
this.sourceBitmap = new flash.display.BitmapData(this.source_width, this.source_height, false, 4294967295.0);
this.sourceBitmap.draw(_root);
} else {
if (this.image_source.width) {
this.source_width = this.image_source.width;
this.source_height = this.image_source.height;
this.sourceBitmap = this.image_source;
} else {
this.error('You can only use BitMaptData and MovieClip objects to create images');
}
}
};
com.Newgrounds.ImageScanner = v1;
var v2 = v1.prototype;
v2.setCallback = function (target, funct) {
if (target && funct) {
this.callback_target = target;
this.callback_function = funct;
}
};
v2.reset = function () {
this.callback_target = null;
this.callback_function = null;
this.debug.bad_pixels = 0;
this.hash = '0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&';
var v3 = Math.pow(this.hash.length, 2);
trace('MAX COLORS: ' + v3);
var v2 = Math.floor(Math.pow(v3, 0.3333333333333333)) - 1;
var v4 = Math.pow(v2, 3);
this.cube = v2;
this.basen = new com.Newgrounds.BaseN(this.hash);
this.xpos = 0;
this.ypos = 0;
this.pixels = 0;
this.busy = false;
};
v2.startScan = function (w, h, s) {
if (w) {
this.image_width = w;
}
if (h) {
this.image_height = h;
}
if (s != undefined) {
this.crop = s;
}
var v7 = _root.getNextHighestDepth();
var v6 = _root.createEmptyMovieClip('API_image_container_' + v7, v7);
var v5 = v6.createEmptyMovieClip('canvas', 100);
v5.attachBitmap(this.sourceBitmap, 100);
if (this.crop) {
if (this.image_width / this.source_width > this.image_height / this.source_height) {
this.canvas_width = this.image_width;
this.canvas_height = Math.ceil(this.source_height * (this.image_width / this.source_width));
} else {
this.canvas_height = this.image_height;
this.canvas_width = Math.ceil(this.source_width * (this.image_height / this.source_height));
}
} else {
this.canvas_width = this.image_width;
this.canvas_height = this.image_height;
}
v5._x = Math.round((this.image_width - this.canvas_width) / 2);
v5._width = this.canvas_width;
v5._height = this.canvas_height;
this.resizedBitmap = new flash.display.BitmapData(this.image_width, this.image_height, false, 4294967295.0);
this.resizedBitmap.draw(v6);
v6.removeMovieClip();
this.copyBitmap = new flash.display.BitmapData(this.image_width, this.image_height, false, 4294967295.0);
var v3 = '' + this.image_width;
while (v3.length < 3) {
v3 = '0' + v3;
}
var v4 = '' + this.image_height;
while (v4.length < 3) {
v4 = '0' + v4;
}
this.output = v3 + v4;
this.draw_interval = setInterval(this, 'drawChunk', 10);
this.busy = false;
return this.resizedBitmap;
};
v2.getBitmapData = function () {
return this.copyBitmap;
};
v2.getBytesTotal = function () {
return this.image_width * this.image_height * 2;
};
v2.getBytesScanned = function () {
return this.pixels * 2;
};
v2.drawChunk = function () {
if (!this.busy) {
this.busy = true;
var v2 = 0;
while (v2 < 250) {
if (!this.nextPixel()) {
clearInterval(this.draw_interval);
this.callback_interval = setInterval(this, 'doCallback', 25);
this.busy = true;
break;
}
++v2;
}
this.busy = false;
}
};
v2.doCallback = function () {
this.busy = false;
clearInterval(this.callback_interval);
if (this.callback_target and this.callback_function) {
this.callback_target[this.callback_function](this.output);
} else {
this.onScanComplete(this.output);
}
};
v2.onScanComplete = function (packet) {
this.sendMessage('packet size: ' + this.output.length + ' bytes', 'onScanComplete');
};
v2.nextPixel = function () {
var v15 = this.xpos;
var v14 = this.ypos;
var v7 = this.resizedBitmap.getPixel(v15, v14);
var v17 = v7 >> 16 & 255;
var v20 = v7 >> 8 & 255;
var v16 = v7 >> 0 & 255;
var v11 = Math.round(((v17 + 1) / 256) * this.cube);
var v10 = Math.round(((v20 + 1) / 256) * this.cube);
var v13 = Math.round(((v16 + 1) / 256) * this.cube);
var v12 = v11 * (this.cube + 1) * (this.cube + 1) + v10 * (this.cube + 1) + v13;
var v6 = this.basen.encode(v12, 2);
this.output += v6;
if (v6.length != 2) {
trace('bad pixel ' + v6);
}
var v5 = this.basen.decode(v6);
var v18 = v5;
var v8 = v5 % (this.cube + 1);
v5 = (v5 - v8) / (this.cube + 1);
var v9 = v5 % (this.cube + 1);
var v19 = (v5 - v9) / (this.cube + 1);
if (v13 != v8 and v10 != v9 and v11 != v10) {
++this.debug.bad_pixels;
trace('BAD PIXEL ' + this.debug.bad_pixels + ') ' + v12 + ' != ' + v18 + ' ' + v6);
trace(this.basen.debug.lastencode);
}
var v2 = (Math.round((v19 / this.cube) * 255)).toString(16);
var v4 = (Math.round((v9 / this.cube) * 255)).toString(16);
var v3 = (Math.round((v8 / this.cube) * 255)).toString(16);
while (v2.length < 2) {
v2 = '0' + v2;
}
while (v4.length < 2) {
v4 = '0' + v4;
}
while (v3.length < 2) {
v3 = '0' + v3;
}
this.copyBitmap.setPixel(v15, v14, Number('0x' + v2 + v4 + v3));
++this.pixels;
if (this.pixels >= this.image_width * this.image_height) {
return false;
}
++this.xpos;
if (this.xpos >= this.image_width) {
this.xpos = 0;
++this.ypos;
}
return true;
};
v2.error = function (e, f) {
this.sendMessage(e, f, 'ERROR');
};
v2.sendMessage = function (msg, func, type) {
var v1 = 'ImageScanner';
if (func) {
v1 += '.' + func + '()';
}
if (type) {
v1 = type + ' in ' + v1;
}
v1 += ' :: ' + msg;
trace(v1);
};
v2.image_width = 100;
v2.image_height = 100;
v2.crop = true;
v2.debug = new Object();
ASSetPropFlags(com.Newgrounds.ImageScanner.prototype, null, 1);
}
#endinitclip
}
movieClip 222 __Packages.com.Newgrounds.JSON {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.Newgrounds) {
_global.com.Newgrounds = new Object();
}
if (!_global.com.Newgrounds.JSON) {
var v1 = function () {};
com.Newgrounds.JSON = v1;
var v2 = v1.prototype;
v1.encode = function (arg, noquotes) {
var v3;
var v2;
var v6;
var v1 = '';
var v4;
if (arg.isSServerVar()) {
var v8 = 'sservervariable';
} else {
var v8 = typeof arg;
}
switch (v8) {
return 'null';
case 'sservervariable':
return '?' + arg.getEncodedValue();
break;
case 'object':
if (arg) {
if (arg instanceof Array) {
v2 = 0;
while (v2 < arg.length) {
v4 = com.Newgrounds.JSON.encode(arg[v2]);
if (v1) {
v1 += ',';
}
v1 += v4;
++v2;
}
return '[' + v1 + ']';
} else {
if (typeof arg.toString != 'undefined') {
for (v2 in arg) {
v4 = arg[v2];
if (typeof v4 != 'undefined' && typeof v4 != 'function') {
v4 = com.Newgrounds.JSON.encode(v4);
if (v1) {
v1 += ',';
}
v1 += com.Newgrounds.JSON.encode(v2) + ':' + v4;
}
}
return '{' + v1 + '}';
}
}
}
return 'null';
case 'number':
return isFinite(arg) ? String(arg) : 'null';
case 'string':
v6 = arg.length;
if (noquotes) {
var v7 = '';
} else {
var v7 = '"';
}
v1 = v7;
v2 = 0;
while (v2 < v6) {
v3 = arg.charAt(v2);
if (v3 >= ' ') {
if (v3 == '\\' || v3 == '"') {
v1 += '\\';
}
v1 += v3;
} else {
switch (v3) {
case '\b':
v1 += '\\b';
break;
case '\f':
v1 += '\\f';
break;
case '\n':
v1 += '\\n';
break;
case '\r':
v1 += '\\r';
break;
case '\t':
v1 += '\\t';
break;
default:
v3 = v3.charCodeAt();
v1 += '\\u00' + (Math.floor(v3 / 16)).toString(16) + (v3 % 16).toString(16);
}
}
v2 += 1;
}
return v1 + v7;
case 'boolean':
return String(arg);
default:
return 'null';
}
};
v1.decode = function (text) {
var at = 0;
var ch = ' ';
var _value;
var _error = function (m) {
throw {'name': 'JSONError', 'message': m, 'at': at - 1, 'text': text};
};
var _next = function () {
ch = text.charAt(at);
at += 1;
return ch;
};
var _white = function () {
while (ch) {
if (ch <= ' ') {
_next();
} else {
if (ch == '/') {
switch (_next()) {
case '/':
for (;;) {
if (!(_next() && ch != '\n' && ch != '\r')) break;
}
break;
case '*':
_next();
for (;;) {
if (ch) {
if (ch == '*') {
if (_next() == '/') {
_next();
break;
}
} else {
_next();
}
continue;
}
_error('Unterminated comment');
}
break;
default:
_error('Syntax error');
}
} else {
break;
}
}
}
};
var _string = function () {
var v4;
var v1 = '';
var v3;
var v2;
var v5 = false;
if (ch == '"') {
while (_next()) {
if (ch == '"') {
_next();
return v1;
} else {
if (ch == '\\') {
switch (_next()) {
case 'b':
v1 += '\b';
break;
case 'f':
v1 += '\f';
break;
case 'n':
v1 += '\n';
break;
case 'r':
v1 += '\r';
break;
case 't':
v1 += '\t';
break;
case 'u':
v2 = 0;
v4 = 0;
while (v4 < 4) {
v3 = parseInt(_next(), 16);
if (!isFinite(v3)) {
v5 = true;
break;
}
v2 = v2 * 16 + v3;
v4 += 1;
}
if (v5) {
v5 = false;
} else {
v1 += String.fromCharCode(v2);
break;
default:
v1 += ch;
}
}
} else {
v1 += ch;
}
}
}
}
_error('Bad string');
};
var _array = function () {
var v1 = [];
if (ch == '[') {
_next();
_white();
if (ch == ']') {
_next();
return v1;
}
while (ch) {
v1.push(_value());
_white();
if (ch == ']') {
_next();
return v1;
} else {
if (ch != ',') {
break;
}
}
_next();
_white();
}
}
_error('Bad array');
};
var _object = function () {
var v2;
var v1 = {};
if (ch == '{') {
_next();
_white();
if (ch == '}') {
_next();
return v1;
}
while (ch) {
v2 = _string();
_white();
if (ch != ':') {
break;
}
_next();
v1[v2] = _value();
_white();
if (ch == '}') {
_next();
return v1;
} else {
if (ch != ',') {
break;
}
}
_next();
_white();
}
}
_error('Bad object');
};
var _number = function () {
var v1 = '';
var v2;
if (ch == '-') {
v1 = '-';
_next();
}
for (;;) {
if (!(ch >= '0' && ch <= '9')) break;
v1 += ch;
_next();
}
if (ch == '.') {
v1 += '.';
for (;;) {
if (!(_next() && ch >= '0' && ch <= '9')) break;
v1 += ch;
}
}
v2 = 1 * v1;
if (!isFinite(v2)) {
_error('Bad number');
} else {
return v2;
}
};
var _word = function () {
switch (ch) {
case 't':
if (_next() == 'r' && _next() == 'u' && _next() == 'e') {
_next();
return true;
}
break;
case 'f':
if (_next() == 'a' && _next() == 'l' && _next() == 's' && _next() == 'e') {
_next();
return false;
}
break;
case 'n':
if (_next() == 'u' && _next() == 'l' && _next() == 'l') {
_next();
return null;
}
}
_error('Syntax error');
};
_value = function () {
_white();
switch (ch) {
case '{':
return _object();
case '[':
return _array();
case '"':
return _string();
case '-':
return _number();
}
return (ch >= '0' && ch <= '9') ? _number() : _word();
};
return _value();
};
ASSetPropFlags(com.Newgrounds.JSON.prototype, null, 1);
}
#endinitclip
}
movieClip 223 __Packages.com.Newgrounds.RC4 {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.Newgrounds) {
_global.com.Newgrounds = new Object();
}
if (!_global.com.Newgrounds.RC4) {
var v1 = function () {};
com.Newgrounds.RC4 = v1;
var v2 = v1.prototype;
v1.encrypt = function (src, key) {
var v3 = com.Newgrounds.RC4.strToChars(src);
var v1 = com.Newgrounds.RC4.strToChars(key);
var v2 = com.Newgrounds.RC4.calculate(v3, v1);
return com.Newgrounds.RC4.charsToHex(v2);
};
v1.encryptbin = function (src, key) {
var v3 = com.Newgrounds.RC4.strToChars(src);
var v1 = com.Newgrounds.RC4.strToChars(key);
var v2 = com.Newgrounds.RC4.calculate(v3, v1);
return v2;
};
v1.decrypt = function (src, key) {
var v3 = com.Newgrounds.RC4.hexToChars(src);
var v1 = com.Newgrounds.RC4.strToChars(key);
var v2 = com.Newgrounds.RC4.calculate(v3, v1);
return com.Newgrounds.RC4.charsToStr(v2);
};
v1.initialize = function (pwd) {
var v2 = 0;
var v3;
var v4 = pwd.length;
var v1 = 0;
while (v1 <= 255) {
com.Newgrounds.RC4.mykey[v1] = pwd[v1 % v4];
com.Newgrounds.RC4.sbox[v1] = v1;
++v1;
}
v1 = 0;
while (v1 <= 255) {
v2 = (v2 + com.Newgrounds.RC4.sbox[v1] + com.Newgrounds.RC4.mykey[v1]) % 256;
v3 = com.Newgrounds.RC4.sbox[v1];
com.Newgrounds.RC4.sbox[v1] = com.Newgrounds.RC4.sbox[v2];
com.Newgrounds.RC4.sbox[v2] = v3;
++v1;
}
};
v1.calculate = function (plaintxt, psw) {
com.Newgrounds.RC4.initialize(psw);
var v1 = 0;
var v2 = 0;
var v9 = new Array();
var v7;
var v5;
var v6;
var v3 = 0;
while (v3 < plaintxt.length) {
v1 = (v1 + 1) % 256;
v2 = (v2 + com.Newgrounds.RC4.sbox[v1]) % 256;
v5 = com.Newgrounds.RC4.sbox[v1];
com.Newgrounds.RC4.sbox[v1] = com.Newgrounds.RC4.sbox[v2];
com.Newgrounds.RC4.sbox[v2] = v5;
var v4 = (com.Newgrounds.RC4.sbox[v1] + com.Newgrounds.RC4.sbox[v2]) % 256;
v7 = com.Newgrounds.RC4.sbox[v4];
v6 = plaintxt[v3] ^ v7;
v9.push(v6);
++v3;
}
return v9;
};
v1.charsToHex = function (chars) {
var v4 = new String('');
var v3 = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
var v1 = 0;
while (v1 < chars.length) {
v4 += v3[chars[v1] >> 4] + v3[chars[v1] & 15];
++v1;
}
return v4;
};
v1.hexToChars = function (hex) {
var v3 = new Array();
var v1 = (hex.substr(0, 2) == '0x') ? 2 : 0;
while (v1 < hex.length) {
v3.push(parseInt(hex.substr(v1, 2), 16));
v1 += 2;
}
return v3;
};
v1.charsToStr = function (chars) {
var v3 = new String('');
var v1 = 0;
while (v1 < chars.length) {
v3 += String.fromCharCode(chars[v1]);
++v1;
}
return v3;
};
v1.strToChars = function (str) {
var v3 = new Array();
var v1 = 0;
while (v1 < str.length) {
v3.push(str.charCodeAt(v1));
++v1;
}
return v3;
};
v1.sbox = new Array(255);
v1.mykey = new Array(255);
ASSetPropFlags(com.Newgrounds.RC4.prototype, null, 1);
}
#endinitclip
}
movieClip 224 __Packages.com.Newgrounds.MD5 {
#initclip
if (!_global.com) {
_global.com = new Object();
}
if (!_global.com.Newgrounds) {
_global.com.Newgrounds = new Object();
}
if (!_global.com.Newgrounds.MD5) {
var v1 = function () {};
com.Newgrounds.MD5 = v1;
var v2 = v1.prototype;
v1.calculate = function (src) {
return com.Newgrounds.MD5.hex_md5(src);
};
v1.hex_md5 = function (src) {
return com.Newgrounds.MD5.binl2hex(com.Newgrounds.MD5.core_md5(com.Newgrounds.MD5.str2binl(src), src.length * 8));
};
v1.core_md5 = function (x, len) {
x[len >> 5] |= 128 << len % 32;
x[(len + 64 >>> 9 << 4) + 14] = len;
var v4 = 1732584193;
var v3 = -271733879;
var v2 = -1732584194;
var v1 = 271733878;
var v5 = 0;
while (v5 < x.length) {
var v10 = v4;
var v9 = v3;
var v8 = v2;
var v7 = v1;
v4 = com.Newgrounds.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 0], 7, -680876936);
v1 = com.Newgrounds.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 1], 12, -389564586);
v2 = com.Newgrounds.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 2], 17, 606105819);
v3 = com.Newgrounds.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 3], 22, -1044525330);
v4 = com.Newgrounds.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 4], 7, -176418897);
v1 = com.Newgrounds.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 5], 12, 1200080426);
v2 = com.Newgrounds.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 6], 17, -1473231341);
v3 = com.Newgrounds.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 7], 22, -45705983);
v4 = com.Newgrounds.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 8], 7, 1770035416);
v1 = com.Newgrounds.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 9], 12, -1958414417);
v2 = com.Newgrounds.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 10], 17, -42063);
v3 = com.Newgrounds.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 11], 22, -1990404162);
v4 = com.Newgrounds.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 12], 7, 1804603682);
v1 = com.Newgrounds.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 13], 12, -40341101);
v2 = com.Newgrounds.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 14], 17, -1502002290);
v3 = com.Newgrounds.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 15], 22, 1236535329);
v4 = com.Newgrounds.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 1], 5, -165796510);
v1 = com.Newgrounds.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 6], 9, -1069501632);
v2 = com.Newgrounds.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 11], 14, 643717713);
v3 = com.Newgrounds.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 0], 20, -373897302);
v4 = com.Newgrounds.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 5], 5, -701558691);
v1 = com.Newgrounds.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 10], 9, 38016083);
v2 = com.Newgrounds.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 15], 14, -660478335);
v3 = com.Newgrounds.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 4], 20, -405537848);
v4 = com.Newgrounds.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 9], 5, 568446438);
v1 = com.Newgrounds.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 14], 9, -1019803690);
v2 = com.Newgrounds.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 3], 14, -187363961);
v3 = com.Newgrounds.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 8], 20, 1163531501);
v4 = com.Newgrounds.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 13], 5, -1444681467);
v1 = com.Newgrounds.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 2], 9, -51403784);
v2 = com.Newgrounds.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 7], 14, 1735328473);
v3 = com.Newgrounds.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 12], 20, -1926607734);
v4 = com.Newgrounds.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 5], 4, -378558);
v1 = com.Newgrounds.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 8], 11, -2022574463);
v2 = com.Newgrounds.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 11], 16, 1839030562);
v3 = com.Newgrounds.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 14], 23, -35309556);
v4 = com.Newgrounds.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 1], 4, -1530992060);
v1 = com.Newgrounds.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 4], 11, 1272893353);
v2 = com.Newgrounds.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 7], 16, -155497632);
v3 = com.Newgrounds.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 10], 23, -1094730640);
v4 = com.Newgrounds.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 13], 4, 681279174);
v1 = com.Newgrounds.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 0], 11, -358537222);
v2 = com.Newgrounds.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 3], 16, -722521979);
v3 = com.Newgrounds.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 6], 23, 76029189);
v4 = com.Newgrounds.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 9], 4, -640364487);
v1 = com.Newgrounds.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 12], 11, -421815835);
v2 = com.Newgrounds.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 15], 16, 530742520);
v3 = com.Newgrounds.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 2], 23, -995338651);
v4 = com.Newgrounds.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 0], 6, -198630844);
v1 = com.Newgrounds.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 7], 10, 1126891415);
v2 = com.Newgrounds.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 14], 15, -1416354905);
v3 = com.Newgrounds.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 5], 21, -57434055);
v4 = com.Newgrounds.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 12], 6, 1700485571);
v1 = com.Newgrounds.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 3], 10, -1894986606);
v2 = com.Newgrounds.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 10], 15, -1051523);
v3 = com.Newgrounds.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 1], 21, -2054922799);
v4 = com.Newgrounds.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 8], 6, 1873313359);
v1 = com.Newgrounds.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 15], 10, -30611744);
v2 = com.Newgrounds.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 6], 15, -1560198380);
v3 = com.Newgrounds.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 13], 21, 1309151649);
v4 = com.Newgrounds.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 4], 6, -145523070);
v1 = com.Newgrounds.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 11], 10, -1120210379);
v2 = com.Newgrounds.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 2], 15, 718787259);
v3 = com.Newgrounds.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 9], 21, -343485551);
v4 = com.Newgrounds.MD5.safe_add(v4, v10);
v3 = com.Newgrounds.MD5.safe_add(v3, v9);
v2 = com.Newgrounds.MD5.safe_add(v2, v8);
v1 = com.Newgrounds.MD5.safe_add(v1, v7);
v5 += 16;
}
return new Array(v4, v3, v2, v1);
};
v1.md5_cmn = function (q, a, b, x, s, t) {
return com.Newgrounds.MD5.safe_add(com.Newgrounds.MD5.bit_rol(com.Newgrounds.MD5.safe_add(com.Newgrounds.MD5.safe_add(a, q), com.Newgrounds.MD5.safe_add(x, t)), s), b);
};
v1.md5_ff = function (a, b, c, d, x, s, t) {
return com.Newgrounds.MD5.md5_cmn(b & c | ~b & d, a, b, x, s, t);
};
v1.md5_gg = function (a, b, c, d, x, s, t) {
return com.Newgrounds.MD5.md5_cmn(b & d | c & ~d, a, b, x, s, t);
};
v1.md5_hh = function (a, b, c, d, x, s, t) {
return com.Newgrounds.MD5.md5_cmn(b ^ c ^ d, a, b, x, s, t);
};
v1.md5_ii = function (a, b, c, d, x, s, t) {
return com.Newgrounds.MD5.md5_cmn(c ^ (b | ~d), a, b, x, s, t);
};
v1.bit_rol = function (num, cnt) {
return num << cnt | num >>> 32 - cnt;
};
v1.safe_add = function (x, y) {
var v1 = (x & 65535) + (y & 65535);
var v2 = (x >> 16) + (y >> 16) + (v1 >> 16);
return v2 << 16 | v1 & 65535;
};
v1.str2binl = function (str) {
var v3 = new Array();
var v4 = 255;
var v1 = 0;
while (v1 < str.length * 8) {
v3[v1 >> 5] |= (str.charCodeAt(v1 / 8) & v4) << v1 % 32;
v1 += 8;
}
return v3;
};
v1.binl2hex = function (binarray) {
var v4 = new String('');
var v3 = new String('0123456789abcdef');
var v1 = 0;
while (v1 < binarray.length * 4) {
v4 += v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 + 4 & 15) + v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 & 15);
++v1;
}
return v4;
};
ASSetPropFlags(com.Newgrounds.MD5.prototype, null, 1);
}
#endinitclip
}
frame 24 {
bgSound = new Sound(this);
bgSound.attachSound('anger');
achieveSound = new Sound(this);
achieveSound.attachSound('achievement');
}
movieClip 86 {
}
movieClip 89 {
}
movieClip 102 {
}
movieClip 104 {
}
movieClip 107 {
}
movieClip 109 {
}
movieClip 115 {
}
frame 545 {
bgSound.start(0, 99);
}
frame 592 {
stop();
lasers = false;
groundfire = false;
i = 50;
}
movieClip 132 {
}
movieClip 135 {
}
instance sun of movieClip 135 {
onClipEvent (load) {
maxspeed = 10;
yspeed = 0;
xspeed = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(38) && _y > 120 && yspeed < maxspeed) {
yspeed += 2;
}
if (yspeed > -10 && _y < 260) {
--yspeed;
} else {
++yspeed;
}
if (Key.isDown(39) && xspeed < maxspeed && _x < 500) {
++xspeed;
} else {
if (Key.isDown(37) && xspeed > -maxspeed && _x > 100) {
--xspeed;
}
}
xspeed *= 0.92;
_x = _x + xspeed;
_y = _y - yspeed;
_root.background.gotoAndStop(Math.round(this._y - 80));
_root.eyebeams._x = _x + 6;
_root.eyebeams._y = _y - 15;
}
}
movieClip 137 {
}
movieClip 144 {
frame 5 {
_root.groundfire = true;
}
frame 6 {
_parent.nextFrame();
}
}
movieClip 149 {
}
movieClip 153 {
frame 4 {
_root.groundfire = false;
_parent.gotoAndStop(1);
}
}
movieClip 154 {
instance of movieClip 137 {
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(32)) {
_parent.gotoAndStop(2);
}
}
}
instance of movieClip 144 {
onClipEvent (enterFrame) {
if (_root.lasers == true) {
this.play();
} else {
_parent.gotoAndStop(4);
}
}
}
instance of movieClip 149 {
onClipEvent (load) {
_root.groundfire = true;
}
onClipEvent (enterFrame) {
if (_root.lasers == false) {
_parent.nextFrame();
}
}
}
instance of movieClip 153 {
onClipEvent (load) {
_root.groundfire = true;
}
}
}
instance eyebeams of movieClip 154 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (Key.isDown(32)) {
_root.lasers = true;
} else {
_root.lasers = false;
}
}
}
movieClip 157 {
}
movieClip 159 {
frame 17 {
prevFrame();
}
}
instance of movieClip 159 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (Key.isDown(37)) {
this.play();
}
}
}
movieClip 162 {
frame 17 {
prevFrame();
}
}
instance of movieClip 162 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (Key.isDown(38)) {
this.play();
}
}
}
movieClip 165 {
frame 17 {
prevFrame();
}
}
instance of movieClip 165 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (Key.isDown(39)) {
this.play();
}
}
}
movieClip 167 {
frame 17 {
prevFrame();
}
}
instance of movieClip 167 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (Key.isDown(32)) {
this.play();
}
}
}
movieClip 174 {
}
instance manleft of movieClip 174 {
onClipEvent (load) {
if (_name == 'manleft') {
_x = 1000;
} else {
_x = _root.spawnx - 5;
_y = _root.spawny;
}
}
onClipEvent (enterFrame) {
if (_name != 'manleft') {
_x = _x - 2;
_y = _y + 1;
}
if (this._y > 500) {
this.removeMovieClip();
}
}
}
instance manright of movieClip 174 {
onClipEvent (load) {
if (_name == 'manright') {
_x = 1000;
} else {
_x = _root.spawnx + 5;
_y = _root.spawny;
}
}
onClipEvent (enterFrame) {
if (_name != 'manright') {
_x = _x + 2;
_y = _y + 1;
}
if (this._y > 500) {
this.removeMovieClip();
}
}
}
movieClip 176 {
}
movieClip 181 {
}
instance fire of movieClip 181 {
onClipEvent (enterFrame) {
if (_root.groundfire == true) {
_x = 15 + _root.sun._x + (this._y - _root.sun._y) / 1.732050807568877;
} else {
_x = -1000;
}
}
}
movieClip 193 {
frame 10 {
stop();
}
}
movieClip 194 {
frame 2 {
_root.spawnx = _x;
_root.spawny = _y + 10;
duplicateMovieClip(_root.manleft, 'manleft' + _root.i, _root.i);
++_root.i;
duplicateMovieClip(_root.manright, 'manright' + _root.i, _root.i);
++_root.i;
}
}
instance of movieClip 194 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.fire.hit)) {
this.gotoAndStop(2);
}
_x = _x - 3;
if (this._x < -50) {
this.gotoAndStop(1);
_x = 650;
}
}
}
instance of movieClip 194 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.fire.hit)) {
this.gotoAndStop(2);
}
_x = _x - 3;
if (this._x < -50) {
this.gotoAndStop(1);
_x = 650;
}
}
}
instance of movieClip 194 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.fire.hit)) {
this.gotoAndStop(2);
}
_x = _x - 3;
if (this._x < -50) {
this.gotoAndStop(1);
_x = 650;
}
}
}
instance of movieClip 194 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.fire.hit)) {
this.gotoAndStop(2);
}
_x = _x - 3;
if (this._x < -50) {
this.gotoAndStop(1);
_x = 650;
}
}
}
instance of movieClip 194 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.fire.hit)) {
this.gotoAndStop(2);
}
_x = _x - 3;
if (this._x < -50) {
this.gotoAndStop(1);
_x = 650;
}
}
}
instance of movieClip 194 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.fire.hit)) {
this.gotoAndStop(2);
}
_x = _x - 3;
if (this._x < -50) {
this.gotoAndStop(1);
_x = 650;
}
}
}
instance of movieClip 194 {
onClipEvent (load) {
this.gotoAndStop(1);
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.fire.hit)) {
this.gotoAndStop(2);
}
_x = _x - 3;
if (this._x < -50) {
this.gotoAndStop(1);
_x = 650;
}
}
}
// unknown tag 88 length 107
movieClip 199 {
frame 11 {
stop();
}
}
movieClip 201 {
frame 793 {
_root.medal_popup.unlockMedal('Failure to Communicate');
_root.achieveSound.start(0, 1);
stop();
}
}
movieClip 202 {
frame 330 {
stop();
}
}
// unknown tag 88 length 67
// unknown tag 88 length 62
movieClip 208 {
}
// unknown tag 88 length 67
movieClip 214 {
}
movieClip 215 {
frame 1 {
function unlockMedal(m_name) {
clearInterval(pop_delay);
var v1 = com.Newgrounds.NewgroundsAPI.getMedals();
var v2 = null;
for (i in v1) {
if (v1[i].medal_name == m_name) {
v2 = v1[i];
medal_name = v2.medal_name;
medal_value = v2.medal_value + 'pts';
com.Newgrounds.NewgroundsAPI.unlockMedal(medal_name);
pop_delay = setInterval(endDelay, 3000);
_visible = true;
gotoAndPlay(2);
break;
}
}
}
function endDelay(params) {
gotoAndPlay(10);
clearInterval(pop_delay);
}
var pop_delay;
var medal_name = '?????';
var medal_value = '???';
_visible = false;
}
frame 10 {
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + '.gif');
medal_icon.attachBitmap(myBitmapData, 111);
stop();
}
}
movieClip 216 {
}
instance of movieClip 216 {
onClipEvent (load) {
this.swapDepths(100000);
}
}