Combined Code
frame 1 {
var limitedMenu = new ContextMenu();
limitedMenu.hideBuiltInItems();
_root.menu = limitedMenu;
}
frame 1 {
YOUR_MOVIE_ID = 34;
var Newgrounds_API = new NewgroundsAPI_AS2(34);
Newgrounds_API.onDenyHost = function (host) {
trace(host + ' does not have permission to use this movie!');
gotoAndPlay('deny_host');
};
}
movieClip 4 {
}
movieClip 8 {
}
movieClip 18 {
frame 40 {
stop();
}
}
movieClip 31 {
}
button 32 {
on (press) {
tellTarget ('_root') {
nextFrame();
}
}
}
button 33 {
on (press) {
gotoAndStop('end');
_root.play();
}
}
movieClip 34 {
instance of movieClip 8 {
onClipEvent (load) {
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 40 {
on (release) {
_global.NewgroundsAPI_DataObject.API.LoadNewgrounds();
}
}
button 46 {
on (release) {
_global.NewgroundsAPI_DataObject.API.LoadNewgrounds();
}
}
movieClip 47 {
}
movieClip 48 {
frame 1 {
function startAd(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('\r::IGNORE THE FOLLOWING ERROR IF THE AD LOADS::');
if (success) {
ng_ad.loadMovie(ngads_redirect.toString(), 'GET');
} else {}
};
var v1 = 731;
var v2 = 3;
ngads_redirect.load(ngad_url);
}
_root.stop();
if (_global.NewgroundsAPI_DataObject.ad_url) {
startAd(_global.NewgroundsAPI_DataObject.ad_url);
}
_global.NewgroundsAPI_DataObject.API.onAdsApproved = function () {
startAd(_global.NewgroundsAPI_DataObject.ad_url);
};
stop();
}
}
movieClip 4812 __Packages.NewgroundsAPI_AS2 {
#initclip
if (!_global.NewgroundsAPI_AS2) {
_global.NewgroundsAPI_AS2 = function (id) {
this.movie_id = id;
this.error_format = new TextFormat();
this.error_format.font = 'Arial Black';
this.error_format.size = 48;
this.error_format.color = 16711680;
this.header_format = new TextFormat();
this.header_format.font = 'Arial Black';
this.header_format.size = 24;
this.header_format.color = 16777215;
this.normal_format = new TextFormat();
this.normal_format.font = 'Arial';
this.normal_format.bold = true;
this.normal_format.size = 12;
this.normal_format.color = 16777215;
this.link_format = new TextFormat();
this.link_format.color = 16776960;
this.link_format.underline = true;
this.host = (_url.split('/'))[2].toLowerCase();
if (this.host.length < 1) {
this.host = 'localhost';
}
this.stat_ids = new Object();
this.stat_ids.movie_views = 1;
this.stat_ids.author_referrals = 2;
this.stat_ids.ng_referrals = 3;
this.stat_ids.version_referrals = 4;
if (!_global.NewgroundsAPI_DataObject) {
_global.NewgroundsAPI_DataObject = new Object();
_global.NewgroundsAPI_DataObject.API = this;
var v3 = new Object();
v3.id = this.movie_id;
v3.host = this.host;
v3.stat = this.stat_ids.movie_views;
this.sendStats(v3);
}
this.data_object = _global.NewgroundsAPI_DataObject;
};
var v1 = _global.NewgroundsAPI_AS2.prototype;
v1.sendStats = function (params, openInBrowser) {
if (this.debug_mode) {
params.debug = true;
}
var v7 = '?as=2';
for (var v4 in params) {
v7 += '&' + v4 + '=' + escape(String(params[v4]));
}
if (openInBrowser) {
getURL(this.script_url + v7, '_blank');
} else {
var v9 = new XML();
v9.ignoreWhite = true;
v9.onLoad = function (success) {
var v7 = new Object();
var v4 = 0;
while (v4 < this.firstChild.childNodes.length) {
var v5 = this.firstChild.childNodes[v4];
var v6 = v5.nodeName;
var v3 = v5.attributes.value;
if (v3 == Number(v3)) {
v3 = Number(v3);
}
v7[v6] = v3;
++v4;
}
_global.NewgroundsAPI_DataObject.API.eventHandler(v7);
};
v9.load(this.script_url + v7);
}
};
v1.setDebugMode = function (bool) {
this.debug_mode = bool;
};
v1.setMovieVersion = function (version) {
this.movie_version = version.toString();
};
v1.LoadNewgrounds = function (page) {
var v2 = new Object();
v2.id = this.movie_id;
v2.host = this.host;
v2.stat = this.stat_ids.ng_referrals;
if (!this.data_log.loaded_newgrounds) {
this.data_log.loaded_newgrounds = true;
} else {
v2.skiplog = 1;
}
if (page) {
v2.page = page;
}
this.sendStats(v2, true);
};
v1.LoadMySite = function () {
var v2 = new Object();
v2.id = this.movie_id;
v2.host = this.host;
v2.stat = this.stat_ids.author_referrals;
if (!this.data_log.loaded_mysite) {
this.data_log.loaded_mysite = true;
} else {
v2.skiplog = 1;
}
this.sendStats(v2, true);
};
v1.getHost = function () {
return this.host;
};
v1.getMovieVersion = function () {
return this.movie_version;
};
v1.eventHandler = function (params) {
for (var v3 in params) {
this.data_object[v3] = unescape(params[v3]);
}
if (this.data_object.deny_host) {
this.onDenyHost(this.host, this.data_object.movie_url);
}
if (this.data_object.ad_url and !this.stop_ad) {
this.onAdsApproved();
}
if (this.data_object.movie_version != this.movie_version) {
this.onNewVersionAvailable(this.data_object.movie_version, this.data_object.movie_url);
}
if (this.data_object.request_portal_url) {
var v4 = new Object();
v4.id = this.movie_id;
v4.portal_url = _url;
this.sendStats(v4);
}
if (this.data_object.settings_loaded) {
this.onSettingsLoaded(this.data_object.settings_loaded);
}
};
v1.onAdsApproved = function () {};
v1.onSettingsLoaded = function (success) {
if (success) {
trace('NG API settings have successfully been loaded');
} else {
trace('NG API settings failed to load, make sure you have the correct Movie ID');
}
};
v1.onNewVersionAvailable = function (version, url) {
if (!url or url.length < 1) {
url = 'http://www.newgrounds.com';
}
trace('VERSION ' + version + ' at ' + url);
var v3 = new Object();
v3.x = Stage.width / 2;
v3.y = Stage.height / 2;
_root.createEmptyMovieClip('NGAPI_new_version_overlay', _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(v3.x - 240, v3.y - 120);
_root.NGAPI_new_version_overlay.lineTo(v3.x + 240, v3.y - 120);
_root.NGAPI_new_version_overlay.lineTo(v3.x + 240, v3.y + 80);
_root.NGAPI_new_version_overlay.lineTo(v3.x - 240, v3.y + 80);
_root.NGAPI_new_version_overlay.lineTo(v3.x - 240, v3.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);
_root.NGAPI_new_version_overlay.exit.moveTo(v3.x + 210, v3.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(v3.x + 230, v3.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(v3.x + 230, v3.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(v3.x + 210, v3.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(v3.x + 210, v3.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(v3.x + 214, v3.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(v3.x + 226, v3.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(v3.x + 226, v3.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(v3.x + 214, v3.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 v4 = 'Version ' + version + ' is now available at:' + '\n';
var v7 = v4.length;
v4 += url;
var v6 = v4.length;
_root.NGAPI_new_version_overlay.createTextField('newversion', 100, v3.x - 210, v3.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = 'New Version Available!';
_root.NGAPI_new_version_overlay.newversion.setTextFormat(this.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 = v4;
_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(this.normal_format);
this.link_format.url = this.script_url + '?as=2&id=' + this.movie_id + '&host=' + this.host + '&stat=' + this.stat_ids.version_referrals;
_root.NGAPI_new_version_overlay.message.setTextFormat(v7, v6, this.link_format);
};
v1.onDenyHost = function (host, real_host) {
this.stop_ad = true;
trace('DENIED ' + host);
_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 v3 = 'This movie has not been approved for use on ' + host + '.' + '\n' + '\n' + 'For an aproved copy, please visit:' + '\n';
var v5 = v3.length;
v3 += real_host;
var v4 = v3.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(this.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 = v3;
_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(this.normal_format);
this.link_format.url = real_host;
_root.NGAPI_deny_host_overlay.message.setTextFormat(v5, v4, this.link_format);
};
v1.data_log = new Object();
v1.script_url = 'http://www.ngads.com/gateway.php';
v1.stop_ad = false;
ASSetPropFlags(_global.NewgroundsAPI_AS2.prototype, null, 1);
}
#endinitclip
}
frame 2 {
stop();
}
button 51 {
on (release) {
_global.NewgroundsAPI_DataObject.API.LoadNewgrounds();
}
}
button 55 {
on (release) {
_global.NewgroundsAPI_DataObject.API.LoadMySite();
}
}
button 58 {
on (release) {
this.gotoAndPlay('mga');
}
}
button 62 {
on (release) {
this.gotoAndPlay('extra');
}
}
button 66 {
on (release) {
getURL('http://www.newgrounds.com/refer/egoraptor', '_blank');
}
}
button 70 {
on (release) {
getURL('http://www.newgrounds.com/store/', '_blank');
}
}
button 76 {
on (release) {
this.gotoAndPlay('egg');
}
}
movieClip 82 {
}
movieClip 83 {
frame 1123 {
stop();
}
}
movieClip 742 {
frame 1400 {
stop();
}
}
movieClip 856 {
}
movieClip 1849 {
frame 664 {
stop();
}
}
movieClip 2210 {
frame 2004 {
stop();
}
}
movieClip 3715 {
frame 1224 {
stop();
}
}
movieClip 4522 {
frame 309 {
stop();
}
}
frame 6715 {
this.gotoAndPlay('endmenu');
}
frame 6716 {
stop();
}
button 4704 {
on (release) {
getURL('http://www.egoraptor.net', '_blank');
}
}
button 4708 {
on (release) {
getURL('http://www.suzumiya-haruhi.net', '_blank');
}
}
button 4712 {
on (release) {
getURL('http://www.tomamoto.com', '_blank');
}
}
button 4716 {
on (release) {
getURL('http://www.gamertonight.net', '_blank');
}
}
button 4720 {
on (release) {
getURL('http://www.tomamoto.com', '_blank');
}
}
button 4724 {
on (release) {
getURL('http://www.newgrounds.com/refer/egoraptor', '_blank');
}
}
button 4728 {
on (release) {
getURL('http://www.myspace.com/suzyberhow', '_blank');
}
}
button 4734 {
on (release) {
this.gotoAndPlay('menu');
}
}
button 4738 {
on (release) {
getURL('http://www.newgrounds.com/portal/view/426476', '_blank');
}
}
button 4740 {
on (release) {
this.gotoAndPlay('menu');
}
}
frame 9406 {
this.gotoAndPlay('menu');
}
frame 9503 {
this.gotoAndPlay('menu');
}