Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "_mochibot_";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("2749a0ee", this, 10301, true);
Frame 3
Frame 4
function selectChar(charId) {
pollVote(charId);
selectedChar = charId;
gotoAndStop ("play");
}
function endGame() {
Mouse.show();
checkHighscore();
}
function checkHighscore() {
curScore = score.getScore();
highscores = score.highscores;
if ((highscores.length == 0) || (curScore >= highscores[highscores.length - 1].score)) {
gotoAndStop ("highscore");
} else {
gotoAndStop ("highscores");
}
}
function submitHighscore() {
gotoAndStop ("highscores");
}
function initPolls() {
curPollIndex = 1;
pollLoader = new nz.co.resn.gen_admin.GenAdminDataLoader();
pollLoader.getPoll(curPollIndex, pollLoaded, false);
}
function pollLoaded(pollData) {
pollIsLoaded = true;
curPoll = pollData;
updatePoll();
}
function updatePoll() {
curPoll.pollAnswers = [];
itemI = 0;
while (itemI < curPoll.answers.length) {
curPollAnswer = curPoll.answers[itemI];
curPoll.pollAnswers[curPollAnswer.answer.toLowerCase()] = curPollAnswer;
itemI++;
}
}
function pollVote(voteId) {
curPollAnswer = curPoll.pollAnswers[voteId];
pollAnswerId = curPollAnswer.id;
if (pollAnswerId != undefined) {
curPollAnswer.count++;
pollSaver = new nz.co.resn.gen_admin.GenAdminDataSaver();
pollSaver.voteOnPollAnswer(pollAnswerId);
}
}
function initScore() {
nz.co.resn.game_utils.HighScores.highScorePath = siteRoot + "highscores.php";
highscoresAreLoaded = false;
score = new nz.co.resn.game_utils.HighScores();
score.loadHighscores = loadHighscores;
score.highscoresLoaded = highscoresLoaded;
numHighscores = 10;
dummyNames = ["bob", "sami", "Wickednessss", "James1", "L.T.", "azbsarnds", "Ace", "Emlyn", "lotus", "FRANCO"];
}
function showHighscores() {
score.loadHighscores();
gotoAndStop ("highscores");
}
function loadHighscores(loadData) {
trace("loadHighscores");
score.loadingHighscores = true;
this.highscores = [];
newStartDate = (new Date().getTime() / 1000) - 86400;
score.getHighScores(1, 20, {order:"desc", startDate:Math.round(newStartDate)}, highscoresLoaded);
}
function highscoresLoaded(xmlData) {
trace("highscoresLoaded");
highscoresAreLoaded = true;
this.loadingHighscores = false;
highscores = (this.highscores = []);
curHighscore = undefined;
pi = 0;
while ((pi < xmlData.firstChild.childNodes.length) && (pi < numHighscores)) {
xmlNode = xmlData.firstChild.childNodes[pi];
curHighscorePosition = pi + 1;
curHighscoreName = xmlNode.firstChild.firstChild.nodeValue;
curHighscoreScore = xmlNode.attributes.score;
curHighscore = new Object();
curHighscore.position = curHighscorePosition;
curHighscore.name = curHighscoreName;
curHighscore.score = curHighscoreScore;
highscores.push(curHighscore);
pi++;
}
if ((curHighscore != undefined) && (curDummyScore <= 2000)) {
curDummyScore = curHighscore.score;
} else {
curDummyScore = 600 + (Math.ceil(Math.random() * 48) * 10);
}
si = highscores.length;
while (si < numHighscores) {
curDummyScore = curDummyScore - (Math.ceil((curDummyScore * (0.1 + (Math.random() * 0.1))) / 10) * 15);
if (curDummyScore < 10) {
curDummyScore = 10;
}
xmlNode = xmlData.firstChild.childNodes[pi];
curHighscorePosition = pi + 1;
curHighscoreName = dummyNames[si];
curHighscoreScore = curDummyScore;
curHighscore = new Object();
curHighscore.position = curHighscorePosition;
curHighscore.name = curHighscoreName;
curHighscore.score = curHighscoreScore;
highscores.push(curHighscore);
pi++;
si++;
}
if (score.gotoHighscores) {
score.gotoHighscores = false;
gotoAndStop ("highscores");
}
}
function toggleAudio() {
audioOn = !audioOn;
if (audioOn) {
audioControl.setVolume(100);
audioBut._alpha = 100;
} else {
audioControl.setVolume(0);
audioBut._alpha = 50;
}
}
_global.siteRoot = "http://play.resn.co.nz/presidentialtossoff/";
nz.co.resn.gen_admin.GenAdminDataLoader.defaultXmlProviderPath = siteRoot + "xml_provider.php";
nz.co.resn.gen_admin.GenAdminDataSaver.saveArticlePath = siteRoot + "save_article.php";
audioControl = new Sound();
initPolls();
initScore();
audioOn = true;
Frame 6
if ((getBytesLoaded() < getBytesTotal()) || (!pollIsLoaded)) {
gotoAndPlay(_currentframe - 1);
}
Frame 12
stop();
Frame 17
stop();
Frame 27
stop();
Frame 37
stop();
Frame 47
stop();
Frame 57
stop();
Symbol 12 MovieClip Frame 1
bar._xscale = 0.01;
this.onEnterFrame = function () {
loadedBytes = _parent._parent.getBytesLoaded();
totalBytes = _parent._parent.getBytesTotal();
loadProgress = loadedBytes / totalBytes;
bar._xscale = loadProgress * 100;
};
Symbol 13 MovieClip Frame 10
if ((_parent.getBytesLoaded() >= _parent.getBytesTotal()) && (_parent.pollIsLoaded)) {
stop();
}
Symbol 13 MovieClip Frame 21
if ((_parent.getBytesLoaded() < _parent.getBytesTotal()) || (!_parent.pollIsLoaded)) {
gotoAndPlay(_currentframe - 1);
}
Symbol 13 MovieClip Frame 30
stop();
Symbol 17 Button
on (release) {
getURL ("http://www.resn.co.nz/", "_blank");
}
Symbol 22 Button
on (release) {
_parent.toggleAudio();
}
Symbol 377 MovieClip [__Packages.nz.co.resn.game_utils.HighScores] Frame 0
class nz.co.resn.game_utils.HighScores
{
var highScores, a, b, cb;
function HighScores () {
highScores = new XML();
highScores.ignoreWhite = true;
highScores.onLoad = nz.co.resn.util.Proxy.create(this, onHighScoresLoaded);
}
function setScore(score) {
if ((score << 0) != score) {
trace("HighScores.setScore: score must be an integer");
}
a = Math.round(Math.random() * 2147483647) + 123456789;
b = score ^ a;
}
function getScore() {
return(b ^ a);
}
function getHighScores(gameID, limit, options, callBack) {
cb = callBack;
var _local3 = new LoadVars();
_local3.game = gameID;
_local3.limit = limit;
if (options != null) {
for (var _local4 in options) {
_local3[("options[" + _local4) + "]"] = options[_local4];
}
}
_local3.sendAndLoad(highScorePath, highScores, "POST");
}
function saveHighScore(gameID, name, email, other, callBack) {
var _local2 = new LoadVars();
_local2.game = gameID;
_local2.x = (getScore() * 4) ^ 2147483647;
_local2.z = getScore();
_local2.name = name;
_local2.email = email;
_local2.other = other;
_local2.onLoad = callBack;
_local2.sendAndLoad(highScorePath, _local2, "POST");
}
function isLoading() {
return(!highScores.loaded);
}
function onHighScoresLoaded(success) {
if (cb != null) {
cb(highScores);
}
}
static var highScorePath = "highscores.php";
}
Symbol 378 MovieClip [__Packages.nz.co.resn.util.Proxy] Frame 0
class nz.co.resn.util.Proxy
{
function Proxy () {
}
static function create(oTarget, fFunction) {
var aParameters = new Array();
var _local2 = 2;
while (_local2 < arguments.length) {
aParameters[_local2 - 2] = arguments[_local2];
_local2++;
}
var _local4 = function () {
var _local2 = arguments.concat(aParameters);
fFunction.apply(oTarget, _local2);
};
return(_local4);
}
}
Symbol 379 MovieClip [__Packages.nz.co.resn.gen_admin.GenAdminDataLoader] Frame 0
class nz.co.resn.gen_admin.GenAdminDataLoader
{
var groupXmlOnLoadProxy, articleXmlOnLoadProxy, pollXmlOnLoadProxy, xmlProviderPath, externalCallBack, xml, articlesCacheReturn, searchCacheReturn;
function GenAdminDataLoader () {
groupXmlOnLoadProxy = nz.co.resn.util.Proxy.create(this, onGroupXmlLoad);
articleXmlOnLoadProxy = nz.co.resn.util.Proxy.create(this, onArticleXmlLoad);
pollXmlOnLoadProxy = nz.co.resn.util.Proxy.create(this, onPollXmlLoad);
}
function setXmlProviderPath(path) {
xmlProviderPath = path;
}
function setDebug(s) {
debug = s;
}
function getGroupData(groupName, callBack, cache, subgroups, articleLimit) {
if (cache == null) {
cache = true;
}
if (subgroups == null) {
subgroups = true;
}
if (cache && (groupCache[groupName.toLowerCase()] != null)) {
callBack(groupCache[groupName.toLowerCase()]);
return(undefined);
}
externalCallBack = callBack;
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = groupXmlOnLoadProxy;
var _local2 = new LoadVars();
_local2.group = groupName;
if (!subgroups) {
_local2.subgroups = 0;
}
if (articleLimit != null) {
_local2.limit = articleLimit;
}
var _local6 = new Date();
if (debug) {
trace("GenAdminDataLoader.getGroupData:\n" + _local2);
}
_local2.sendAndLoad((((xmlProviderPath == null) ? (defaultXmlProviderPath) : (xmlProviderPath)) + "?") + _local6.getTime(), xml, "POST");
}
function getGroup(id, callBack, cache, subgroups, articleLimit) {
if (cache == null) {
cache = true;
}
if (subgroups == null) {
subgroups = true;
}
if (cache && (groupCacheId["g" + id] != null)) {
callBack(groupCacheId["g" + id]);
return(undefined);
}
externalCallBack = callBack;
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = groupXmlOnLoadProxy;
var _local2 = new LoadVars();
_local2.group_id = id;
if (!subgroups) {
_local2.subgroups = 0;
}
if (articleLimit != null) {
_local2.limit = articleLimit;
}
var _local6 = new Date();
if (debug) {
trace("GenAdminDataLoader.getGroup:\n" + _local2);
}
_local2.sendAndLoad((((xmlProviderPath == null) ? (defaultXmlProviderPath) : (xmlProviderPath)) + "?") + _local6.getTime(), xml, "POST");
}
function getArticles(ids, callBack, cache) {
if ((ids == null) || (ids.length == 0)) {
callBack(null);
return(undefined);
}
var _local4 = 0;
while (_local4 < ids.length) {
if (isNaN(ids[_local4])) {
ids.splice(_local4, 1);
_local4--;
}
_local4++;
}
if (cache == null) {
cache = true;
}
if (cache) {
var _local2 = 0;
while (_local2 < ids.length) {
if (articleCache[ids[_local2]] != null) {
if (articlesCacheReturn == null) {
articlesCacheReturn = new Array();
}
articlesCacheReturn.push(articleCache[ids[_local2]]);
ids.splice(_local2, 1);
_local2--;
}
_local2++;
}
if (ids.length == 0) {
var _local6 = new nz.co.resn.gen_admin.Group();
_local6.articles = articlesCacheReturn;
callBack(_local6);
return(undefined);
}
}
externalCallBack = callBack;
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = groupXmlOnLoadProxy;
var _local5 = new LoadVars();
_local5.articles = ids.join(",");
var _local9 = new Date();
if (debug) {
trace("GenAdminDataLoader.getArticles:\n" + _local5);
}
_local5.sendAndLoad((((xmlProviderPath == null) ? (defaultXmlProviderPath) : (xmlProviderPath)) + "?") + _local9.getTime(), xml, "POST");
}
function getArticle(id, callBack, cache) {
if ((id == null) || (isNaN(id))) {
callBack(null);
return(undefined);
}
if (cache == null) {
cache = true;
}
if (cache && (articleCache[id] != null)) {
callBack(articleCache[id]);
return(undefined);
}
externalCallBack = callBack;
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = articleXmlOnLoadProxy;
var _local3 = new LoadVars();
_local3.article = id;
var _local6 = new Date();
if (debug) {
trace("GenAdminDataLoader.getArticle:\n" + _local3);
}
_local3.sendAndLoad((((xmlProviderPath == null) ? (defaultXmlProviderPath) : (xmlProviderPath)) + "?") + _local6.getTime(), xml, "POST");
}
function getArticleWidthProperty(propName, propValue, group, callBack, cache) {
if (cache == null) {
cache = true;
}
if (propName.length == 0) {
callBack(null);
return(undefined);
}
if (cache) {
if ((group != null) && (searchCache[propName.join("/")][propValue.join("/")][group] != null)) {
trace("GenAdminDataLoader.getArticleWidthProperty:\nFound in cache: " + propName);
callBack(searchCache[propName.join("/")][propValue.join("/")][group]);
return(undefined);
}
if (searchCache[propName.join("/")][propValue.join("/")][0] != null) {
trace("GenAdminDataLoader.getArticleWidthProperty:\nFound in cache: " + propName);
callBack(searchCache[propName.join("/")][propValue.join("/")][0]);
return(undefined);
}
}
searchCacheReturn = [propName.join("/"), propValue.join("/"), group];
externalCallBack = callBack;
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = groupXmlOnLoadProxy;
var _local3 = new LoadVars();
_local3.ap_name = propName.join(",");
_local3.ap_value = propValue.join(",");
if (group != null) {
_local3.ap_group = group;
}
var _local8 = new Date();
if (debug) {
trace("GenAdminDataLoader.getArticleWidthProperty:\n" + _local3);
}
_local3.sendAndLoad((((xmlProviderPath == null) ? (defaultXmlProviderPath) : (xmlProviderPath)) + "?") + _local8.getTime(), xml, "POST");
}
function getPoll(id, callBack, cache) {
if (cache == null) {
cache = true;
}
if (cache && (pollCache["p" + id] != null)) {
callBack(groupCacheId["p" + id]);
return(undefined);
}
externalCallBack = callBack;
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = pollXmlOnLoadProxy;
var _local2 = new LoadVars();
if (id != null) {
_local2.poll = id;
} else {
_local2.poll_latest = 1;
}
var _local5 = new Date();
if (debug) {
trace("GenAdminDataLoader.getPoll:\n" + _local2);
}
_local2.sendAndLoad((((xmlProviderPath == null) ? (defaultXmlProviderPath) : (xmlProviderPath)) + "?") + _local5.getTime(), xml, "POST");
}
function onGroupXmlLoad(success) {
if (debug) {
trace("GenAdminDataLoader.onGroupXmlLoad:\n" + xml);
}
var _local3 = xmlToGroupData(xml.firstChild);
if (articlesCacheReturn != null) {
var _local2 = 0;
while (_local2 < articlesCacheReturn.length) {
_local3.addArticle(nz.co.resn.gen_admin.Article(articlesCacheReturn[_local2]));
_local2++;
}
articlesCacheReturn = null;
}
xml = null;
searchCacheReturn = null;
externalCallBack(_local3);
externalCallBack = null;
}
function onArticleXmlLoad(success) {
if (debug) {
trace("GenAdminDataLoader.onArticleXmlLoad:\n" + xml);
}
var _local2 = xmlToArticle(xml.firstChild);
xml = null;
externalCallBack(_local2);
externalCallBack = null;
}
function onPollXmlLoad(success) {
if (debug) {
trace("GenAdminDataLoader.onPollXmlLoad:\n" + xml);
}
var _local2 = xmlToPoll(xml.firstChild);
xml = null;
externalCallBack(_local2);
externalCallBack = null;
}
function getProgress() {
if ((xml != null) && (xml.getBytesTotal() > 5)) {
return(xml.getBytesLoaded() / xml.getBytesTotal());
}
return(null);
}
static function checkGroupCache(name) {
return(groupCache[name.toLowerCase()] != null);
}
static function checkArticleCache(id) {
return(articleCache[id] != null);
}
static function clearCache() {
groupCache = {};
groupCacheId = {};
articleCache = {};
pollCache = {};
searchCache = {};
}
function xmlToGroupData(xmlNode) {
if ((xmlNode == null) || (xmlNode.nodeName != "g")) {
return(null);
}
var _local4 = new nz.co.resn.gen_admin.Group();
_local4.id = Number(xmlNode.attributes.id);
_local4.parentId = Number(xmlNode.attributes.pid);
_local4.name = xmlNode.attributes.name;
var _local3 = 0;
while (_local3 < xmlNode.childNodes.length) {
var _local2 = xmlNode.childNodes[_local3];
switch (_local2.nodeName.toLowerCase()) {
case "g" :
_local4.addChildGroup(xmlToGroupData(_local2));
break;
case "a" :
_local4.addArticle(xmlToArticle(_local2));
}
_local3++;
}
if (cacheReturn && (_local4 != null)) {
if (searchCacheReturn != null) {
searchCache[searchCacheReturn[0]] = {};
searchCache[searchCacheReturn[0]][searchCacheReturn[1]] = {};
if (searchCacheReturn[2] == null) {
searchCache[searchCacheReturn[0]][searchCacheReturn[1]][0] = _local4;
} else {
searchCache[searchCacheReturn[0]][searchCacheReturn[1]][searchCacheReturn[2]] = _local4;
}
}
if (_local4.name.length > 0) {
groupCache[_local4.name.toLowerCase()] = _local4;
}
if (_local4.id != null) {
groupCacheId["g" + _local4.id] = _local4;
}
}
return(_local4);
}
function xmlToArticle(xmlNode) {
if ((xmlNode == null) || (xmlNode.nodeName != "a")) {
return(null);
}
var _local7 = new nz.co.resn.gen_admin.Article();
_local7.id = Number(xmlNode.attributes.id);
_local7.templateId = Number(xmlNode.attributes.tid);
_local7.title = xmlNode.attributes.title;
_local7.date = new Date(Number(xmlNode.attributes.date) * 1000);
var _local2 = 0;
while (_local2 < xmlNode.childNodes.length) {
var _local3 = xmlNode.childNodes[_local2];
if (!(_local3.nodeName.toLowerCase() === "p")) {
} else {
var _local6 = _local3;
var _local4 = xmlToArticleProperty(_local6);
_local7.setProperty(_local4.name, _local4);
}
_local2++;
}
if ((cacheReturn && (_local7 != null)) && (!isNaN(_local7.id))) {
articleCache[_local7.id] = _local7;
}
return(_local7);
}
function xmlToArticleProperty(xmlNode) {
var _local3;
switch (Number(xmlNode.attributes.type)) {
case nz.co.resn.gen_admin.ArticleProperty.TYPE_TEMPLATE :
_local3 = new nz.co.resn.gen_admin.article_property_types.APTemplate();
var _local4 = 0;
while (_local4 < xmlNode.childNodes.length) {
_local3.addArticle(xmlToArticle(xmlNode.childNodes[_local4]));
_local4++;
}
break;
case nz.co.resn.gen_admin.ArticleProperty.TYPE_FILE :
_local3 = new nz.co.resn.gen_admin.article_property_types.APFile();
_local3.fileType = xmlNode.attributes.filetype;
_local3.size = ((!isNaN(Number(xmlNode.attributes.filesize))) ? (Number(xmlNode.attributes.filesize)) : 0);
_local3.value = xmlNode.firstChild.nodeValue;
break;
case nz.co.resn.gen_admin.ArticleProperty.TYPE_IMAGE :
_local3 = new nz.co.resn.gen_admin.article_property_types.APImage();
_local3.fileType = xmlNode.attributes.filetype;
_local3.size = ((!isNaN(Number(xmlNode.attributes.filesize))) ? (Number(xmlNode.attributes.filesize)) : 0);
_local3.width = ((!isNaN(Number(xmlNode.attributes.width))) ? (Number(xmlNode.attributes.width)) : 0);
_local3.height = ((!isNaN(Number(xmlNode.attributes.height))) ? (Number(xmlNode.attributes.height)) : 0);
_local3.value = xmlNode.firstChild.nodeValue;
break;
case nz.co.resn.gen_admin.ArticleProperty.TYPE_VIDEO :
_local3 = new nz.co.resn.gen_admin.article_property_types.APImage();
_local3.fileType = xmlNode.attributes.filetype;
_local3.size = ((!isNaN(Number(xmlNode.attributes.filesize))) ? (Number(xmlNode.attributes.filesize)) : 0);
_local3.width = ((!isNaN(Number(xmlNode.attributes.width))) ? (Number(xmlNode.attributes.width)) : 0);
_local3.height = ((!isNaN(Number(xmlNode.attributes.height))) ? (Number(xmlNode.attributes.height)) : 0);
_local3.length = ((!isNaN(Number(xmlNode.attributes.length))) ? (Number(xmlNode.attributes.length)) : 0);
_local3.value = xmlNode.firstChild.nodeValue;
break;
case nz.co.resn.gen_admin.ArticleProperty.TYPE_SOUND :
_local3 = new nz.co.resn.gen_admin.article_property_types.APSound();
_local3.fileType = xmlNode.attributes.filetype;
_local3.size = ((!isNaN(Number(xmlNode.attributes.filesize))) ? (Number(xmlNode.attributes.filesize)) : 0);
_local3.length = ((!isNaN(Number(xmlNode.attributes.length))) ? (Number(xmlNode.attributes.length)) : 0);
_local3.value = xmlNode.firstChild.nodeValue;
break;
case nz.co.resn.gen_admin.ArticleProperty.TYPE_DATE :
_local3 = new nz.co.resn.gen_admin.article_property_types.APDate();
var _local5 = new Date();
_local3.value = new Date(Number(xmlNode.firstChild.nodeValue) * 1000);
break;
default :
_local3 = new nz.co.resn.gen_admin.ArticleProperty();
_local3.value = xmlNode.firstChild.nodeValue;
}
if (!isNaN(Number(xmlNode.attributes.id))) {
_local3.id = Number(xmlNode.attributes.id);
}
_local3.name = xmlNode.attributes.name;
_local3.type = Number(xmlNode.attributes.type);
_local3.collection = xmlNode.attributes.collection == 1;
return(_local3);
}
function xmlToPoll(xmlNode) {
if ((xmlNode == null) || (xmlNode.nodeName != "poll")) {
return(null);
}
var _local7 = new nz.co.resn.gen_admin.Poll();
_local7.id = Number(xmlNode.attributes.id);
_local7.question = xmlNode.firstChild.nodeValue;
_local7.displayFromDate = new Date(Number(xmlNode.attributes.date) * 1000);
var _local4 = 0;
while (_local4 < xmlNode.childNodes.length) {
var _local5 = xmlNode.childNodes[_local4];
if (!(_local5.nodeName.toLowerCase() === "pa")) {
} else {
var _local3 = _local5;
var _local2 = new nz.co.resn.gen_admin.PollAnswer();
_local2.id = Number(_local3.attributes.id);
_local2.count = Number(_local3.attributes.count);
_local2.answer = _local3.firstChild.nodeValue;
_local7.answers.push(_local2);
}
_local4++;
}
if ((cacheReturn && (_local7 != null)) && (!isNaN(_local7.id))) {
pollCache["p" + _local7.id] = _local7;
}
return(_local7);
}
static var defaultXmlProviderPath = "xml_provider.php";
var cacheReturn = true;
static var groupCache = {};
static var groupCacheId = {};
static var articleCache = {};
static var searchCache = {};
static var pollCache = {};
var debug = false;
}
Symbol 380 MovieClip [__Packages.nz.co.resn.gen_admin.Group] Frame 0
class nz.co.resn.gen_admin.Group
{
var children, articles, name, id;
function Group () {
children = new Array();
articles = new Array();
}
function addArticle(a) {
articles.push(a);
}
function addChildGroup(g) {
children.push(g);
}
function toString() {
return("Group: " + name);
}
function getGroup(id) {
if (this.id == id) {
return(this);
}
var _local2 = 0;
while (_local2 < children.length) {
var _local3 = children[_local2].getGroup(id);
if (_local3 != null) {
return(_local3);
}
_local2++;
}
return(null);
}
function getArticle(id) {
var _local3 = 0;
while (_local3 < articles.length) {
var _local4 = articles[_local3].getArticle(id);
if (_local4 != null) {
return(_local4);
}
_local3++;
}
var _local2 = 0;
while (_local2 < children.length) {
var _local4 = children[_local2].getArticle(id);
if (_local4 != null) {
return(_local4);
}
_local2++;
}
return(null);
}
function getGroupWithArticle(articleId) {
var _local3 = 0;
while (_local3 < articles.length) {
var _local5 = nz.co.resn.gen_admin.Article(articles[_local3]);
if (_local5.id == articleId) {
return(this);
}
_local3++;
}
var _local2 = 0;
while (_local2 < children.length) {
var _local4 = children[_local2].getGroupWithArticle(articleId);
if (_local4 != null) {
return(_local4);
}
_local2++;
}
return(null);
}
function sortArticlesByProp(propertyName, sortOptions) {
function aSort(a, b) {
return(nz.co.resn.gen_admin.Article.compareProp(propertyName, a, b, sortOptions));
}
articles.sort(aSort);
}
}
Symbol 381 MovieClip [__Packages.nz.co.resn.gen_admin.Article] Frame 0
class nz.co.resn.gen_admin.Article
{
var properties, id, title;
function Article () {
properties = new Object();
}
function setProperty(propName, propValue) {
if (propValue.collection) {
if (properties[propName.toLowerCase()] == null) {
properties[propName.toLowerCase()] = nz.co.resn.gen_admin.ArticlePropertyCollection.createCollection(propValue);
} else {
properties[propName.toLowerCase()].addProperty(propName);
}
} else {
properties[propName.toLowerCase()] = propValue;
}
}
function getProperty(propName) {
return(properties[propName.toLowerCase()]);
}
function getArticle(id) {
if (this.id == id) {
return(this);
}
for (var _local6 in properties) {
var _local3 = nz.co.resn.gen_admin.ArticleProperty(properties[_local6]);
if (_local3.type == nz.co.resn.gen_admin.ArticleProperty.TYPE_TEMPLATE) {
var _local4 = nz.co.resn.gen_admin.article_property_types.APTemplate(_local3);
var _local2 = _local4.getArticle(id);
if (_local2 != null) {
return(_local2);
}
}
}
return(null);
}
function toString() {
return((("Article: " + title) + ", id: ") + id);
}
static function compareProp(property, a, b, sortOptions) {
return(nz.co.resn.gen_admin.ArticleProperty.compare(a.getProperty(property), b.getProperty(property), sortOptions));
}
}
Symbol 382 MovieClip [__Packages.nz.co.resn.gen_admin.ArticleProperty] Frame 0
class nz.co.resn.gen_admin.ArticleProperty
{
var value, name;
function ArticleProperty () {
}
static function compare(a, b, sortOptions) {
var _local2 = a.value;
var _local1 = b.value;
if ((sortOptions & Array.NUMERIC) > 0) {
_local2 = Number(_local2);
_local1 = Number(_local1);
}
if ((sortOptions & Array.DESCENDING) > 0) {
_local1 = a.value;
_local2 = b.value;
}
if ((sortOptions & Array.CASEINSENSITIVE) > 0) {
_local2 = String(_local2).toLowerCase();
_local1 = String(_local1).toLowerCase();
}
if (_local2 < _local1) {
return(-1);
}
if (_local2 > _local1) {
return(1);
}
return(0);
}
function isEmpty() {
return((value == null) || (value.length == 0));
}
function serialize() {
return(value);
}
function toString() {
return((("Article Property - name: " + name) + ", value: ") + value);
}
static var TYPE_TEMPLATE = 1;
static var TYPE_LABEL = 2;
static var TYPE_TEXT = 3;
static var TYPE_DATE = 4;
static var TYPE_IMAGE = 5;
static var TYPE_SOUND = 6;
static var TYPE_VIDEO = 7;
static var TYPE_FILE = 8;
static var TYPE_URL = 9;
static var TYPE_ART_REF = 10;
}
Symbol 383 MovieClip [__Packages.nz.co.resn.gen_admin.ArticlePropertyCollection] Frame 0
class nz.co.resn.gen_admin.ArticlePropertyCollection extends nz.co.resn.gen_admin.ArticleProperty
{
var name, type, collection, values, value;
function ArticlePropertyCollection (ap) {
super();
name = ap.name;
type = ap.type;
collection = true;
values = [ap];
value = "Article Property Collection";
}
static function createCollection(ap) {
return(new nz.co.resn.gen_admin.ArticlePropertyCollection(ap));
}
function addProperty(ap) {
values.push(ap);
}
function toString() {
return((("Article Property Collection - name: " + name) + ", values: ") + values);
}
}
Symbol 384 MovieClip [__Packages.nz.co.resn.gen_admin.article_property_types.APTemplate] Frame 0
class nz.co.resn.gen_admin.article_property_types.APTemplate extends nz.co.resn.gen_admin.ArticleProperty
{
var articles;
function APTemplate () {
super();
articles = new Array();
}
function addArticle(a) {
articles.push(a);
}
function getArticle(id) {
var _local2 = 0;
while (_local2 < articles.length) {
var _local3 = articles[_local2].getArticle(id);
if (_local3 != null) {
return(_local3);
}
_local2++;
}
return(null);
}
function sortArticles(propertyName, sortOptions) {
function aSort(a, b) {
return(nz.co.resn.gen_admin.Article.compareProp(propertyName, a, b, sortOptions));
}
articles.sort(aSort, sortOptions);
}
}
Symbol 385 MovieClip [__Packages.nz.co.resn.gen_admin.Poll] Frame 0
class nz.co.resn.gen_admin.Poll
{
var answers, id, question;
function Poll () {
answers = new Array();
}
function toString() {
return((("Poll: " + question) + ", id: ") + id);
}
}
Symbol 386 MovieClip [__Packages.nz.co.resn.gen_admin.article_property_types.APFile] Frame 0
class nz.co.resn.gen_admin.article_property_types.APFile extends nz.co.resn.gen_admin.ArticleProperty
{
function APFile () {
super();
}
function ArticleProperty() {
}
}
Symbol 387 MovieClip [__Packages.nz.co.resn.gen_admin.article_property_types.APImage] Frame 0
class nz.co.resn.gen_admin.article_property_types.APImage extends nz.co.resn.gen_admin.article_property_types.APFile
{
function APImage () {
super();
}
}
Symbol 388 MovieClip [__Packages.nz.co.resn.gen_admin.article_property_types.APSound] Frame 0
class nz.co.resn.gen_admin.article_property_types.APSound extends nz.co.resn.gen_admin.article_property_types.APFile
{
function APSound () {
super();
}
}
Symbol 389 MovieClip [__Packages.nz.co.resn.gen_admin.article_property_types.APDate] Frame 0
class nz.co.resn.gen_admin.article_property_types.APDate extends nz.co.resn.gen_admin.ArticleProperty
{
var value;
function APDate () {
super();
}
function serialize() {
return(String(Math.round(value.getTime() / 1000)));
}
}
Symbol 390 MovieClip [__Packages.nz.co.resn.gen_admin.PollAnswer] Frame 0
class nz.co.resn.gen_admin.PollAnswer
{
var id, answer;
function PollAnswer () {
}
function toString() {
return((("PollAnswer: " + answer) + ", id: ") + id);
}
}
Symbol 391 MovieClip [__Packages.nz.co.resn.gen_admin.GenAdminDataSaver] Frame 0
class nz.co.resn.gen_admin.GenAdminDataSaver
{
var fileListener, callBack, lv;
function GenAdminDataSaver () {
fileListener = new Object();
fileListener.onUploadCompleteData = nz.co.resn.util.Proxy.create(this, onFileResponse);
}
function setDebug(s) {
debug = s;
}
function saveArticle(g, a, callBack, fileReference) {
if (fileReference) {
saveArticleWithFile(g, a, fileReference, callBack);
} else {
saveArticleStandard(g, a, callBack);
}
}
function saveArticleStandard(g, a, callBack) {
this.callBack = callBack;
lv = new LoadVars();
lv.onLoad = nz.co.resn.util.Proxy.create(this, onResponse);
lv.title = a.title;
lv.group = g.name;
lv.active = (a.active ? 1 : 0);
for (var _local4 in a.properties) {
var _local2 = nz.co.resn.gen_admin.ArticleProperty(a.properties[_local4]);
lv[("props[" + _local4) + "]"] = _local2.serialize();
}
if (debug) {
trace("GenAdminDataSaver.saveArticle:\n" + lv);
}
lv.sendAndLoad(saveArticlePath, lv, "POST");
}
function saveArticleWithFile(g, a, fileReference, callBack) {
System.security.allowDomain("http://localhost", "127.0.0.1", "http://www.specialsurprise.co.nz/");
this.callBack = callBack;
fileReference.addListener(fileListener);
var _local4 = "";
_local4 = _local4 + ("title=" + a.title);
_local4 = _local4 + ("&group=" + g.name);
_local4 = _local4 + ("&active=" + (a.active ? 1 : 0));
for (var _local5 in a.properties) {
var _local2 = nz.co.resn.gen_admin.ArticleProperty(a.properties[_local5]);
_local4 = _local4 + ((("&props[" + _local5) + "]=") + _local2.serialize());
}
fileReference.postData = _local4;
if (debug) {
trace("GenAdminDataSaver.saveArticle:\n" + fileReference);
}
fileReference.upload(saveArticlePath);
}
function voteOnPollAnswer(answerId, callBack) {
this.callBack = callBack;
lv = new LoadVars();
lv.onLoad = nz.co.resn.util.Proxy.create(this, onResponse);
lv.poll_answer = answerId;
if (debug) {
trace("GenAdminDataSaver.saveArticle:\n" + lv);
}
lv.sendAndLoad(saveArticlePath, lv, "POST");
}
function onResponse() {
if (callBack != null) {
callBack(lv.saved == "true");
}
if (debug) {
trace("GenAdminDataSaver.onResponse:\n" + lv);
}
}
function onFileResponse(fileRef, data) {
if (debug) {
trace("GenAdminDataSaver.onFileResponse: " + data);
}
fileRef.removeListener(fileListener);
if (callBack != null) {
callBack(data);
}
}
static var saveArticlePath = "save_article.php";
var debug = false;
}
Symbol 392 MovieClip [__Packages.nz.co.resn.ExplodeClip] Frame 0
class nz.co.resn.ExplodeClip extends MovieClip
{
var sourceClip, destClip, sourceWidth, sourceHeight, clipBitmap;
function ExplodeClip (sourceClip, destClip, parameters) {
super();
this.sourceClip = sourceClip;
this.destClip = destClip;
sourceWidth = sourceClip._width;
sourceHeight = sourceClip._height;
clipBitmap = new flash.display.BitmapData(sourceWidth, sourceHeight, true, 0);
clipBitmap.draw(sourceClip);
sourceClip._visible = false;
if (parameters.gravity != undefined) {
gravity = parameters.gravity;
}
if (parameters.wind != undefined) {
wind = parameters.wind;
}
if (parameters.clipMinX != undefined) {
clipMinX = parameters.clipMinX;
}
if (parameters.clipMaxX != undefined) {
clipMaxX = parameters.clipMaxX;
}
if (parameters.clipMinY != undefined) {
clipMinY = parameters.clipMinY;
}
if (parameters.clipMaxY != undefined) {
clipMaxY = parameters.clipMaxY;
}
clipMinX = clipMinX + (sourceWidth / 2);
clipMaxX = clipMaxX + (sourceWidth / 2);
clipMinY = clipMinY + (sourceHeight / 2);
clipMaxY = clipMaxY + (sourceHeight / 2);
if (parameters.decelX != undefined) {
decelX = parameters.decelX;
}
if (parameters.decelY != undefined) {
decelY = parameters.decelY;
}
if (parameters.decelRot != undefined) {
decelRot = parameters.decelRot;
}
if (parameters.width != undefined) {
particleWidth = parameters.width;
}
if (parameters.height != undefined) {
particleHeight = parameters.height;
}
if (parameters.randomiseX != undefined) {
randomiseX = parameters.randomiseX;
}
if (parameters.randomiseY != undefined) {
randomiseY = parameters.randomiseY;
}
if (parameters.forceX != undefined) {
forceX = parameters.forceX;
}
if (parameters.forceY != undefined) {
forceY = parameters.forceY;
}
if (parameters.forceVariationX != undefined) {
forceVariationX = parameters.forceVariationX;
}
if (parameters.forceVariationY != undefined) {
forceVariationY = parameters.forceVariationY;
}
if (parameters.forceOffsetX != undefined) {
forceOffsetX = parameters.forceOffsetX;
}
if (parameters.forceOffsetY != undefined) {
forceOffsetY = parameters.forceOffsetY;
}
if (parameters.forceOffsetVariationX != undefined) {
forceOffsetVariationX = parameters.forceOffsetVariationX;
}
if (parameters.forceOffsetVariationY != undefined) {
forceOffsetVariationY = parameters.forceOffsetVariationY;
}
if (parameters.destroyDelay != undefined) {
destroyDelay = parameters.destroyDelay * 1000;
}
destroyTime = getTimer() + destroyDelay;
var _local11 = sourceHeight / particleHeight;
var _local7 = sourceWidth / particleWidth;
var _local18;
var _local20;
var _local17;
var _local16;
var _local23;
var _local22;
var _local21;
var _local19;
var _local5 = [];
var _local12 = [];
var _local9;
var _local4 = 0;
while (_local4 < _local11) {
_local12 = (_local5[_local4] = []);
var _local3 = 0;
while (_local3 < _local7) {
_local9 = new Object();
_local9.x = ((_local3 / _local7) * sourceWidth) + ((Math.random() - 0.5) * randomiseX);
_local9.y = ((_local4 / _local11) * sourceHeight) + ((Math.random() - 0.5) * randomiseY);
_local12.push(_local9);
_local3++;
}
_local4++;
}
var _local8;
var _local13;
var _local6 = [];
_local4 = 0;
while (_local4 < _local11) {
var _local3 = 0;
while (_local3 < _local7) {
_local8 = new Object();
_local8.x = ((_local3 + 0.5) / _local7) * sourceWidth;
_local8.y = ((_local4 + 0.5) / _local11) * sourceHeight;
_local6 = [];
_local6[0] = [_local5[_local4][_local3].x, _local5[_local4][_local3].y];
_local6[1] = [_local5[_local4 + 1][_local3].x, _local5[_local4 + 1][_local3].y];
_local6[2] = [_local5[_local4 + 1][_local3 + 1].x, _local5[_local4 + 1][_local3 + 1].y];
_local6[3] = [_local5[_local4][_local3 + 1].x, _local5[_local4][_local3 + 1].y];
createParticle(_local6, _local8, _local13);
_local3++;
}
_local4++;
}
destClip.onEnterFrame = mx.utils.Delegate.create(this, update);
}
function update() {
var _local2;
var _local5 = 0;
var _local4 = getTimer();
var _local3 = 0;
while (_local3 < particles.length) {
_local2 = particles[_local3];
if ((!_local2) || (!_local2.exists)) {
_local5++;
} else {
_local2._x = _local2._x + _local2.velX;
_local2._y = _local2._y + _local2.velY;
if (((((_local4 >= destroyTime) || (_local2._x < clipMinX)) || (_local2._x > clipMaxX)) || (_local2._y < clipMinY)) || (_local2._y > clipMaxY)) {
_local2.exists = false;
_local2.removeMovieClip();
} else {
_local2._rotation = _local2._rotation + _local2.rotationVel;
_local2.velX = _local2.velX * decelX;
_local2.velY = _local2.velY * decelY;
_local2.rotationVel = _local2.rotationVel * decelRot;
_local2.velX = _local2.velX + wind;
_local2.velY = _local2.velY + gravity;
}
}
_local3++;
}
if ((_local5 >= particles.length) || (_local4 >= destroyTime)) {
delete destClip.onEnterFrame;
}
}
function createParticle(shape, curPosition, curSize) {
var _local7 = destClip.getNextHighestDepth();
var _local5 = destClip.createEmptyMovieClip("particle" + _local7, _local7);
_local5._x = curPosition.x;
_local5._y = curPosition.y;
_local5.exists = true;
var _local9 = new flash.display.BitmapData(sourceClip._width, sourceClip._height, true, 0);
var _local8 = new flash.geom.Matrix();
_local8.translate(-curPosition.x, -curPosition.y);
_local5.beginBitmapFill(clipBitmap, _local8, false);
var _local3;
var _local2 = 0;
while (_local2 < shape.length) {
_local3 = shape[_local2];
if (_local2 == 0) {
_local5.moveTo(_local3[0] - curPosition.x, _local3[1] - curPosition.y);
} else {
_local5.lineTo(_local3[0] - curPosition.x, _local3[1] - curPosition.y);
}
_local2++;
}
_local5.endFill();
_local5.velX = (curPosition.x - (sourceWidth / 2)) * (forceX + (Math.random() * forceVariationX));
_local5.velY = (curPosition.y - (sourceHeight / 2)) * (forceY + (Math.random() * forceVariationY));
_local5.velX = _local5.velX + (forceOffsetX + ((Math.random() - 0.5) * forceOffsetVariationX));
_local5.velY = _local5.velY + (forceOffsetY + ((Math.random() - 0.5) * forceOffsetVariationY));
_local5.rotationVel = (Math.random() - 0.5) * rotSpeed;
particles.push(_local5);
}
var particles = [];
var forceX = 0.1;
var forceY = 0.1;
var forceVariationX = 0.4;
var forceVariationY = 0.4;
var forceOffsetX = 0;
var forceOffsetY = 0;
var forceOffsetVariationX = 0;
var forceOffsetVariationY = 0;
var rotSpeed = 50;
var decelX = 0.98;
var decelY = 0.98;
var decelRot = 0.96;
var gravity = 2;
var wind = 0;
var randomiseX = 50;
var randomiseY = 50;
var particleWidth = 20;
var particleHeight = 20;
var clipMinX = -1000;
var clipMaxX = 1000;
var clipMinY = -1000;
var clipMaxY = 1000;
var destroyTime = 0;
var destroyDelay = 60000;
}
Symbol 393 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 29 MovieClip Frame 1
function playSound(soundName) {
gotoAndPlay(soundName);
}
stop();
Symbol 29 MovieClip Frame 15
gotoAndStop ("none");
Symbol 52 MovieClip Frame 1
if (Math.random() < 0.5) {
this._xscale = this._xscale * -1;
}
Symbol 53 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 1
stop();
this.onRollOver = function () {
gotoAndPlay ("over");
};
this.onRollOut = function () {
gotoAndPlay ("out");
};
this.onDragOut = function () {
gotoAndPlay ("out");
};
this.onRelease = function () {
_parent._parent._parent.gotoAndStop("instructions");
};
Symbol 66 MovieClip Frame 6
stop();
Symbol 67 MovieClip Frame 91
stop();
Symbol 72 Button
on (release) {
_parent.gotoAndStop("choose");
}
Symbol 75 MovieClip Frame 1
stop();
this.onRollOver = function () {
gotoAndPlay ("over");
};
this.onRollOut = function () {
gotoAndPlay ("out");
};
this.onDragOut = function () {
gotoAndPlay ("out");
};
this.onRelease = function () {
_parent._parent.gotoAndStop("choose");
};
Symbol 75 MovieClip Frame 6
stop();
Symbol 76 MovieClip Frame 26
stop();
Symbol 87 MovieClip Frame 1
stop();
this.onRelease = function () {
_root.selectChar("mccain");
};
this.onRollOver = function () {
gotoAndPlay ("over");
};
this.onRollOut = function () {
gotoAndPlay ("out");
};
this.onDragOut = function () {
gotoAndPlay ("out");
};
this.onRelease = function () {
_parent._parent._parent.selectChar("mccain");
};
Symbol 87 MovieClip Frame 8
stop();
Symbol 94 MovieClip Frame 1
stop();
this.onRelease = function () {
_root.selectChar("obama");
};
this.onRollOver = function () {
gotoAndPlay ("over");
};
this.onRollOut = function () {
gotoAndPlay ("out");
};
this.onDragOut = function () {
gotoAndPlay ("out");
};
this.onRelease = function () {
_parent._parent._parent.selectChar("obama");
};
Symbol 94 MovieClip Frame 8
stop();
Symbol 104 MovieClip Frame 46
stop();
Symbol 117 MovieClip Frame 4
_parent.gotoAndStop(1);
Symbol 119 MovieClip Frame 1
var explosionParameters = new Object();
explosionParameters.width = 20;
explosionParameters.height = 20;
explosionParameters.randomiseX = 5;
explosionParameters.randomiseY = 50;
explosionParameters.gravity = 1;
explosionParameters.forceX = 0.2;
explosionParameters.forceVariationX = 0.3;
explosionParameters.forceY = 0.2;
explosionParameters.forceVariationY = 0.1;
explosionParameters.forceOffsetY = -1;
explosionParameters.forceOffsetVariationY = -5;
explosionParameters.forceOffsetVariationX = 5;
explosionParameters.decelX = 0.99;
explosionParameters.decelY = 0.99;
explosionParameters.decelRot = 0.98;
explosionParameters.clipMinX = -500;
explosionParameters.clipMaxX = 500;
explosionParameters.clipMinY = -1000;
explosionParameters.clipMaxY = 500;
explosionParameters.destroyDelay = 5;
var curExplosion = (new nz.co.resn.ExplodeClip(flag, this, explosionParameters));
Symbol 120 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 1
Symbol 141 MovieClip Frame 9
stop();
_parent.gotoAndStop("norm");
Symbol 150 MovieClip Frame 9
stop();
_parent.gotoAndStop("norm");
Symbol 152 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 9
stop();
_parent.gotoAndStop("norm");
Symbol 177 MovieClip Frame 9
stop();
_parent.gotoAndStop("norm");
Symbol 178 MovieClip Frame 1
stop();
Symbol 179 MovieClip Frame 1
function explode() {
var _local3 = new Object();
_local3.width = 10;
_local3.height = 20;
_local3.randomiseX = 5;
_local3.randomiseY = 50;
_local3.gravity = 1;
_local3.forceX = 0.2;
_local3.forceVariationX = 0.3;
_local3.forceY = 0.2;
_local3.forceVariationY = 0.1;
_local3.forceOffsetY = -1;
_local3.forceOffsetVariationY = -5;
_local3.forceOffsetVariationX = 5;
_local3.decelX = 0.99;
_local3.decelY = 0.99;
_local3.decelRot = 0.98;
_local3.clipMinX = -500;
_local3.clipMaxX = 500;
_local3.clipMinY = -1000;
_local3.clipMaxY = 500;
_local3.destroyDelay = 5;
_root.audio.effects.playSound("smash");
var _local4 = new nz.co.resn.ExplodeClip(boss, this, _local3);
}
stop();
Symbol 189 MovieClip Frame 1
stop();
if (_parent.selectedChar == "mccain") {
gotoAndStop (2);
}
Symbol 192 MovieClip Frame 1
selectedChar = _parent.selectedChar;
Symbol 193 MovieClip Frame 1
selectedChar = _parent.selectedChar;
Symbol 193 MovieClip Frame 4
_parent.gotoAndStop(1);
Symbol 194 MovieClip Frame 1
selectedChar = _parent.selectedChar;
Symbol 195 MovieClip Frame 1
selectedChar = _parent.selectedChar;
Symbol 195 MovieClip Frame 2
stop();
var explosionParameters = new Object();
explosionParameters.width = 10;
explosionParameters.height = 20;
explosionParameters.randomiseX = 5;
explosionParameters.randomiseY = 50;
explosionParameters.gravity = 1;
explosionParameters.forceX = 0.2;
explosionParameters.forceVariationX = 0.3;
explosionParameters.forceY = 0.2;
explosionParameters.forceVariationY = 0.1;
explosionParameters.forceOffsetY = -1;
explosionParameters.forceOffsetVariationY = -5;
explosionParameters.forceOffsetVariationX = 5;
explosionParameters.decelX = 0.99;
explosionParameters.decelY = 0.99;
explosionParameters.decelRot = 0.98;
explosionParameters.clipMinX = -500;
explosionParameters.clipMaxX = 500;
explosionParameters.clipMinY = -1000;
explosionParameters.clipMaxY = 500;
explosionParameters.destroyDelay = 5;
var curExplosion = (new nz.co.resn.ExplodeClip(podium, this, explosionParameters));
Symbol 196 MovieClip Frame 1
stop();
selectedChar = _parent._parent.selectedChar;
Symbol 200 MovieClip Frame 4
_parent.gotoAndStop(1);
Symbol 201 MovieClip Frame 1
var explosionParameters = new Object();
explosionParameters.width = 10;
explosionParameters.height = 20;
explosionParameters.randomiseX = 5;
explosionParameters.randomiseY = 50;
explosionParameters.gravity = 1;
explosionParameters.forceX = 0.2;
explosionParameters.forceVariationX = 0.3;
explosionParameters.forceY = 0.2;
explosionParameters.forceVariationY = 0.1;
explosionParameters.forceOffsetY = -1;
explosionParameters.forceOffsetVariationY = -5;
explosionParameters.forceOffsetVariationX = 5;
explosionParameters.decelX = 0.99;
explosionParameters.decelY = 0.99;
explosionParameters.decelRot = 0.98;
explosionParameters.clipMinX = -500;
explosionParameters.clipMaxX = 500;
explosionParameters.clipMinY = -1000;
explosionParameters.clipMaxY = 500;
explosionParameters.destroyDelay = 5;
var curExplosion = (new nz.co.resn.ExplodeClip(mib, this, explosionParameters));
Symbol 202 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 4
_parent.gotoAndStop(1);
Symbol 207 MovieClip Frame 1
var explosionParameters = new Object();
explosionParameters.width = 10;
explosionParameters.height = 20;
explosionParameters.randomiseX = 5;
explosionParameters.randomiseY = 50;
explosionParameters.gravity = 1;
explosionParameters.forceX = 0.2;
explosionParameters.forceVariationX = 0.3;
explosionParameters.forceY = 0.2;
explosionParameters.forceVariationY = 0.1;
explosionParameters.forceOffsetY = -1;
explosionParameters.forceOffsetVariationY = -5;
explosionParameters.forceOffsetVariationX = 5;
explosionParameters.decelX = 0.99;
explosionParameters.decelY = 0.99;
explosionParameters.decelRot = 0.98;
explosionParameters.clipMinX = -500;
explosionParameters.clipMaxX = 500;
explosionParameters.clipMinY = -1000;
explosionParameters.clipMaxY = 500;
explosionParameters.destroyDelay = 5;
var curExplosion = (new nz.co.resn.ExplodeClip(mib, this, explosionParameters));
Symbol 208 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 1
var explosionParameters = new Object();
explosionParameters.width = 10;
explosionParameters.height = 20;
explosionParameters.randomiseX = 5;
explosionParameters.randomiseY = 50;
explosionParameters.gravity = 1;
explosionParameters.forceX = 0.2;
explosionParameters.forceVariationX = 0.3;
explosionParameters.forceY = 0.2;
explosionParameters.forceVariationY = 0.1;
explosionParameters.forceOffsetY = -1;
explosionParameters.forceOffsetVariationY = -5;
explosionParameters.forceOffsetVariationX = 5;
explosionParameters.decelX = 0.99;
explosionParameters.decelY = 0.99;
explosionParameters.decelRot = 0.98;
explosionParameters.clipMinX = -500;
explosionParameters.clipMaxX = 500;
explosionParameters.clipMinY = -1000;
explosionParameters.clipMaxY = 500;
explosionParameters.destroyDelay = 5;
var curExplosion = (new nz.co.resn.ExplodeClip(vp, this, explosionParameters));
Symbol 219 MovieClip Frame 1
stop();
Symbol 219 MovieClip Frame 10
play();
shown = true;
Symbol 219 MovieClip Frame 25
if (getTimer() < showDelay) {
gotoAndPlay(_currentframe - 1);
}
Symbol 219 MovieClip Frame 26
play();
shown = false;
Symbol 219 MovieClip Frame 30
gotoAndStop ("hidden");
_parent._parent.hideVP();
Symbol 219 MovieClip Frame 35
if (_parent._parent.selectedChar == "mccain") {
vp.vp.vp.gotoAndStop(2);
}
Symbol 219 MovieClip Frame 50
gotoAndStop ("hidden");
_parent._parent.hideVP();
Symbol 273 MovieClip Frame 1
stop();
Symbol 276 MovieClip Frame 1
stop();
if (_parent.objectId != 1) {
gotoAndStop (2);
}
Symbol 276 MovieClip Frame 2
object.object.gotoAndStop(_parent.objectId);
var explosionParameters = new Object();
explosionParameters.width = 100;
explosionParameters.height = 100;
explosionParameters.randomiseX = 100;
explosionParameters.randomiseY = 100;
explosionParameters.gravity = 7;
explosionParameters.forceX = 0.4;
explosionParameters.forceVariationX = 0.6;
explosionParameters.forceY = 0.4;
explosionParameters.forceVariationY = 0.6;
explosionParameters.forceOffsetVariationY = 10;
explosionParameters.forceOffsetVariationX = 10;
explosionParameters.decelX = 0.99;
explosionParameters.decelY = 0.99;
explosionParameters.decelRot = 0.98;
explosionParameters.clipMinX = -1000;
explosionParameters.clipMaxX = 1000;
explosionParameters.clipMinY = -1000;
explosionParameters.clipMaxY = 1000;
explosionParameters.destroyDelay = 5;
var curExplosion = (new nz.co.resn.ExplodeClip(object, this, explosionParameters));
Symbol 283 MovieClip Frame 12
stop();
Symbol 284 MovieClip Frame 1
stop();
if (_parent.objectId == 1) {
gotoAndStop (2);
}
Symbol 289 MovieClip [Object] Frame 1
stop();
Symbol 289 MovieClip [Object] Frame 25
stop();
this.removeMovieClip();
Symbol 290 MovieClip Frame 1
stop();
Symbol 308 MovieClip Frame 1
stop();
Symbol 311 MovieClip Frame 1
stop();
Symbol 312 MovieClip Frame 1
stop();
armPower.cacheAsBitmap = true;
mask.cacheAsBitmap = true;
armPower.setMask(mask);
Symbol 323 MovieClip Frame 1
_parent.updateHandItem();
Symbol 323 MovieClip Frame 16
stop();
Symbol 332 MovieClip Frame 1
stop();
Symbol 336 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 1
stop();
Symbol 340 MovieClip Frame 1
function update() {
updateCrosshair();
updateInput();
updateBoss();
updateView();
updateObjects();
}
function OnKeyUp() {
curKey = Key.getCode();
}
function selectCharacter(charId) {
bossClip.gotoAndStop(charId);
}
function initCrowd() {
for (curClipName in crowd.row1) {
curChar = crowd.row1[curClipName];
curChar.startX = curChar._x;
curChar.startY = curChar._y;
}
for (curClipName in crowd.row2) {
curChar = crowd.row2[curClipName];
curChar.startX = curChar._x;
curChar.startY = curChar._y;
}
for (curClipName in crowd.row3) {
curChar = crowd.row3[curClipName];
curChar.startX = curChar._x;
curChar.startY = curChar._y;
}
}
function updateCrosshair() {
wobbleMultiplier = throwAmount * throwAmount;
wobbleX = ((Math.sin((getTimer() * 0.001) * wobbleSpeed) * Math.sin(((getTimer() * 0.0024) * wobbleSpeed) + 1.3)) * wobbleMultiplier) * wobbleAmount;
wobbleY = ((Math.sin(((getTimer() * 0.0012) * wobbleSpeed) + 0.43) * Math.sin(((getTimer() * 0.00325) * wobbleSpeed) + 2.5)) * wobbleMultiplier) * wobbleAmount;
targetTargetX = _xmouse + wobbleX;
targetTargetY = _ymouse + wobbleY;
targetX = targetX + ((targetTargetX - targetX) * crosshairAccel);
targetY = targetY + ((targetTargetY - targetY) * crosshairAccel);
crosshair._x = targetX;
crosshair._y = targetY;
}
function updateInput() {
if (charging && (getTimer() > nextAvaliableThrowTime)) {
throwAmount = throwAmount + ((maxThrowAmount - throwAmount) * throwAmountAccel);
} else {
throwAmount = throwAmount * throwAmountDecel;
}
hand.hand.mask.gotoAndStop(Math.floor(hand.hand._totalframes * (throwAmount / maxThrowAmount)) + 1);
hand.hand.armPower.gotoAndStop(Math.floor(hand.hand.armPower._totalframes * (throwAmount / maxThrowAmount)) + 1);
bossHealthBar.bar._xscale = bossHealthBar.bar._xscale + ((bossHealth - bossHealthBar.bar._xscale) * 0.2);
if (throwAmount >= blastPower) {
powerBar._alpha = ((Math.sin(getTimer() * 0.06) < 0) ? 100 : 50);
} else {
powerBar._alpha = 100;
}
if (bossHealth <= bossKoHealth) {
bossHealthBar._alpha = ((Math.sin(getTimer() * 0.06) < 0) ? 100 : 50);
} else {
bossHealthBar._alpha = 100;
}
if (gamePlaying) {
time = (getTimer() - startTime) / 1000;
gameActive = (time * countdownSpeed) >= 3;
if ((time * countdownSpeed) < 4) {
countdown._visible = true;
countdown.gotoAndStop(Math.floor(time * countdownSpeed) + 1);
} else {
countdown._visible = false;
}
if (time > maxTime) {
if (gamePlaying) {
loadingHighscores.gotoAndStop(2);
endGameProceeding = true;
proceedTime = getTimer() + 1000;
timesup.gotoAndStop(2);
trace((("proceed: " + proceedTime) + ",") + timesup);
endGame();
}
}
} else if (proceedTime) {
if ((getTimer() >= proceedTime) && (!score.loadingHighscores)) {
endGameProceed();
}
}
if (gamePlaying) {
remainingTime = Math.round(maxTime - time);
if (remainingTime <= 10) {
timePanel._alpha = ((Math.sin(getTimer() * 0.24) < 0) ? 100 : 50);
} else if (remainingTime <= 5) {
timePanel._alpha = ((Math.sin(getTimer() * 0.12) < 0) ? 100 : 50);
} else {
timePanel._alpha = 100;
}
} else if (countSeconds) {
if (remainingTime > 0) {
remainingTime--;
score.setScore(score.getScore() + remainingTimeScoreMultiplier);
} else if (!endGameProceeding) {
loadingHighscores.gotoAndStop(2);
endGameProceeding = true;
proceedTime = getTimer() + 500;
}
}
timePanel.txtTime.text = remainingTime;
curScoreText = score.getScore();
scorePanel.txtScore.text = Math.round(curScoreText);
}
function updateBoss() {
bossClip._x = bossClip.startX + ((((bossDist * Math.sin((startTime * 0.0012322) * bossSpeed)) * Math.sin(((getTimer() * 0.0019) * bossSpeed) + 1.1)) * Math.sin(((getTimer() * 0.000445) * bossSpeed) + 2.8)) * Math.sin(((getTimer() * 0.00143) * bossSpeed) + 3.3));
boss.body._rotation = (((bossRotAmount * Math.sin(((getTimer() * 0.00453) * bossRotSpeed) + 1.2)) * Math.sin(((getTimer() * 0.00214) * bossRotSpeed) + 0.8)) * Math.sin(((getTimer() * 0.0008665) * bossRotSpeed) + 1.4)) * Math.sin(((getTimer() * 0.001234) * bossRotSpeed) + 2.7);
boss.body.armRight._rotation = (((bossRotAmount * Math.sin(((getTimer() * 0.0243) * bossRotSpeed) + 1.67)) * Math.sin(((getTimer() * 0.00356) * bossRotSpeed) + 0.9)) * Math.sin(((getTimer() * 0.001235) * bossRotSpeed) + 2.6)) * Math.sin(((getTimer() * 0.00462) * bossRotSpeed) + 2.134);
boss.body.armRight._rotation = Math.round(boss.body.armRight._rotation / 10) * 10;
}
function updateView() {
objectSpaceTargetX = targetX - objectSpace._x;
objectSpaceTargetY = targetY - objectSpace._y;
targetViewX = (((jostleAmountX * Math.sin((getTimer() * 0.0012322) * jostleSpeed)) * Math.sin(((getTimer() * 0.0019) * jostleSpeed) + 1.1)) * Math.sin(((getTimer() * 0.000445) * jostleSpeed) + 2.8)) * Math.sin(((getTimer() * 0.00143) * jostleSpeed) + 3.3);
targetViewY = (((jostleAmountY * Math.sin((getTimer() * 0.00453) * jostleSpeed)) * Math.sin(((getTimer() * 0.00214) * jostleSpeed) + 0.8)) * Math.sin(((getTimer() * 0.0008665) * jostleSpeed) + 1.4)) * Math.sin(((getTimer() * 0.001234) * jostleSpeed) + 2.7);
viewParaX = viewParaX + ((objectSpaceTargetX - viewParaX) * viewParaAccel);
viewParaY = viewParaY + ((objectSpaceTargetY - viewParaY) * viewParaAccel);
targetViewX = Math.max(-maxViewX, Math.min(maxViewX, targetViewX));
targetViewY = Math.max(-maxViewY, Math.min(maxViewY, targetViewY));
targetViewX = targetViewX - (viewParaX * viewParallax);
targetViewY = targetViewY - (viewParaY * viewParallax);
targetViewX = Math.max(-maxViewX, Math.min(maxViewX, targetViewX));
targetViewY = Math.max(-maxViewY, Math.min(maxViewY, targetViewY));
viewX = viewX + ((targetViewX - viewX) * 0.2);
viewY = viewY + ((targetViewY - viewY) * 0.2);
scene._x = scene.startX + (viewX * 0.5);
scene._y = scene.startY + (viewY * 0.5);
hand._x = (((hand.startX + ((objectSpaceTargetX + 400) * 0.15)) + (viewX * 0.4)) - 20) + ((((powerVibrateAmountX * Math.sin((getTimer() * 0.0012322) * powerVibrateSpeed)) * Math.sin(((getTimer() * 0.00453) * powerVibrateSpeed) + 1.1)) * (throwAmount / maxThrowAmount)) * (throwAmount / maxThrowAmount));
hand._y = ((hand.startY + ((objectSpaceTargetY + 200) * 0.05)) + (viewY * 0.4)) + ((((powerVibrateAmountY * Math.sin((getTimer() * 0.0019) * powerVibrateSpeed)) * Math.sin(((getTimer() * 0.0019) * powerVibrateSpeed) + 1.1)) * (throwAmount / maxThrowAmount)) * (throwAmount / maxThrowAmount));
hand._rotation = (5 * (throwAmount / maxThrowAmount)) + ((objectSpaceTargetX + 100) * 0.02);
crowd.row1._x = viewX * 0.6;
crowd.row1._y = viewY * 0.6;
crowd.row2._x = viewX * 0.4;
crowd.row2._y = viewY * 0.4;
crowd.row3._x = viewX * 0.2;
crowd.row3._y = viewY * 0.2;
mibs._x = viewX * 0.08;
mibs._y = viewY * 0.08;
bossSpace._x = bossSpace.startX + (viewX * 0.05);
bossSpace._y = bossSpace.startY + (viewY * 0.05);
podium._x = viewX * 0.06;
podium._y = viewY * 0.06;
bg.stage._x = viewX * 0.04;
bg.stage._y = viewY * 0.04;
bg.flags._x = (-viewX) * 0.1;
bg.flags._y = (-viewY) * 0.1;
bg.whitehouse._x = (-viewX) * 0.3;
bg.whitehouse._y = (-viewY) * 0.3;
bg.clouds._x = (-viewX) * 0.4;
bg.clouds._y = (-viewY) * 0.4;
for (curClipName in crowd.row1) {
curChar = crowd.row1[curClipName];
curCharOffset = curChar.startX;
curCharPhase = curChar.startX * 0.001;
curJostleSpeed = jostleSpeed * curCharPhase;
curChar._x = curChar.startX + ((((10 * Math.sin(((getTimer() * 0.0012322) * curJostleSpeed) + curCharOffset)) * Math.sin((((getTimer() * 0.0019) * curJostleSpeed) + 1.1) + curCharOffset)) * Math.sin((((getTimer() * 0.000445) * curJostleSpeed) + 2.8) + curCharOffset)) * Math.sin((((getTimer() * 0.00143) * curJostleSpeed) + 3.3) + curCharOffset));
curChar._y = curChar.startY + ((((10 * Math.sin(((getTimer() * 0.00453) * curJostleSpeed) + curCharOffset)) * Math.sin((((getTimer() * 0.00214) * curJostleSpeed) + 0.8) + curCharOffset)) * Math.sin((((getTimer() * 0.0008665) * curJostleSpeed) + 1.4) + curCharOffset)) * Math.sin((((getTimer() * 0.001234) * curJostleSpeed) + 2.7) + curCharOffset));
curChar._rotation = (((10 * Math.sin((((getTimer() * 0.0243) * curJostleSpeed) + 1.67) + curCharOffset)) * Math.sin((((getTimer() * 0.00356) * curJostleSpeed) + 0.9) + curCharOffset)) * Math.sin((((getTimer() * 0.001235) * curJostleSpeed) + 2.6) + curCharOffset)) * Math.sin((((getTimer() * 0.00462) * curJostleSpeed) + 2.134) + curCharOffset);
}
for (curClipName in crowd.row2) {
curChar = crowd.row2[curClipName];
curCharOffset = curChar.startX;
curCharPhase = curChar.startX * 0.001;
curJostleSpeed = jostleSpeed * curCharPhase;
curChar._x = curChar.startX + ((((6 * Math.sin(((getTimer() * 0.0012322) * curJostleSpeed) + curCharOffset)) * Math.sin((((getTimer() * 0.0019) * curJostleSpeed) + 1.1) + curCharOffset)) * Math.sin((((getTimer() * 0.000445) * curJostleSpeed) + 2.8) + curCharOffset)) * Math.sin((((getTimer() * 0.00143) * curJostleSpeed) + 3.3) + curCharOffset));
curChar._y = curChar.startY + ((((6 * Math.sin(((getTimer() * 0.00453) * curJostleSpeed) + curCharOffset)) * Math.sin((((getTimer() * 0.00214) * curJostleSpeed) + 0.8) + curCharOffset)) * Math.sin((((getTimer() * 0.0008665) * curJostleSpeed) + 1.4) + curCharOffset)) * Math.sin((((getTimer() * 0.001234) * curJostleSpeed) + 2.7) + curCharOffset));
curChar._rotation = (((8 * Math.sin((((getTimer() * 0.0243) * curJostleSpeed) + 1.67) + curCharOffset)) * Math.sin((((getTimer() * 0.00356) * bossRotSpeed) + 0.9) + curCharOffset)) * Math.sin((((getTimer() * 0.001235) * curJostleSpeed) + 2.6) + curCharOffset)) * Math.sin((((getTimer() * 0.00462) * curJostleSpeed) + 2.134) + curCharOffset);
}
for (curClipName in crowd.row3) {
curChar = crowd.row3[curClipName];
curCharOffset = curChar.startX;
curCharPhase = curChar.startX * 0.001;
curJostleSpeed = jostleSpeed * curCharPhase;
curChar._x = curChar.startX + ((((3 * Math.sin(((getTimer() * 0.0012322) * curJostleSpeed) + curCharOffset)) * Math.sin((((getTimer() * 0.0019) * curJostleSpeed) + 1.1) + curCharOffset)) * Math.sin((((getTimer() * 0.000445) * curJostleSpeed) + 2.8) + curCharOffset)) * Math.sin((((getTimer() * 0.00143) * curJostleSpeed) + 3.3) + curCharOffset));
curChar._y = curChar.startY + ((((3 * Math.sin(((getTimer() * 0.00453) * curJostleSpeed) + curCharOffset)) * Math.sin((((getTimer() * 0.00214) * curJostleSpeed) + 0.8) + curCharOffset)) * Math.sin((((getTimer() * 0.0008665) * curJostleSpeed) + 1.4) + curCharOffset)) * Math.sin((((getTimer() * 0.001234) * curJostleSpeed) + 2.7) + curCharOffset));
curChar._rotation = (((6 * Math.sin((((getTimer() * 0.0243) * curJostleSpeed) + 1.67) + curCharOffset)) * Math.sin((((getTimer() * 0.00356) * curJostleSpeed) + 0.9) + curCharOffset)) * Math.sin((((getTimer() * 0.001235) * curJostleSpeed) + 2.6) + curCharOffset)) * Math.sin((((getTimer() * 0.00462) * curJostleSpeed) + 2.134) + curCharOffset);
}
}
function updateObjects() {
if (((getTimer() >= nextVPTime) && (!curVp.vp)) && (!curVp.blasted)) {
showVP();
}
for (curObjectName in objectSpace) {
curObject = objectSpace[curObjectName];
if (!curObject.hasHitTarget) {
curObject._rotation = curObject._rotation + curObject.rotVel;
curObject._xscale = curObject._xscale * (1 - (curObject.speed * 0.1));
curObject._yscale = curObject._xscale;
curObject._x = curObject._x + ((curObject.targetX - curObject._x) * (curObject.speed * 0.1));
curObject._y = curObject._y + ((curObject.targetY - curObject._y) * (curObject.speed * 0.1));
zMultiplier = curObject._xscale / 100;
curObject.targetY = curObject.targetY + (gravity * zMultiplier);
if ((!curObject.testedHit) && (curObject._xscale < hitScale)) {
curObject.testedHit = true;
globalObjectX = curObject._x + objectSpace._x;
globalObjectY = curObject._y + objectSpace._y;
scorePowerMultiplier = Math.floor(curObject.power * 4) + 1;
if (scorePowerMultiplier >= 4) {
scorePowerMultiplier = scorePowerMultiplier + 1;
}
scorePowerMultiplier = scorePowerMultiplier * scorePowerMultiplierMultiplier;
curScoreInc = 0;
hasHit = false;
if (((curVp && (curVp.vp)) && (!curVp.blasted)) && (curVp.vp.hs.hitTest(globalObjectX, globalObjectY, true))) {
curScoreInc = scoreVP * scorePowerMultiplier;
curVp.gotoAndPlay("blast");
curVp.blasted = true;
hasHit = true;
} else if ((!mibs.mib1.blasted) && (mibs.mib1.hitTest(globalObjectX, globalObjectY, true))) {
if (mibs.mib1.hits == undefined) {
mibs.mib1.hits = 1;
} else {
mibs.mib1.hits++;
}
if (mibs.mib1.hits >= 2) {
curScoreInc = scoreMib * scorePowerMultiplier;
mibs.mib1.gotoAndStop(3);
mibs.mib1.blasted = true;
} else {
mibs.mib1.gotoAndStop(2);
}
hasHit = true;
} else if ((!mibs.mib2.blasted) && (mibs.mib2.hitTest(globalObjectX, globalObjectY, true))) {
if (mibs.mib2.hits == undefined) {
mibs.mib2.hits = 1;
} else {
mibs.mib2.hits++;
}
if (mibs.mib2.hits >= 2) {
curScoreInc = scoreMib * scorePowerMultiplier;
mibs.mib2.gotoAndStop(3);
mibs.mib2.blasted = true;
} else {
mibs.mib2.gotoAndStop(2);
}
hasHit = true;
} else if ((!podium.blasted) && (podium.hs.hitTest(globalObjectX, globalObjectY, true))) {
if (podium.hits == undefined) {
podium.hits = 1;
} else {
podium.hits++;
}
if (podium.hits >= 3) {
curScoreInc = scorePodium * scorePowerMultiplier;
podium.gotoAndStop(3);
podium.blasted = true;
} else {
podium.gotoAndStop(2);
}
hasHit = true;
} else if ((gamePlaying && (gameActive)) && (bossClip.headHs.hitTest(globalObjectX, globalObjectY, true) || bossClip.bodyHs.hitTest(globalObjectX, globalObjectY, true))) {
if (bossClip.bodyHs.hitTest(globalObjectX, globalObjectY, true)) {
curScoreInc = scoreBody * scorePowerMultiplier;
boss.gotoAndStop("hit1");
} else {
curScoreInc = scoreHead * scorePowerMultiplier;
if (Math.random() < 0.5) {
boss.gotoAndStop("hit2");
} else {
boss.gotoAndStop("hit3");
}
}
if ((curObject.power >= blastPower) && (bossHealth <= bossKoHealth)) {
curScoreInc = curScoreInc * scoreKillSuperMultiplier;
bossHealth = 0;
} else {
bossHealthInc = curScoreInc * bossDamageMultiplier;
if (curObject.scoreMultiplier) {
bossHealthInc = bossHealthInc * curObject.scoreMultiplier;
}
bossHealth = bossHealth - bossHealthInc;
if (bossHealth <= 0) {
curScoreInc = curScoreInc * scoreKillMultiplier;
}
}
if (bossHealth <= 0) {
endGame();
bossHealthBar._visible = false;
bossClip.explode();
}
hasHit = true;
} else if ((!bg.flags.flag1.blasted) && bg.flags.flag1.hs.hitTest(globalObjectX, globalObjectY, true)) {
if (bg.flags.flag1.hits == undefined) {
bg.flags.flag1.hits = 1;
} else {
bg.flags.flag1.hits++;
}
if (bg.flags.flag1.hits >= 2) {
curScoreInc = scoreFlag * scorePowerMultiplier;
bg.flags.flag1.gotoAndStop(3);
bg.flags.flag1.blasted = true;
} else {
bg.flags.flag1.gotoAndStop(2);
}
hasHit = true;
} else if ((!bg.flags.flag2.blasted) && bg.flags.flag2.hs.hitTest(globalObjectX, globalObjectY, true)) {
if (bg.flags.flag2.hits == undefined) {
bg.flags.flag2.hits = 1;
} else {
bg.flags.flag2.hits++;
}
if (bg.flags.flag2.hits >= 2) {
curScoreInc = scoreFlag * scorePowerMultiplier;
bg.flags.flag2.gotoAndStop(3);
bg.flags.flag2.blasted = true;
} else {
bg.flags.flag2.gotoAndStop(2);
}
hasHit = true;
} else if (bg.stage.hitTest(globalObjectX, globalObjectY, true)) {
hasHit = true;
}
if (hasHit) {
curObject.hasHitTarget = true;
if (curObject.scoreMultiplier) {
curScoreInc = curScoreInc * curObject.scoreMultiplier;
}
curObject._yscale = (curObject._xscale = hitScale);
curObject.gotoAndPlay("hit");
curObject._rotation = 0;
curObject.gotoAndPlay("hit");
if (curScoreInc) {
curObject.hitScore.txtScore.text = curScoreInc;
} else {
curObject.hitScore.txtScore.text = "";
}
score.setScore(score.getScore() + curScoreInc);
}
} else if ((curObject._y > 400) || (curObject._xscale < 8)) {
curObject.removeMovieClip();
}
}
}
}
function throwObject() {
getNextAvaliableThrowTime();
objectStartPos = {x:hand.object._x, y:hand.object._y};
hand.localToGlobal(objectStartPos);
curDepth = objectSpace.getNextHighestDepth();
curObject = objectSpace.attachMovie("Object", "Object" + curDepth, curDepth);
objectStartX = objectStartPos.x - objectSpace._x;
objectStartY = objectStartPos.y - objectSpace._y;
curObject._x = objectStartX;
curObject._y = objectStartY;
hand.gotoAndPlay("throw");
objectSpaceTargetX = targetX - objectSpace._x;
objectSpaceTargetY = targetY - objectSpace._y;
curObject.targetX = objectSpaceTargetX + ((objectSpaceTargetX - objectStartX) * targetOffsetDist);
curObject.targetY = objectSpaceTargetY + ((objectSpaceTargetY - objectStartY) * targetOffsetDist);
curObject.targetY = curObject.targetY - ((gravity * (1 - throwAmount)) * 4);
curObject.speed = 0.4 + (throwAmount * 5);
curObject.power = throwAmount;
if (nextObjectSpecial) {
curObject.scoreMultiplier = scoreSpecialMultiplier;
}
curObject.graphic.gotoAndStop(nextObjectId);
curObject.objectId = nextObjectId;
curObject.rotVel = ((Math.random() - 0.5) * spinSpeed) * throwAmount;
getNextObject();
}
function showVP() {
if (curVp.vp) {
return(undefined);
}
if (Math.random() < 0.5) {
curVp = scene.vpLeft;
} else {
curVp = scene.vpRight;
}
curVp.gotoAndPlay("show");
if (selectedChar == "mccain") {
curVp.vp.gotoAndStop(2);
} else {
curVp.vp.gotoAndStop(1);
}
curVp.blasted = false;
curVp.showDelay = getTimer() + vpShowDelay;
}
function hideVP() {
getNextVPTime();
}
function getNextVPTime() {
nextVPTime = (getTimer() + vpDelay) + (Math.random() * vpDelayVariation);
}
function getNextAvaliableThrowTime() {
nextAvaliableThrowTime = getTimer() + minThrowDelay;
}
function getNextObject() {
nextObjectId = 1;
specialThrowCount++;
if (gamePlaying) {
if ((specialThrowCount > 7) && (Math.random() < 0.6)) {
nextObjectId = 6;
specialThrowCount = 0;
}
if ((specialThrowCount > 6) && (Math.random() < 0.5)) {
nextObjectId = 5;
specialThrowCount = 0;
}
if ((specialThrowCount > 5) && (Math.random() < 0.4)) {
nextObjectId = 4;
specialThrowCount = 0;
}
if ((specialThrowCount > 4) && (Math.random() < 0.3)) {
nextObjectId = 3;
specialThrowCount = 0;
}
if ((specialThrowCount > 3) && (Math.random() < 0.2)) {
nextObjectId = 2;
specialThrowCount = 0;
}
}
nextObjectSpecial = nextObjectId != 1;
objectPanel.object.gotoAndStop(nextObjectId);
}
function startGame() {
gamePlaying = true;
startTime = getTimer();
score.setScore(0);
}
function endGame() {
gamePlaying = false;
countSeconds = true;
score.loadHighscores();
}
function endGameProceed() {
trace("endGameProceed");
_parent.endGame();
}
function updateHandItem() {
hand.object.gotoAndStop(nextObjectId);
}
maxTime = 60;
countdownSpeed = 1.5;
throwAmount = 0;
maxThrowAmount = 1;
targetX = 0;
targetY = 0;
throwAmountAccel = 0.05;
throwAmountDecel = 0.4;
targetOffsetDist = 0.1;
crosshairAccel = 0.4;
wobbleAmount = 120;
wobbleSpeed = 1.5;
hitScale = 15;
maxBossHealth = 100;
bossHealth = maxBossHealth;
blastPower = 0.75;
bossSpeed = 0.4;
bossDist = 250;
bossKoHealth = 25;
bossRotSpeed = 0.3;
bossRotAmount = 20;
spinSpeed = 80;
objectStartX = 220;
objectStartY = 40;
objectStartZ = 0;
airDecelX = 0.99;
airDecelY = 0.99;
gravity = 100;
throwVelBaseX = -10;
throwVelBaseY = -10;
throwVelBaseZ = 20;
viewWidth = 600;
viewHeight = 450;
viewMidX = viewWidth / 2;
viewMidY = viewHeight / 2;
minThrowDelay = 400;
nextAvaliableThrowTime = 0;
startTime = 0;
time = 0;
bestTime = 0;
jostleAmountX = 50;
jostleAmountY = 10;
jostleSpeed = 0.7;
viewX = 0;
viewY = 0;
maxViewX = 10;
maxViewY = 10;
viewParaX = 0;
viewParaY = 0;
viewParaAccel = 0.1;
viewParallax = 0.05;
specialThrowCount = 0;
specialChance = 0.2;
numWeapons = 6;
Mouse.hide();
scene.startX = scene._x;
scene.startY = scene._y;
bossSpace.startX = bossSpace._x;
bossSpace.startY = bossSpace._y;
hand.startX = hand._x;
hand.startY = hand._y;
bg = scene.bg;
podium = scene.podium;
bossSpace = scene.bossSpace;
mibs = scene.mibs;
crowd = scene.crowd;
powerVibrateAmountX = 4;
powerVibrateAmountY = 2;
powerVibrateSpeed = 10;
bossClip = bossSpace.bossClip;
bossHealthBar = bossClip.bossHealthBar;
boss = bossClip.boss;
bossClip.startX = bossClip._x;
curScore = 0;
remainingTime = 0;
scoreHead = 10;
scoreBody = 5;
scoreMib = 40;
scoreVP = 100;
scorePodium = 100;
scoreFlag = 50;
scoreKillMultiplier = 5;
scoreKillSuperMultiplier = 10;
scoreSpecialMultiplier = 2;
scorePowerMultiplierMultiplier = 1;
bossDamageMultiplier = 0.15;
remainingTimeScoreMultiplier = 50;
nextVPTime = 0;
vpDelay = 6000;
vpDelayVariation = 2000;
vpShowDelay = 2000;
getNextVPTime();
initCrowd();
getNextObject();
selectedChar = _parent.selectedChar;
if (selectedChar == "mccain") {
selectCharacter(2);
}
score = _parent.score;
startGame();
keyListener = new Object();
keyListener.onKeyUp = OnKeyUp;
Key.addListener(keyListener);
this.onEnterFrame = update;
update();
this.onMouseDown = function () {
if (gameActive) {
charging = true;
throwAmount = 0;
}
};
this.onMouseUp = function () {
if ((gameActive && (charging)) && (getTimer() > nextAvaliableThrowTime)) {
charging = false;
throwObject();
}
};
Symbol 353 Button
on (release) {
submit();
}
Symbol 354 MovieClip Frame 1
function submit() {
if (!submitted) {
playerName = txtName.text;
if ((playerName.length > 0) && (playerName != defaultPlayerName)) {
submitted = true;
statsString = "";
score.gotoHighscores = true;
score.loadingHighscores = true;
score.saveHighScore(1, playerName, "", statsString, score.loadHighscores);
_parent.curName = playerName;
gotoAndStop (2);
}
}
}
score = _parent.score;
curScore = score.getScore();
scoreClip.txtScore.text = curScore;
defaultPlayerName = txtName.text;
stop();
Symbol 354 MovieClip Frame 2
stop();
Symbol 355 Button
on (release) {
_parent.gotoAndStop("choose");
}
Symbol 374 MovieClip [highscoresItem] Frame 1
stop();
Symbol 375 MovieClip Frame 1
stop();
Symbol 376 MovieClip Frame 1
gotoAndPlay ("show");
curPoll = _parent.curPoll;
pollObamaCount = curPoll.pollAnswers.obama.count;
pollMcCainCount = curPoll.pollAnswers.mccain.count;
trace((pollObamaCount + ",") + pollMcCainCount);
if ((pollObamaCount == undefined) || (pollMcCainCount == undefined)) {
pollObamaCount = Math.floor(Math.random() * 1000) + 1;
pollMcCainCount = Math.floor(Math.random() * 1000) + 1;
}
pollTotalCount = pollObamaCount + pollMcCainCount;
pollBarObama.bar._xscale = (pollObamaCount / pollTotalCount) * 100;
pollBarMcCain.bar._xscale = (pollMcCainCount / pollTotalCount) * 100;
pollBarObama.count.txtCount.text = pollObamaCount;
pollBarMcCain.count.txtCount.text = pollMcCainCount;
ySpacing = 20;
score = _parent.score;
highscores = score.highscores;
curScore = score.getScore();
curName = _parent.curName;
if (!curName) {
curName = "You";
}
nameClip.txtName.htmlText = curName;
scoreClip.txtScore.htmlText = curScore;
highscoreInTable = false;
si = 0;
while (si < highscores.length) {
curHighscore = highscores[si];
curDepth = highscoresTable.getNextHighestDepth();
curHighscoreItem = highscoresTable.attachMovie("highscoresItem", "highscoresItem" + curDepth, curDepth);
curHighscoreItem._y = si * ySpacing;
if ((curHighscore.score == curScore) && (curHighscore.name == curName)) {
curHighscoreItem.gotoAndStop(2);
highscoreInTable = true;
}
curHighscoreItem.score.txtScore.htmlText = curHighscore.score;
curHighscoreItem.name.txtName.htmlText = curHighscore.name;
si++;
}
if (highscoreInTable) {
nameClip._visible = false;
scoreClip._visible = false;
}