Combined Code
frame 1 {
_root.NewgroundsAPI_id = 4955;
}
movieClip 4 {
}
movieClip 8 {
}
button 16 {
on (release) {
_root.play();
}
}
movieClip 17 {
frame 1 {
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._xscale = PercentLoaded;
} else {
gotoAndStop(3);
}
}
frame 2 {
gotoAndPlay(1);
}
}
button 20 {
on (release) {
_root.NewgroundsAPI_loadNewgrounds();
}
}
movieClip 21 {
}
button 25 {
on (release) {
_root.NewgroundsAPI_loadNewgrounds();
}
}
movieClip 27 {
frame 1 {
function load_ad() {
url = new XML();
url.onLoad = function (s) {
if (s) {
_root.NewgroundsAPI_Ad_Unit.start_ad(this.toString());
}
};
url.load(_root.NewgroundsAPI_params.ad_url);
}
function start_ad(url) {
trace('[Newgrounds Flash Ads] Your ad was loaded. Your version of flash may have trouble displaying the ad, however, the ad will load fine if you test in a browser!');
ng_ad.loadMovie(url);
}
_root.NewgroundsAPI_Ad_Unit = this;
if (_root.NewgroundsAPI_params.ad_url != undefined) {
_root.NewgroundsAPI_Ad_Unit.load_ad();
}
_root.NewgroundsAPI_onAdsApproved = function () {
_root.NewgroundsAPI_Ad_Unit.load_ad();
};
}
}
button 31 {
on (release) {
this._visible = false;
}
}
button 35 {
on (release) {
_root.NewgroundsAPI_loadMyMovie();
}
}
movieClip 41 {
}
button 43 {
on (release) {
_root.NewgroundsAPI_loadMyMovie();
}
}
movieClip 47 {
}
movieClip 48 {
frame 1 {
_visible = false;
_root.NewgroundsAPI = this;
STAT_MOVIE_VIEWS = 1;
STAT_AUTHOR_SITE = 2;
STAT_NEWGROUNDS = 3;
STAT_NEW_VERSION = 4;
STAT_CUSTOM_STATS = 50;
}
frame 2 {
_root.NewgroundsAPI.POPUP_ERROR._visible = false;
_root.NewgroundsAPI.POPUP_VERSION._visible = false;
customStats = new Object();
i = 1;
while (i < _root.NewgroundsAPI_customLinks.length) {
customStats[_root.NewgroundsAPI_customLinks[i]] = i + STAT_CUSTOM_STATS;
++i;
}
i = 1;
while (i < _root.NewgroundsAPI_customEvents.length) {
customStats[_root.NewgroundsAPI_customEvents[i]] = i + STAT_CUSTOM_STATS;
++i;
}
_x = 0;
_y = 0;
configureMovie = function () {
if (_root.NewgroundsAPI_params.error != undefined) {
sendError(_root.NewgroundsAPI_params.error);
}
if (_root.NewgroundsAPI_params.settings_loaded == 1) {
sendMessage('You have successfully connected to the Newgrounds API gateway!');
sendMessage('Movie Identified as \'' + _root.NewgroundsAPI_params.movie_name + '\'');
}
if (_root.NewgroundsAPI_params.deny_host == 1) {
sendMessage(host + ' is not approved to use this movie');
_root.NewgroundsAPI_onDenyHost(host, _root.NewgroundsAPI_params.movie_url, script_url + '&stat=' + STAT_NEW_VERSION);
}
if (_root.NewgroundsAPI_params.movie_version == 1) {
sendMessage('Version ' + _root.NewgroundsAPI_params.movie_version + ' is now available!');
_root.NewgroundsAPI_onNewVersionAvailable(_root.NewgroundsAPI_params.movie_version, _root.NewgroundsAPI_params.movie_url, script_url + '&stat=' + STAT_NEW_VERSION);
}
if (_root.NewgroundsAPI_params.ad_url != undefined) {
sendMessage('This movie has been approved to use Flash Ads');
_root.NewgroundsAPI_onAdsApproved(_root.NewgroundsAPI_params.ad_url);
}
};
sendError = function (error) {
trace('[NEWGROUNDS API ERROR] ' + error);
};
sendMessage = function (message) {
trace('[NEWGROUNDS API] ' + message);
};
sendStats = function (stat, new_window) {
if (script_url != undefined) {
query = '&stat=' + stat;
if (new_window == true) {
getURL(script_url + query, '_blank');
} else {
initInfo = new XML();
initInfo.onLoad = function () {
i = 0;
while (i < this.childNodes.length) {
if (this.childNodes[i].nodeName != null) {
j = 0;
while (j < this.childNodes[i].childNodes.length) {
if (this.childNodes[i].childNodes[j].nodeName != null) {
param_name = this.childNodes[i].childNodes[j].nodeName;
param_value = unescape(this.childNodes[i].childNodes[j].attributes.value);
_root.NewgroundsAPI_params[param_name] = param_value;
}
++j;
}
}
++i;
}
_root.NewgroundsAPI.configureMovie();
};
initInfo.load(script_url + query);
}
}
};
host = (_url.split('/'))[2].toLowerCase();
if (host.length < 1) {
host = 'localhost';
}
if (!_root.NewgroundsAPI_id) {
sendError('Missing required \'_root.NewgroundsAPI_id\' variable');
} else {
if (!tracker_id) {
tracker_id = _root.NewgroundsAPI_id;
script_url = 'http://www.ngads.com/gateway.php?id=' + tracker_id + '&host=' + escape(host);
_root.NewgroundsAPI_params = new Object();
sendMessage('Connecting to API gateway...');
sendStats(STAT_MOVIE_VIEWS, false);
}
}
_root.NewgroundsAPI_loadMyMovie = function () {
_root.NewgroundsAPI.sendStats(_root.NewgroundsAPI.STAT_NEW_VERSION, true);
};
_root.NewgroundsAPI_loadNewgrounds = function () {
_root.NewgroundsAPI.sendStats(_root.NewgroundsAPI.STAT_NEWGROUNDS, true);
};
_root.NewgroundsAPI_loadMySite = function () {
_root.NewgroundsAPI.sendStats(_root.NewgroundsAPI.STAT_AUTHOR_SITE, true);
};
_root.NewgroundsAPI_loadCustomLink = function (link) {
if (_root.NewgroundsAPI.customStats[link]) {
_root.NewgroundsAPI.sendStats(_root.NewgroundsAPI.customStats[link], true);
} else {
_root.NewgroundsAPI.sendError('The custom link \'' + link + '\' has not beed defined.');
}
};
_root.NewgroundsAPI_logCustomEvent = function (event) {
if (_root.NewgroundsAPI.customStats[event]) {
_root.NewgroundsAPI.sendStats(_root.NewgroundsAPI.customStats[event], false);
} else {
_root.NewgroundsAPI.sendError('The custom event \'' + event + '\' has not beed defined.');
}
};
if (typeof _root.NewgroundsAPI_onDenyHost != 'function') {
_root.NewgroundsAPI_onDenyHost = function (ad_url) {
_root.NewgroundsAPI.swapDepths(99999);
_root.NewgroundsAPI._visible = true;
_root.NewgroundsAPI.POPUP_ERROR._visible = true;
};
}
if (typeof _root.NewgroundsAPI_onNewVersionAvailable != 'function') {
_root.NewgroundsAPI_onNewVersionAvailable = function (ad_url) {
_root.NewgroundsAPI.swapDepths(99999);
_root.NewgroundsAPI._visible = true;
_root.NewgroundsAPI.POPUP_VERSION._visible = true;
};
}
stop();
}
}
instance of movieClip 48 {
}
button 63 {
on (release) {
getURL('http://www.bindledog.com', '_self');
}
}