Frame 1
NewgroundsAPI.connectMovie(6829);
Frame 2
_quality = "high";
play();
Frame 4082
stop();
Symbol 17 MovieClip Frame 40
stop();
Symbol 31 Button
on (press) {
tellTarget (_root) {
nextFrame();
};
}
Symbol 32 Button
on (press) {
gotoAndStop ("end");
_root.play();
}
Instance of Symbol 7 MovieClip in Symbol 33 MovieClip Frame 1
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");
}
}
Symbol 33 MovieClip Frame 101
play();
Symbol 33 MovieClip Frame 165
stop();
Symbol 39 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 45 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 47 MovieClip 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");
}
};
ngads_redirect.load(ngad_url);
}
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
stop();
Symbol 262 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(id) {
if (!id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = id;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var params = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(movie_version) {
if (!movie_version) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = movie_version;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(stat_id, stat_name) {
var _local1 = stat_name;
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!_local1) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[_local1] = CUSTOM_STATS + stat_id;
SendMessage("Created custom event: " + _local1);
}
}
static function addCustomLink(stat_id, stat_name) {
var _local1 = stat_id;
var _local2 = stat_name;
if (!_local1) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!_local2) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[_local2] = CUSTOM_STATS + _local1;
SendMessage((("Created custom link " + _local1) + ": ") + _local2);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(special) {
if (special) {
var _local1 = {page:special};
}
SendLink(NEWGROUNDS, _local1);
}
static function logCustomEvent(event_name) {
var _local1 = event_name;
if (!_local1) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[_local1]) {
SendError("Attempted to log undefined custom event: " + _local1);
} else {
SendEvent(custom_events[_local1]);
}
}
static function loadCustomLink(link_name) {
var _local1 = link_name;
if (!_local1) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[_local1]) {
SendError("Attempted to open undefined custom link: " + _local1);
} else {
SendLink(custom_links[_local1]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(id) {
SendStat(id, false);
}
static function SendLink(id, extra) {
SendStat(id, true, extra);
}
static function ReadGatewayData(params) {
var _local1 = params;
for (var _local2 in _local1) {
_local1[_local2] = unescape(_local1[_local2]);
movie_options[_local2] = _local1[_local2];
}
if (_local1.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var target_url = ((((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url));
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.load(target_url);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(stat_id, open_in_browser, extra) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var target_url = ((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id);
for (var x in extra) {
target_url = target_url + ((("&" + escape(x)) + "=") + escape(extra[x]));
}
trace(target_url);
if (debug) {
target_url = target_url + "&debug=1";
}
if (open_in_browser) {
getURL (target_url, "_blank");
} else {
var XML_in = new XML();
XML_in.ignoreWhite = true;
XML_in.onLoad = function (success) {
var params = new Object();
var _local2 = 0;
while (_local2 < this.firstChild.childNodes.length) {
var _local3 = this.firstChild.childNodes[_local2];
var param_name = _local3.nodeName;
var _local1 = _local3.attributes.value;
if (_local1 == Number(_local1)) {
_local1 = Number(_local1);
}
params[param_name] = _local1;
_local2++;
}
NewgroundsAPI.ReadGatewayData(params);
};
XML_in.load(target_url);
}
}
}
static function SendError(msg) {
trace("[NEWGROUNDS API ERROR] :: " + msg);
}
static function SendMessage(msg) {
trace("[NEWGROUNDS API] :: " + msg);
}
static function InitTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function onNewVersionAvailable(version, movie_url, redirect_url) {
var _local1 = _root;
InitTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_local1.createEmptyMovieClip("NGAPI_new_version_overlay", _local1.getNextHighestDepth());
_local1.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_local1.NGAPI_new_version_overlay.beginFill(0, 70);
_local1.NGAPI_new_version_overlay.moveTo(-10, -10);
_local1.NGAPI_new_version_overlay.lineTo(-10, 1000);
_local1.NGAPI_new_version_overlay.lineTo(1000, 1000);
_local1.NGAPI_new_version_overlay.lineTo(1000, -10);
_local1.NGAPI_new_version_overlay.lineTo(-10, -10);
_local1.NGAPI_new_version_overlay.endFill();
_local1.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_local1.NGAPI_new_version_overlay.beginFill(51);
_local1.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_local1.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_local1.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_local1.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_local1.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_local1.NGAPI_new_version_overlay.endFill();
_local1.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_local1.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_local1.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_local1.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_local1.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_local1.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_local1.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_local1.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_local1.NGAPI_new_version_overlay.exit.endFill();
_local1.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_local1.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_local1.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_local1.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_local1.NGAPI_new_version_overlay.exit.onMouseUp = function () {
var _local1 = _root;
if (_local1.NGAPI_new_version_overlay.exit.hitTest(_local1._xmouse, _local1._ymouse)) {
_local1.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + version) + " is now available at:") + newline;
var link_start = _local3.length;
_local3 = _local3 + movie_url;
var link_end = _local3.length;
_local1.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_local1.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_local1.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_local1.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_local1.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_local1.NGAPI_new_version_overlay.message.text = _local3;
_local1.NGAPI_new_version_overlay.message.multiline = true;
_local1.NGAPI_new_version_overlay.message.wordWrap = true;
_local1.NGAPI_new_version_overlay.message.html = true;
_local1.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_local1.NGAPI_new_version_overlay.message.setTextFormat(link_start, link_end, link_format);
}
static function onDenyHost(hostname, movie_url, redirect_url) {
var _local1 = _root;
InitTextFormats();
_local1.createEmptyMovieClip("NGAPI_deny_host_overlay", _local1.getNextHighestDepth());
_local1.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_local1.NGAPI_deny_host_overlay.beginFill(6684672);
_local1.NGAPI_deny_host_overlay.moveTo(0, 0);
_local1.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_local1.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_local1.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_local1.NGAPI_deny_host_overlay.lineTo(0, 0);
_local1.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + hostname) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var link_start = _local2.length;
_local2 = _local2 + movie_url;
var _local3 = _local2.length;
_local1.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_local1.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_local1.NGAPI_deny_host_overlay.error.text = "ERROR!";
_local1.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_local1.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_local1.NGAPI_deny_host_overlay.message.text = _local2;
_local1.NGAPI_deny_host_overlay.message.multiline = true;
_local1.NGAPI_deny_host_overlay.message.wordWrap = true;
_local1.NGAPI_deny_host_overlay.message.html = true;
_local1.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_local1.NGAPI_deny_host_overlay.message.setTextFormat(link_start, _local3, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(ad_url) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 259 Button
on (press) {
gotoAndPlay (2);
}