STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229456
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2574 · P5148

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/59255217?noj=FRM59255217-5DC" width="1" height="1"></div>

Brawl Royale.swf

This is the info page for
Flash #56113

(Click the ID number above for more basic data on this flash file.)


ActionScript [AS1/AS2]
Combined Code
frame 1 { _root.API_Settings = {'movie_id': 2922, 'enc_key': '7394601bb51096246dc8c70a03ed3455', 'debug_mode': false, 'movie_version': ''}; } frame 1 { } frame 1 { Stage.showMenu = false; } frame 1 { stopAllSounds(); } button 18 { on (keyPress '<Left>') { nextFrame(); } } movieClip 19 { frame 1 { stop(); } } movieClip 25 { } movieClip 29 { } movieClip 37 { } movieClip 40 { } movieClip 44 { } movieClip 45 { } movieClip 51 { } movieClip 53 { } movieClip 56 { } movieClip 58 { } movieClip 60 { } movieClip 62 { } movieClip 78 { } movieClip 83 { } movieClip 87 { } movieClip 97 { frame 40 { stop(); } } movieClip 110 { } button 111 { on (press) { tellTarget ('_root') { nextFrame(); } } } button 112 { on (press) { gotoAndStop('end'); _root.play(); } } movieClip 113 { instance of movieClip 87 { onClipEvent (load) { _root.stop(); PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100); if (PercentLoaded != 100) { _parent.gotoAndStop(PercentLoaded); } else { _parent.gotoAndStop('lastframe'); } } onClipEvent (enterFrame) { PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100); if (PercentLoaded != 100) { _parent.gotoAndStop(PercentLoaded); } else { _parent.gotoAndPlay('loaded'); } } } frame 101 { play(); } frame 165 { stop(); } } button 119 { on (release) { NewgroundsAPI.loadNewgrounds(); } } button 125 { on (release) { NewgroundsAPI.loadNewgrounds(); } } movieClip 126 { } movieClip 127 { frame 1 { function startAd(ngad_url) { trace('opening ' + ngad_url); System.security.allowDomain('70.87.128.99'); System.security.allowInsecureDomain('70.87.128.99'); System.security.allowDomain('ads.shizmoo.com'); System.security.allowInsecureDomain('ads.shizmoo.com'); System.security.allowDomain('www.cpmstar.com'); System.security.allowInsecureDomain('www.cpmstar.com'); System.security.allowDomain('server.cpmstar.com'); System.security.allowInsecureDomain('server.cpmstar.com'); var ngads_redirect = new XML(); ngads_redirect.ignoreWhite = true; ngads_redirect.onLoad = function (success) { trace('[NEWGROUNDS FLASH ADS] :: You may get a \'Security Sandbox Violation\' ... this is normal, do not freak out!'); if (success) { ng_ad.loadMovie(ngads_redirect.toString(), 'GET'); } else {} }; ngads_redirect.load(ngad_url); } if (NewgroundsAPI.getAdURL()) { startAd(NewgroundsAPI.getAdURL()); } NewgroundsAPI.onAdsApproved = function (ad_url) { startAd(ad_url); }; stop(); } } movieClip 132 { } movieClip 133 { frame 1 { com.Newgrounds.NewgroundsAPI.attachFlashAd(_parent[_name]); var attachAd = function () { com.Newgrounds.NewgroundsAPI.attachFlashAd(_parent[_name]); }; com.Newgrounds.NewgroundsAPI.addEventListener(com.Newgrounds.NewgroundsAPI.events.ADS_APPROVED, attachAd); background._visible = false; } } button 136 { on (release) { this._visible = false; } } movieClip 143 { 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 1733 __Packages.NewgroundsAPI { #initclip if (!_global.NewgroundsAPI) { var v1 = function () {}; _global.NewgroundsAPI = v1; var v2 = v1.prototype; v1.connectMovie = function (id) { if (!id) { NewgroundsAPI.SendError('Missing required \'id\' parameter in NewgroundsAPI.connectMovie(id:Number)'); } else { if (!NewgroundsAPI.tracker_id) { NewgroundsAPI.SendMessage('Connecting to API gateway...'); NewgroundsAPI.tracker_id = id; NewgroundsAPI.host = (_url.split('/'))[2].toLowerCase(); if (NewgroundsAPI.host.length < 1) { NewgroundsAPI.host = 'localhost'; } var v2 = new Object(); NewgroundsAPI.SendEvent(NewgroundsAPI.MOVIE_VIEWS); } } }; v1.setMovieVersion = function (movie_version) { if (!movie_version) { NewgroundsAPI.SendError('Missing required \'version\' in NewgroundsAPI.setMovieVersion(version:String)'); } else { NewgroundsAPI.version = movie_version; } }; v1.debugMode = function () { NewgroundsAPI.debug = true; }; v1.addCustomEvent = function (stat_id, stat_name) { if (!stat_id) { NewgroundsAPI.SendError('Missing required \'id\' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)'); } else { if (!stat_name) { NewgroundsAPI.SendError('Missing required \'event_name\' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)'); } else { NewgroundsAPI.custom_events[stat_name] = NewgroundsAPI.CUSTOM_STATS + stat_id; NewgroundsAPI.SendMessage('Created custom event: ' + stat_name); } } }; v1.addCustomLink = function (stat_id, stat_name) { if (!stat_id) { NewgroundsAPI.SendError('Missing required \'id\' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)'); } else { if (!stat_name) { NewgroundsAPI.SendError('Missing required \'link_name\' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)'); } else { NewgroundsAPI.custom_links[stat_name] = NewgroundsAPI.CUSTOM_STATS + stat_id; NewgroundsAPI.SendMessage('Created custom link ' + stat_id + ': ' + stat_name); } } }; v1.loadMySite = function () { NewgroundsAPI.SendLink(NewgroundsAPI.AUTHOR_SITE); }; v1.loadNewgrounds = function (special) { if (special) { var v1 = {'page': special}; } NewgroundsAPI.SendLink(NewgroundsAPI.NEWGROUNDS, v1); }; v1.logCustomEvent = function (event_name) { if (!event_name) { NewgroundsAPI.SendError('Missing required \'event_name\' parameter in NewgroundsAPI.logCustomEvent(event_name:String)'); } else { if (!NewgroundsAPI.custom_events[event_name]) { NewgroundsAPI.SendError('Attempted to log undefined custom event: ' + event_name); } else { NewgroundsAPI.SendEvent(NewgroundsAPI.custom_events[event_name]); } } }; v1.loadCustomLink = function (link_name) { if (!link_name) { NewgroundsAPI.SendError('Missing required \'link_name\' parameter in NewgroundsAPI.loadCustomLink(link_name:String)'); } else { if (!NewgroundsAPI.custom_links[link_name]) { NewgroundsAPI.SendError('Attempted to open undefined custom link: ' + link_name); } else { NewgroundsAPI.SendLink(NewgroundsAPI.custom_links[link_name]); } } }; v1.getAdURL = function () { return NewgroundsAPI.movie_options.ad_url; }; v1.getMovieURL = function () { if (NewgroundsAPI.movie_options.movie_url) { return NewgroundsAPI.movie_options.movie_url; } else { return 'Newgrounds.com'; } }; v1.getNewVersionURL = function () { return NewgroundsAPI.GATEWAY_URL + '?&id=' + NewgroundsAPI.tracker_id + '&host=' + escape(NewgroundsAPI.host) + '&stat=' + NewgroundsAPI.NEW_VERSION; }; v1.SendEvent = function (id) { NewgroundsAPI.SendStat(id, false); }; v1.SendLink = function (id, extra) { NewgroundsAPI.SendStat(id, true, extra); }; v1.ReadGatewayData = function (params) { for (var v2 in params) { params[v2] = unescape(params[v2]); NewgroundsAPI.movie_options[v2] = params[v2]; } if (params.settings_loaded) { NewgroundsAPI.SendMessage('You have successfully connected to the Newgrounds API gateway!'); NewgroundsAPI.SendMessage('Movie Identified as \'' + NewgroundsAPI.movie_options.movie_name + '\''); if (NewgroundsAPI.movie_options.message) { NewgroundsAPI.SendMessage(NewgroundsAPI.movie_options.message); } if (NewgroundsAPI.movie_options.ad_url) { NewgroundsAPI.SendMessage('Your movie has been approved to run Flash Ads'); NewgroundsAPI.onAdsApproved(NewgroundsAPI.movie_options.ad_url); } if (NewgroundsAPI.movie_options.movie_version and NewgroundsAPI.movie_options.movie_version.toString() != NewgroundsAPI.version.toString()) { NewgroundsAPI.SendMessage('WARNING: The movie version configured in your API settings does not match this movie\'s version!'); NewgroundsAPI.onNewVersionAvailable(NewgroundsAPI.movie_options.movie_version, NewgroundsAPI.getMovieURL(), NewgroundsAPI.getNewVersionURL()); } if (NewgroundsAPI.movie_options.deny_host) { NewgroundsAPI.SendMessage('You have blocked \'localHost\' in your API settings.'); NewgroundsAPI.SendMessage('If you wish to test your movie you will need to remove this block.'); NewgroundsAPI.onDenyHost(NewgroundsAPI.host, NewgroundsAPI.getMovieURL(), NewgroundsAPI.getNewVersionURL()); } if (NewgroundsAPI.movie_options.request_portal_url == 1) { var v4 = NewgroundsAPI.GATEWAY_URL + '?&id=' + NewgroundsAPI.tracker_id + '&portal_url=' + escape(_url); var v3 = new XML(); v3.ignoreWhite = true; v3.load(v4); } } else { if (!NewgroundsAPI.movie_options.settings_loaded) { NewgroundsAPI.SendError('Could not establish connection to the API gateway.'); } } }; v1.SendStat = function (stat_id, open_in_browser, extra) { if (!NewgroundsAPI.tracker_id) { NewgroundsAPI.SendError('API calls cannot be made without a valid movie id.'); NewgroundsAPI.SendError('Did you remember to add the "NewgroundsAPI.connectMovie()" code?'); } else { var v7 = NewgroundsAPI.GATEWAY_URL + '?&id=' + NewgroundsAPI.tracker_id + '&host=' + escape(NewgroundsAPI.host) + '&stat=' + stat_id; for (var v9 in extra) { v7 += '&' + escape(v9) + '=' + escape(extra[v9]); } trace(v7); if (NewgroundsAPI.debug) { v7 += '&debug=1'; } if (open_in_browser) { getURL(v7, '_blank'); } else { var v10 = new XML(); v10.ignoreWhite = true; v10.onLoad = function (success) { var v6 = new Object(); var v3 = 0; while (v3 < this.firstChild.childNodes.length) { var v4 = this.firstChild.childNodes[v3]; var v5 = v4.nodeName; var v2 = v4.attributes.value; if (v2 == Number(v2)) { v2 = Number(v2); } v6[v5] = v2; ++v3; } NewgroundsAPI.ReadGatewayData(v6); }; v10.load(v7); } } }; v1.SendError = function (msg) { trace('[NEWGROUNDS API ERROR] :: ' + msg); }; v1.SendMessage = function (msg) { trace('[NEWGROUNDS API] :: ' + msg); }; v1.InitTextFormats = function () { if (!NewgroundsAPI.error_format) { NewgroundsAPI.error_format = new TextFormat(); NewgroundsAPI.error_format.font = 'Arial Black'; NewgroundsAPI.error_format.size = 48; NewgroundsAPI.error_format.color = 16711680; } if (!NewgroundsAPI.header_format) { NewgroundsAPI.header_format = new TextFormat(); NewgroundsAPI.header_format.font = 'Arial Black'; NewgroundsAPI.header_format.size = 24; NewgroundsAPI.header_format.color = 16777215; } if (!NewgroundsAPI.normal_format) { NewgroundsAPI.normal_format = new TextFormat(); NewgroundsAPI.normal_format.font = 'Arial'; NewgroundsAPI.normal_format.bold = true; NewgroundsAPI.normal_format.size = 12; NewgroundsAPI.normal_format.color = 16777215; } if (!NewgroundsAPI.link_format) { NewgroundsAPI.link_format = new TextFormat(); NewgroundsAPI.link_format.color = 16776960; NewgroundsAPI.link_format.underline = true; } }; v1.onNewVersionAvailable = function (version, movie_url, redirect_url) { 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 ' + version + ' is now available at:' + '\n'; var v5 = v3.length; v3 += 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(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(NewgroundsAPI.normal_format); NewgroundsAPI.link_format.url = redirect_url; _root.NGAPI_new_version_overlay.message.setTextFormat(v5, v4, NewgroundsAPI.link_format); }; v1.onDenyHost = function (hostname, movie_url, redirect_url) { 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 ' + hostname + '.'; v2 += '\r\rFor an aproved copy, please visit:\r'; var v4 = v2.length; v2 += 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(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(NewgroundsAPI.normal_format); NewgroundsAPI.link_format.url = redirect_url; _root.NGAPI_deny_host_overlay.message.setTextFormat(v4, v3, NewgroundsAPI.link_format); }; v1.isInstalled = function () { return true; }; v1.onAdsApproved = function (ad_url) {}; v1.movie_options = new Object(); v1.custom_events = new Object(); v1.custom_links = new Object(); v1.MOVIE_VIEWS = 1; v1.AUTHOR_SITE = 2; v1.NEWGROUNDS = 3; v1.NEW_VERSION = 4; v1.CUSTOM_STATS = 50; v1.GATEWAY_URL = 'http://www.ngads.com/gateway.php'; ASSetPropFlags(_global.NewgroundsAPI.prototype, null, 1); } #endinitclip } movieClip 1734 __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 1735 __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 1736 __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 1737 __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 1738 __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 1739 __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 1740 __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 1741 __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 2 { _quality = 'MEDIUM'; quality = 'MEDIUM'; } frame 7 { function checkDeaths() { trace(deathList); a = 0; for (d in deathList) { a += deathList[d]; } if (a >= 10) { _root.medal_popup.unlockMedal('Masochist'); } trace(a); } medalList = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; deathList = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; brokill = true; } frame 10 { stopAllSounds(); play(); } frame 11 { mute = false; } frame 11 { play(); } movieClip 146 { } movieClip 148 { } movieClip 150 { } movieClip 153 { } movieClip 162 { } button 177 { on (release) { gotoAndPlay('play'); } on (keyPress '<Space>') { gotoAndPlay('play'); } } button 183 { on (release) { gotoAndPlay('gallery'); } } button 188 { on (release) { gotoAndPlay('credits'); } } button 193 { on (release) { gotoAndPlay('pvp'); } } button 198 { on (release) { getURL('http://kupo707.deviantart.com', '_blank'); } } movieClip 200 { } button 205 { on (release) { _quality = 'HIGH'; quality = 'HIGH'; } } button 208 { on (release) { _quality = 'MEDIUM'; quality = 'MEDIUM'; } } button 211 { on (release) { _quality = 'LOW'; quality = 'LOW'; } } movieClip 213 { } movieClip 219 { } movieClip 225 { } movieClip 226 { frame 1 { function unlockMedal(m_name) { 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); _visible = true; gotoAndPlay(2); break; } } } var pop_delay; var medal_name = '?????'; var medal_value = '???'; stop(); _visible = false; } frame 10 { var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + '.gif'); medal_icon.attachBitmap(myBitmapData, 111); } } frame 19 { stop(); } movieClip 229 { } movieClip 231 { } movieClip 233 { } button 234 { on (release) { nextFrame(); } } movieClip 237 { } button 238 { on (release) { prevFrame(); } } movieClip 242 { } movieClip 246 { } movieClip 250 { } movieClip 254 { } movieClip 258 { } movieClip 262 { } movieClip 266 { } movieClip 270 { } movieClip 274 { } movieClip 278 { } movieClip 282 { } movieClip 286 { } movieClip 290 { } movieClip 294 { } movieClip 298 { } movieClip 302 { } movieClip 306 { } movieClip 310 { } movieClip 314 { } movieClip 318 { } movieClip 322 { } movieClip 326 { } movieClip 330 { } movieClip 333 { } movieClip 336 { } movieClip 339 { } movieClip 342 { } movieClip 345 { } movieClip 348 { } movieClip 351 { } movieClip 354 { } movieClip 357 { } movieClip 360 { } movieClip 362 { } movieClip 365 { } movieClip 367 { } movieClip 371 { } movieClip 375 { } movieClip 379 { } movieClip 383 { } movieClip 387 { } movieClip 391 { } movieClip 395 { } movieClip 399 { } movieClip 403 { } movieClip 407 { } movieClip 411 { } movieClip 415 { } movieClip 419 { } movieClip 423 { } movieClip 427 { } movieClip 431 { } movieClip 435 { } movieClip 438 { frame 1 { stop(); } } button 443 { on (release) { gotoAndPlay('menu2'); } } frame 37 { stop(); } button 451 { on (release) { gotoAndPlay('gallery'); } } button 452 { on (release) { gotoAndPlay('menu'); } } button 456 { on (press) { getURL('http://kupo707.deviantart.com', '_blank'); } } frame 66 { stop(); } frame 91 { stopAllSounds(); } button 458 { on (keyPress '<Space>') { gotoAndPlay('skip'); } } movieClip 464 { } movieClip 468 { } movieClip 471 { } movieClip 473 { } movieClip 480 { } movieClip 483 { } movieClip 488 { } movieClip 492 { } movieClip 496 { frame 1 { function camControl() { parentColor.setTransform(camColor.getTransform()); var v4 = sX / this._width; var v3 = sY / this._height; _parent._x = cX - this._x * v4; _parent._y = cY - this._y * v3; _parent._xscale = 100 * v4; _parent._yscale = 100 * v3; } function resetStage() { var v2 = {'ra': 100, 'rb': 0, 'ga': 100, 'gb': 0, 'ba': 100, 'bb': 0, 'aa': 100, 'ab': 0}; parentColor.setTransform(v2); _parent._xscale = 100; _parent._yscale = 100; _parent._x = 0; _parent._y = 0; } this._visible = false; var oldMode = Stage.scaleMode; Stage.scaleMode = 'exactFit'; var cX = Stage.width / 2; var cY = Stage.height / 2; var sX = Stage.width; var sY = Stage.height; Stage.scaleMode = oldMode; var camColor = new Color(this); var parentColor = new Color(_parent); this.onEnterFrame = camControl; camControl(); this.onUnload = resetStage; } } frame 622 { BGM = new Sound(); BGM.attachSound('strat'); BGM.start(0, 99); mute = false; } movieClip 500 { } button 572 { on (release) { tellTarget ('/') { gotoAndPlay(1); } } on (keyPress '<Space>') { tellTarget ('/') { gotoAndPlay(1); } } } button 573 { on (release) { tellTarget ('/') { gotoAndPlay('menu'); } } on (keyPress '<Space>') { tellTarget ('/') { gotoAndPlay('menu'); } } } movieClip 574 { frame 1 { stop(); } frame 24 { stop(); tellTarget ('/') { play(); } } frame 40 { stop(); tellTarget ('/') { play(); } } frame 129 { stop(); } } button 578 { on (release) { if (!_root.mute) { _root.BGM.setVolume(0); _root.mute = true; } else { _root.BGM.setVolume(100); _root.mute = false; } } } movieClip 579 { } movieClip 581 { } movieClip 589 { } movieClip 591 { } movieClip 596 { } movieClip 598 { } movieClip 605 { } movieClip 608 { } movieClip 609 { } movieClip 611 { } movieClip 613 { } movieClip 614 { } movieClip 616 { } movieClip 617 { } movieClip 619 { } movieClip 621 { } movieClip 632 { frame 1 { stop(); } frame 117 { tellTarget ('/fouls') { play(); } } } button 653 { on (keyPress '<Space>') { gotoAndStop('round1'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round1'); tellTarget ('foul') { gotoAndPlay(1); } } } frame 985 { play(); } button 656 { on (keyPress '<Space>') { gotoAndPlay('win1'); } on (press) { gotoAndPlay('win1'); } } frame 1213 { deathList[0] = 1; _root.checkDeaths(); } button 673 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 1271 { stop(); } frame 1271 { stop(); } button 674 { on (release) { tellTarget ('/') { gotoAndPlay(1); } } on (keyPress '<Space>') { tellTarget ('/') { gotoAndPlay(1); } } } movieClip 675 { } frame 1318 { if (!medalList[1]) { _root.medal_popup.unlockMedal('NoLegs'); medalList[1] = 1; } } button 692 { on (keyPress '<Space>') { gotoAndPlay('round2'); } } movieClip 696 { } movieClip 698 { } movieClip 700 { } movieClip 702 { } movieClip 704 { } movieClip 706 { } movieClip 708 { } movieClip 710 { } movieClip 712 { } movieClip 714 { } movieClip 716 { } movieClip 718 { } movieClip 720 { } movieClip 722 { } button 729 { on (keyPress '<Space>') { gotoAndStop('round2'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round2'); tellTarget ('foul') { gotoAndPlay(1); } } } frame 1907 { play(); } button 730 { on (keyPress '<Space>') { gotoAndPlay('win2'); } on (press) { gotoAndPlay('win2'); } } movieClip 738 { } frame 2037 { deathList[1] = 1; _root.checkDeaths(); } button 772 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 2153 { stop(); } frame 2218 { if (!medalList[2]) { _root.medal_popup.unlockMedal('Tonberry'); medalList[2] = 1; } } button 793 { on (keyPress '<Space>') { gotoAndPlay('round3'); } } movieClip 796 { } button 828 { on (keyPress '<Space>') { gotoAndStop('round3'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round3'); tellTarget ('foul') { gotoAndPlay(1); } } } frame 2909 { play(); } button 829 { on (keyPress '<Space>') { gotoAndPlay('win3'); } on (press) { gotoAndPlay('win3'); } } movieClip 834 { } movieClip 839 { } movieClip 849 { } frame 3046 { deathList[2] = 1; _root.checkDeaths(); } button 856 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 3164 { stop(); } movieClip 877 { } frame 3300 { if (!medalList[3]) { _root.medal_popup.unlockMedal('Red Mage'); medalList[3] = 1; } } button 878 { on (keyPress '<Space>') { gotoAndPlay('round4'); } } movieClip 894 { } movieClip 896 { } movieClip 906 { } movieClip 922 { } movieClip 926 { } button 935 { on (keyPress '<Space>') { gotoAndStop('round4'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round4'); tellTarget ('foul') { gotoAndPlay(1); } } } frame 4014 { play(); } button 936 { on (keyPress '<Space>') { gotoAndPlay('win4'); } on (press) { gotoAndPlay('win4'); } } movieClip 946 { } movieClip 962 { } frame 4099 { deathList[3] = 1; _root.checkDeaths(); } button 963 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 4219 { stop(); } frame 4328 { if (!medalList[4]) { _root.medal_popup.unlockMedal('Yoko'); medalList[4] = 1; } } button 965 { on (keyPress '<Space>') { gotoAndPlay('round5'); } } movieClip 968 { } movieClip 970 { } movieClip 974 { } movieClip 975 { } movieClip 981 { } movieClip 986 { } movieClip 988 { } movieClip 991 { } movieClip 994 { } movieClip 996 { } button 1002 { on (keyPress '<Space>') { gotoAndStop('round5'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round5'); tellTarget ('foul') { gotoAndPlay(1); } } } button 1003 { on (keyPress '<Space>') { gotoAndPlay('win5'); } on (press) { gotoAndPlay('win5'); } } movieClip 1009 { } movieClip 1011 { } movieClip 1035 { } frame 4950 { deathList[4] = 1; _root.checkDeaths(); } button 1036 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 5099 { stop(); } movieClip 1043 { } movieClip 1046 { } frame 5199 { if (!medalList[5]) { _root.medal_popup.unlockMedal('Black Waltz'); medalList[5] = 1; } } button 1048 { on (keyPress '<Space>') { gotoAndPlay('round6'); } } movieClip 1054 { } movieClip 1055 { } movieClip 1059 { } movieClip 1069 { } movieClip 1070 { } button 1079 { on (keyPress '<Space>') { gotoAndStop('round6'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round6'); tellTarget ('foul') { gotoAndPlay(1); } } } button 1080 { on (keyPress '<Space>') { gotoAndPlay('win6'); } on (press) { gotoAndPlay('win6'); } } frame 5867 { deathList[5] = 1; _root.checkDeaths(); } button 1083 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 5981 { stop(); } movieClip 1088 { } movieClip 1158 { } frame 6036 { if (!medalList[6]) { _root.medal_popup.unlockMedal('Lazarus'); medalList[6] = 1; } } button 1160 { on (keyPress '<Space>') { gotoAndPlay('round7'); } } movieClip 1170 { } movieClip 1172 { } movieClip 1176 { } movieClip 1179 { } movieClip 1181 { } button 1220 { on (keyPress '<Space>') { gotoAndStop('round7'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round7'); tellTarget ('foul') { gotoAndPlay(1); } } } button 1221 { on (keyPress '<Space>') { gotoAndPlay('win7'); } on (press) { gotoAndPlay('win7'); } } frame 6921 { deathList[6] = 1; _root.checkDeaths(); } button 1234 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 7037 { stop(); } movieClip 1248 { } movieClip 1257 { } frame 7119 { if (!medalList[7]) { _root.medal_popup.unlockMedal('Mecha'); medalList[7] = 1; } } button 1261 { on (keyPress '<Space>') { gotoAndPlay('round8'); } } movieClip 1264 { } movieClip 1281 { } movieClip 1282 { } movieClip 1284 { } movieClip 1295 { } button 1305 { on (keyPress '<Space>') { gotoAndStop('round8'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round8'); tellTarget ('foul') { gotoAndPlay(1); } } } movieClip 1308 { } button 1309 { on (keyPress '<Space>') { gotoAndPlay('win8'); } on (press) { gotoAndPlay('win8'); } } movieClip 1311 { } frame 7840 { deathList[7] = 1; _root.checkDeaths(); } button 1320 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 7964 { stop(); } frame 8084 { if (!medalList[8]) { _root.medal_popup.unlockMedal('Natalie'); medalList[8] = 1; } } button 1333 { on (keyPress '<Space>') { gotoAndPlay('round9'); } } movieClip 1335 { } movieClip 1336 { } movieClip 1338 { } movieClip 1341 { } movieClip 1351 { } movieClip 1355 { } movieClip 1358 { } movieClip 1360 { } movieClip 1362 { } movieClip 1363 { } button 1367 { on (keyPress '<Space>') { gotoAndStop('round9'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round9'); tellTarget ('foul') { gotoAndPlay(1); } } } button 1368 { on (keyPress '<Space>') { gotoAndPlay('win9'); } on (press) { gotoAndPlay('win9'); } } frame 8793 { deathList[8] = 1; _root.checkDeaths(); } button 1377 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 8922 { stop(); } frame 9048 { if (!medalList[9]) { _root.medal_popup.unlockMedal('Canti'); medalList[9] = 1; } } button 1480 { on (keyPress '<Space>') { gotoAndPlay('round10'); } } movieClip 1482 { } movieClip 1484 { } movieClip 1490 { } movieClip 1491 { } movieClip 1499 { } movieClip 1503 { } movieClip 1505 { } movieClip 1507 { } movieClip 1511 { } movieClip 1513 { } movieClip 1517 { } movieClip 1519 { } movieClip 1526 { } movieClip 1528 { } movieClip 1530 { } movieClip 1531 { } movieClip 1537 { } button 1541 { on (keyPress '<Space>') { gotoAndStop('round10'); tellTarget ('foul') { gotoAndPlay(1); } } on (press) { gotoAndStop('round10'); tellTarget ('foul') { gotoAndPlay(1); } } } button 1542 { on (keyPress '<Space>') { gotoAndPlay('win10'); } on (press) { gotoAndPlay('win10'); } } movieClip 1550 { } movieClip 1552 { } movieClip 1556 { } movieClip 1559 { } frame 9992 { deathList[9] = 1; _root.checkDeaths(); } movieClip 1561 { } movieClip 1563 { } movieClip 1569 { } movieClip 1570 { } button 1572 { on (release) { gotoAndPlay('menu'); } on (keyPress '<Space>') { gotoAndPlay('menu'); } } frame 10482 { stop(); } movieClip 1591 { } movieClip 1608 { } movieClip 1610 { } movieClip 1612 { } frame 10811 { if (!medalList[10]) { _root.medal_popup.unlockMedal('Goku'); medalList[10] = 1; } } frame 10922 { stopAllSounds(); } movieClip 1614 { } movieClip 1616 { } movieClip 1618 { } movieClip 1619 { } movieClip 1621 { } movieClip 1622 { } movieClip 1625 { frame 707 { stop(); } } movieClip 1638 { } movieClip 1653 { } movieClip 1656 { } movieClip 1660 { } movieClip 1666 { } movieClip 1668 { frame 1 { stop(); } frame 16 { _root.medal_popup.unlockMedal('Tonberry'); } frame 26 { _root.medal_popup.unlockMedal('Red Mage'); } frame 36 { _root.medal_popup.unlockMedal('Yoko'); } frame 46 { _root.medal_popup.unlockMedal('Black Waltz'); } frame 56 { _root.medal_popup.unlockMedal('Lazarus'); } frame 66 { _root.medal_popup.unlockMedal('Mecha'); } frame 76 { _root.medal_popup.unlockMedal('Natalie'); } frame 86 { _root.medal_popup.unlockMedal('Canti'); } frame 96 { _root.medal_popup.unlockMedal('Goku'); } } button 1673 { on (release) { _root.medals.play(); } } button 1674 { on (release) { _root.gotoAndPlay('menu'); } } movieClip 1675 { } frame 11713 { stop(); } movieClip 1677 { } movieClip 1678 { frame 362 { stop(); } } frame 11714 { p1points = 0; p2points = 0; stopAllSounds(); } frame 11769 { stop(); } button 1691 { on (release) { play(); } on (keyPress '<Space>') { play(); } } button 1692 { on (release) { play(); } } frame 11779 { BGM = new Sound(); BGM.attachSound('gundam'); BGM.start(0, 99); mute = false; } button 1695 { on (keyPress '<Space>') { gotoAndPlay('p1foul'); } on (keyPress '<Enter>') { gotoAndPlay('p2foul'); } } button 1696 { on (keyPress '<Space>') { gotoAndPlay('p1win'); } on (keyPress '<Enter>') { gotoAndPlay('p2win'); } } button 1697 { on (keyPress '<Space>') { gotoAndPlay('p1win'); } on (keyPress '<Enter>') { gotoAndPlay('p2win'); } } button 1703 { on (release) { play(); } on (keyPress '<Space>') { play(); } on (keyPress '<Enter>') { play(); } } button 1704 { on (release) { gotoAndPlay('menu'); } } frame 12148 { stop(); } frame 12165 { gotoAndPlay('pvpStart'); } frame 12182 { p1points += 1; } frame 12209 { if (brokill) { _root.medal_popup.unlockMedal('Cool Story Bro'); brokill = false; } } frame 12303 { stop(); } frame 12312 { gotoAndPlay('again'); } frame 12326 { p2points += 1; } frame 12449 { stop(); } frame 12458 { gotoAndPlay('again'); } frame 12464 { p1points -= 1; } frame 12575 { stop(); } frame 12584 { gotoAndPlay('again'); } frame 12589 { p2points -= 1; } frame 12701 { stop(); } frame 12710 { gotoAndPlay('again'); }




http://swfchan.com/12/56113/info.shtml
Created: 19/4 -2019 18:08:01 Last modified: 19/4 -2019 18:08:01 Server time: 05/11 -2024 09:26:52