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__("4bf100b3", this, 10301, true);
MochiAd.showPreGameAd({id:"6c3c18ff6b8eb522", res:"600x400"});
var swfname;
var swfheight;
var swfwidth;
var embedcode;
if (uname != undefined) {
highScores.nameSWFVariable = uname;
}
highScores.gameID = 7531;
swfname = "castledefense.swf";
swfheight = "430";
swfwidth = "600";
embedcode = ((((((((((("<object width=\"" + _root.swfwidth) + "\" height=\"") + _root.swfheight) + "\"><param name=\"movie\" value=\"http://www.fupa.com/games/") + _root.swfname) + "\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.fupa.com/games/") + _root.swfname) + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"") + _root.swfwidth) + "\" height=\"") + _root.swfheight) + "\"></embed></object>";
com.novelgames.flashgames.commonAS2.MainDevelopment.initialize(this);
Instance of Symbol 236 MovieClip [HighScores] "highScores" in Frame 1
//component parameters
onClipEvent (construct) {
backgroundAlpha = 0.5;
backgroundColour = 11711154 /* 0xB2B2B2 */;
dialogAlpha = 1;
dialogBorderAlpha = 1;
dialogBorderColour = 11711154 /* 0xB2B2B2 */;
dialogBorderThickness = 5;
dialogColour = 14277081 /* 0xD9D9D9 */;
gameID = 0;
hashKey = "superwazooo";
highScoresHighlightColour = 16711680 /* 0xFF0000 */;
loadScoresAtStart = false;
loadScoresURL = "http://www.fupa.com/loadScores.aspx";
maxNoOfScores = 50;
nameSWFVariable = "";
saveScoreURL = "http://www.fupa.com/saveScore.aspx";
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Frame 10
stop();
Symbol 10 MovieClip [ExplosionCastle] Frame 1
#initclip 121
Object.registerClass("ExplosionCastle", com.novelgames.flashgames.castledefenseAS2.ExplosionCastle);
#endinitclip
Symbol 15 MovieClip [ExplosionBullet] Frame 1
#initclip 83
Object.registerClass("ExplosionBullet", com.novelgames.flashgames.castledefenseAS2.ExplosionBullet);
#endinitclip
Symbol 19 MovieClip [ExplosionEnemy] Frame 1
#initclip 84
Object.registerClass("ExplosionEnemy", com.novelgames.flashgames.castledefenseAS2.ExplosionEnemy);
#endinitclip
Symbol 21 MovieClip [cannonBackground1] Frame 1
#initclip 85
Object.registerClass("cannonBackground1", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 23 MovieClip [cannon1] Frame 1
#initclip 86
Object.registerClass("cannon1", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 24 MovieClip [CannonSet1] Frame 1
#initclip 87
Object.registerClass("CannonSet1", com.novelgames.flashgames.castledefenseAS2.CannonSet1);
#endinitclip
Symbol 28 MovieClip [Enemy0] Frame 1
#initclip 88
Object.registerClass("Enemy0", com.novelgames.flashgames.castledefenseAS2.Enemy0);
#endinitclip
Symbol 30 MovieClip [Enemy2] Frame 1
#initclip 89
Object.registerClass("Enemy2", com.novelgames.flashgames.castledefenseAS2.Enemy2);
#endinitclip
Symbol 32 MovieClip [Enemy1] Frame 1
#initclip 90
Object.registerClass("Enemy1", com.novelgames.flashgames.castledefenseAS2.Enemy1);
#endinitclip
Symbol 34 MovieClip [cannonBackground2] Frame 1
#initclip 91
Object.registerClass("cannonBackground2", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 36 MovieClip [cannon2] Frame 1
#initclip 92
Object.registerClass("cannon2", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 37 MovieClip [CannonSet2] Frame 1
#initclip 93
Object.registerClass("CannonSet2", com.novelgames.flashgames.castledefenseAS2.CannonSet2);
#endinitclip
Symbol 39 MovieClip [cannonBackground0] Frame 1
#initclip 94
Object.registerClass("cannonBackground0", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 41 MovieClip [cannon0] Frame 1
#initclip 95
Object.registerClass("cannon0", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 42 MovieClip [CannonSet0] Frame 1
#initclip 96
Object.registerClass("CannonSet0", com.novelgames.flashgames.castledefenseAS2.CannonSet0);
#endinitclip
Symbol 49 MovieClip [Road] Frame 1
#initclip 97
Object.registerClass("Road", com.novelgames.flashgames.castledefenseAS2.Road);
#endinitclip
Symbol 54 MovieClip [MessageLevel] Frame 1
#initclip 98
Object.registerClass("MessageLevel", com.novelgames.flashgames.castledefenseAS2.MessageLevel);
#endinitclip
Symbol 56 MovieClip [MoneyPopup] Frame 1
#initclip 99
Object.registerClass("MoneyPopup", com.novelgames.flashgames.castledefenseAS2.MoneyPopup);
#endinitclip
Symbol 64 MovieClip [MessagePlayAgain] Frame 1
#initclip 100
Object.registerClass("MessagePlayAgain", com.novelgames.flashgames.castledefenseAS2.MessagePlayAgain);
#endinitclip
Symbol 74 MovieClip [Instructions] Frame 1
#initclip 101
Object.registerClass("Instructions", com.novelgames.flashgames.commonAS2.Instructions);
#endinitclip
Symbol 76 MovieClip [InstructionsButton] Frame 1
#initclip 102
Object.registerClass("InstructionsButton", com.novelgames.flashgames.commonAS2.InstructionsButton);
#endinitclip
Symbol 80 MovieClip [MuteButton] Frame 1
#initclip 103
Object.registerClass("MuteButton", com.novelgames.flashgames.commonAS2.MuteButton);
#endinitclip
Symbol 81 MovieClip [empty] Frame 1
#initclip 104
Object.registerClass("empty", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 100 MovieClip [BuyDialog] Frame 1
#initclip 105
Object.registerClass("BuyDialog", com.novelgames.flashgames.castledefenseAS2.BuyDialog);
#endinitclip
Symbol 104 MovieClip [PutDialog] Frame 1
#initclip 106
Object.registerClass("PutDialog", com.novelgames.flashgames.castledefenseAS2.PutDialog);
#endinitclip
Symbol 110 MovieClip [sellBubble] Frame 1
#initclip 107
Object.registerClass("sellBubble", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 111 MovieClip [SellDialog] Frame 1
#initclip 108
Object.registerClass("SellDialog", com.novelgames.flashgames.castledefenseAS2.SellDialog);
#endinitclip
Symbol 130 MovieClip [Message] Frame 1
#initclip 109
Object.registerClass("Message", com.novelgames.flashgames.castledefenseAS2.Message);
#endinitclip
Symbol 131 MovieClip [Game] Frame 1
#initclip 110
Object.registerClass("Game", com.novelgames.flashgames.castledefenseAS2.Game);
#endinitclip
Symbol 137 MovieClip [lifeBarMask] Frame 1
#initclip 111
Object.registerClass("lifeBarMask", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 139 MovieClip [LifeBubble] Frame 1
#initclip 112
Object.registerClass("LifeBubble", com.novelgames.flashgames.castledefenseAS2.LifeBubble);
#endinitclip
Symbol 141 MovieClip [castleGraphic] Frame 1
#initclip 113
Object.registerClass("castleGraphic", com.novelgames.flashgames.commonAS2.NewMovieClip);
#endinitclip
Symbol 142 MovieClip [Castle] Frame 1
#initclip 114
Object.registerClass("Castle", com.novelgames.flashgames.castledefenseAS2.Castle);
#endinitclip
Symbol 144 MovieClip [Cross] Frame 1
#initclip 115
Object.registerClass("Cross", com.novelgames.flashgames.castledefenseAS2.Cross);
#endinitclip
Symbol 146 MovieClip [CannonSetRange] Frame 1
#initclip 116
Object.registerClass("CannonSetRange", com.novelgames.flashgames.castledefenseAS2.CannonSetRange);
#endinitclip
Symbol 148 MovieClip [Bullet0] Frame 1
#initclip 117
Object.registerClass("Bullet0", com.novelgames.flashgames.castledefenseAS2.Bullet0);
#endinitclip
Symbol 150 MovieClip [Bullet1] Frame 1
#initclip 118
Object.registerClass("Bullet1", com.novelgames.flashgames.castledefenseAS2.Bullet1);
#endinitclip
Symbol 152 MovieClip [Bullet2] Frame 1
#initclip 119
Object.registerClass("Bullet2", com.novelgames.flashgames.castledefenseAS2.Bullet2);
#endinitclip
Symbol 165 MovieClip [Title] Frame 1
#initclip 120
Object.registerClass("Title", com.novelgames.flashgames.commonAS2.Title);
#endinitclip
Symbol 171 MovieClip [Defaults] Frame 1
#initclip 74
Object.registerClass("Defaults", mx.skins.halo.Defaults);
#endinitclip
Symbol 172 MovieClip [UIObjectExtensions] Frame 1
#initclip 75
Object.registerClass("UIObjectExtensions", mx.core.ext.UIObjectExtensions);
#endinitclip
Symbol 173 MovieClip [UIObject] Frame 1
#initclip 76
Object.registerClass("UIObject", mx.core.UIObject);
#endinitclip
stop();
Symbol 176 Button
on (keyPress "<Tab>") {
this.tabHandler();
}
Symbol 177 MovieClip Frame 1
#initclip 77
Object.registerClass("FocusManager", mx.managers.FocusManager);
if (_root.focusManager == undefined) {
_root.createClassObject(mx.managers.FocusManager, "focusManager", mx.managers.DepthManager.highestDepth--);
}
#endinitclip
Symbol 178 MovieClip [FocusRect] Frame 1
#initclip 78
Object.registerClass("FocusRect", mx.skins.halo.FocusRect);
#endinitclip
Symbol 179 MovieClip [FocusManager] Frame 1
#initclip 79
Object.registerClass("FocusManager", mx.managers.FocusManager);
#endinitclip
stop();
Symbol 180 MovieClip [UIComponentExtensions] Frame 1
#initclip 80
Object.registerClass("UIComponentExtensions", mx.core.ext.UIComponentExtensions);
#endinitclip
Symbol 181 MovieClip [UIComponent] Frame 1
#initclip 81
Object.registerClass("UIComponent", mx.core.UIComponent);
#endinitclip
stop();
Symbol 236 MovieClip [HighScores] Frame 1
#initclip 82
Object.registerClass("HighScores", com.novelgames.flashgames.highscoresAS2.HighScores);
#endinitclip
stop();
Symbol 263 Button
on (release) {
System.security.allowDomain("cdn.gigya.com");
System.security.allowInsecureDomain("cdn.gigya.com");
var mcWF = _root.createEmptyMovieClip("Wildfire", _root.getNextHighestDepth());
mcWF._lockroot = true;
mcWF._x = 15;
mcWF._y = 42;
mcWF.ModuleID = "PostModule1";
var cfg = ((_root[mcWF.ModuleID] = {}));
cfg.width = "400";
cfg.height = "300";
cfg.widgetTitle = "Aces Up Solitaire by Fupa.com";
cfg.advancedTracking = "true";
cfg.partner = "228491";
cfg.UIConfig = "<config><display showEmail=\"true\" showBookmark=\"true\" showCloseButton=\"true\" showDesktop=\"true\" /><body><background background-color=\"#FFFFFF\" corner-roundness=\"4\" /></body></config>";
cfg.defaultContent = _root.embedcode;
cfg.onClose = function (eventObj) {
mcWF._visible = false;
};
mcWF.loadMovie("http://cdn.gigya.com/WildFire/swf/wildfire.swf", "get");
}
Symbol 265 Button
on (release) {
getURL ("http://www.fupa.com/embed/?swf=" + _root.swfname, "_blank");
}
Symbol 267 Button
on (release) {
getURL ("http://www.fupa.com/?swf=" + _root.swfname, "_blank");
}
Symbol 270 Button
on (release) {
getURL ("http://www.fupa.com/", "_blank");
}
Symbol 271 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.3");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local27);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0) {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
}
Symbol 272 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.MainDevelopment] Frame 0
class com.novelgames.flashgames.commonAS2.MainDevelopment extends MovieClip
{
var title, attachMovie, titleDepth, instructions, game, musicGame, getNextHighestDepth, urlPath, highScores, getURL, onEnterFrame, stop;
function MainDevelopment () {
super();
}
static function initialize(movieClip) {
movieClip.__proto__ = com.novelgames.flashgames.commonAS2.MainDevelopment.prototype;
movieClip.onEnterFrame = movieClip.checkTitle;
}
function gotoTitlePage() {
removePage();
title = com.novelgames.flashgames.commonAS2.Title(attachMovie("Title", "title", titleDepth));
}
function gotoInstructionsPage() {
removePage();
instructions = com.novelgames.flashgames.commonAS2.Instructions(attachMovie("Instructions", "instructions", titleDepth));
instructions.initialize();
}
function gotoGamePage() {
removePage();
game = attachMovie("Game", "game", titleDepth);
musicGame = new com.novelgames.flashgames.commonAS2.NewSound(this, "musicGame");
musicGame.start(0, 2147483647);
}
function showInstructionsFromGame() {
game.pause();
game._visible = false;
instructions = com.novelgames.flashgames.commonAS2.Instructions(attachMovie("Instructions", "instructions", getNextHighestDepth()));
instructions.swapDepths(titleDepth);
instructions.initialize(true);
}
function hideInstructionsFromGame() {
instructions.swapDepths(game.getDepth());
instructions.removeMovieClip();
instructions = null;
game._visible = true;
game.unpause();
}
function showHighScores() {
urlPath = _root._url;
trace(urlPath);
if (urlPath.indexOf("www.fupa.com") != -1) {
highScores.showHighScores();
} else {
(getURL("http://www.fupa.com/", "_top"));// not popped
}
}
function showEnterHighScore(score) {
urlPath = _root._url;
if (urlPath.indexOf("www.fupa.com") != -1) {
highScores.showEnterHighScore(score);
}
}
function checkTitle() {
if (!title) {
return(undefined);
}
onEnterFrame = null;
(stop());// not popped
titleDepth = title.getDepth();
}
function removePage() {
if (title) {
title.removeMovieClip();
title = null;
}
if (instructions) {
instructions.removeMovieClip();
instructions = null;
}
if (game) {
game.removeMovieClip();
game = null;
}
if (musicGame) {
musicGame.stop();
musicGame = null;
}
}
}
Symbol 273 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Title] Frame 0
class com.novelgames.flashgames.commonAS2.Title extends MovieClip
{
var startButton, highScoresButton, moreGamesButton, _parent, getURL;
function Title () {
super();
startButton.onRelease = function () {
this._parent.startButtonClicked();
};
highScoresButton.onRelease = function () {
this._parent.highScoresButtonClicked();
};
moreGamesButton.onRelease = function () {
this._parent.moreGamesButtonClicked();
};
}
function startButtonClicked() {
_parent.gotoInstructionsPage();
}
function highScoresButtonClicked() {
_parent.showHighScores();
}
function moreGamesButtonClicked() {
(getURL("http://www.fupa.com/", "_blank"));// not popped
}
}
Symbol 274 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Instructions] Frame 0
class com.novelgames.flashgames.commonAS2.Instructions extends MovieClip
{
var startButton, shownFromGame, _parent;
function Instructions () {
super();
startButton.onRelease = function () {
this._parent.startButtonClicked();
};
}
function initialize(shownFromGame) {
if (shownFromGame == undefined) {
shownFromGame = false;
}
this.shownFromGame = shownFromGame;
}
function startButtonClicked() {
if (!shownFromGame) {
_parent.gotoGamePage();
} else {
_parent.hideInstructionsFromGame();
}
}
}
Symbol 275 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewSound] Frame 0
class com.novelgames.flashgames.commonAS2.NewSound extends Sound
{
var attachSound, start;
function NewSound (target, symbolName) {
super(target);
attachSound(symbolName);
}
function play() {
start();
}
}
Symbol 276 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewMovieClip] Frame 0
class com.novelgames.flashgames.commonAS2.NewMovieClip extends MovieClip
{
var _parent, _x, _y, _rotation, _visible, _alpha, _width, _height, _xscale, _yscale, _xmouse, _ymouse, _totalframes, _currentframe, _name, __mask, useHandCursor, __mouseEnabled, __mouseChildren, __numChildren, getInstanceAtDepth, getNextHighestDepth, onRelease, onRollOver, onRollOut, onPress, onReleaseOutside, onMouseMove, onEnterFrame, getURL, createMovieCount, attachMovie, createEmptyMovieClip;
function NewMovieClip () {
super();
}
function get parent() {
return(_parent);
}
function set x(x) {
_x = x;
//return(this.x);
}
function get x() {
return(_x);
}
function set y(y) {
_y = y;
//return(this.y);
}
function get y() {
return(_y);
}
function set rotation(rotation) {
_rotation = rotation;
//return(this.rotation);
}
function get rotation() {
return(_rotation);
}
function set visible(visible) {
_visible = visible;
//return(this.visible);
}
function get visible() {
return(_visible);
}
function set alpha(alpha) {
_alpha = alpha * 100;
//return(this.alpha);
}
function get alpha() {
return(_alpha / 100);
}
function get width() {
return(_width);
}
function set width(width) {
_width = width;
//return(this.width);
}
function get height() {
return(_height);
}
function set height(height) {
_height = height;
//return(this.height);
}
function set scaleX(scaleX) {
_xscale = scaleX * 100;
//return(this.scaleX);
}
function get scaleX() {
return(_xscale / 100);
}
function set scaleY(scaleY) {
_yscale = scaleY * 100;
//return(this.scaleY);
}
function get scaleY() {
return(_yscale / 100);
}
function set mouseX(mouseX) {
_xmouse = mouseX;
//return(this.mouseX);
}
function get mouseX() {
return(_xmouse);
}
function set mouseY(mouseY) {
_ymouse = mouseY;
//return(this.mouseY);
}
function get mouseY() {
return(_ymouse);
}
function get totalFrames() {
return(_totalframes);
}
function get currentFrame() {
return(_currentframe);
}
function get name() {
return(_name);
}
function set mask(mask) {
__mask = mask;
super.setMask(mask);
//return(this.mask);
}
function get mask() {
return(__mask);
}
function set buttonMode(buttonMode) {
useHandCursor = buttonMode;
//return(this.buttonMode);
}
function get buttonMode() {
return(useHandCursor);
}
function set mouseEnabled(mouseEnabled) {
__mouseEnabled = mouseEnabled;
//return(this.mouseEnabled);
}
function get mouseEnabled() {
return(__mouseEnabled);
}
function set mouseChildren(mouseChildren) {
__mouseChildren = mouseChildren;
//return(this.mouseChildren);
}
function get mouseChildren() {
return(__mouseChildren);
}
function get stage() {
return(com.novelgames.flashgames.commonAS2.NewStage.getNewStage());
}
function set numChildren(numChildren) {
__numChildren = numChildren;
//return(this.numChildren);
}
function get numChildren() {
if (__numChildren == undefined) {
__numChildren = 0;
}
return(__numChildren);
}
function get graphics() {
return(this);
}
function startDrag(lockCenter, bounds) {
if (lockCenter == undefined) {
super.startDrag();
} else if (bounds == undefined) {
super.startDrag(lockCenter);
} else {
super.startDrag(lockCenter, bounds.__get__left(), bounds.__get__top(), bounds.__get__right(), bounds.__get__bottom());
}
}
function lineStyle(thickness, colour, alpha) {
if (alpha == undefined) {
alpha = 1;
}
super.lineStyle(thickness, colour, alpha * 100);
}
function beginFill(colour, alpha) {
if (alpha == undefined) {
alpha = 1;
}
super.beginFill(colour, alpha * 100);
}
function getBounds(target) {
var _local2 = super.getBounds(target);
return(new com.novelgames.flashgames.commonAS2.Rectangle(_local2.xMin, _local2.yMin, _local2.xMax - _local2.xMin, _local2.yMax - _local2.yMin));
}
function localToGlobal(point) {
var _local2 = {x:point.x, y:point.y};
super.localToGlobal(_local2);
return(_local2);
}
function globalToLocal(point) {
var _local2 = {x:point.x, y:point.y};
super.globalToLocal(_local2);
return(_local2);
}
function hitTestPoint(x, y, shapeFlag) {
if (shapeFlag == undefined) {
return(super.hitTest(x, y));
}
return(super.hitTest(x, y, shapeFlag));
}
function hitTestObject(obj) {
return(super.hitTest(obj));
}
function addChild(movieClip) {
if (movieClip.addedToParent) {
return(undefined);
}
if (movieClip._parent != this) {
trace("wrong addChild: " + [this, movieClip]);
}
if (movieClip == null) {
return(undefined);
}
addChildAt(movieClip, numChildren);
}
function addChildAt(movieClip, index) {
if (movieClip.addedToParent) {
return(undefined);
}
if (movieClip._parent != this) {
trace("wrong addChildAt: " + [this, movieClip]);
}
if (movieClip == null) {
return(undefined);
}
movieClip.addedToParent = true;
numChildren = ((numChildren+1));
setChildIndex(movieClip, index);
}
function removeChild(movieClip) {
if (!movieClip.addedToParent) {
return(undefined);
}
removeChildAt(movieClip.getDepth());
}
function removeChildAt(index) {
var _local5 = getInstanceAtDepth(index);
var _local3;
var _local2;
if (!_local5.addedToParent) {
return(undefined);
}
_local5.removeMovieClip();
_local3 = getNextHighestDepth();
_local2 = index + 1;
while (_local2 < _local3) {
getInstanceAtDepth(_local2).swapDepths(_local2 - 1);
_local2++;
}
numChildren = ((numChildren-1));
}
function setChildIndex(child, index) {
var _local3 = child.getDepth();
var _local2;
var _local1;
if (_local3 == index) {
return(undefined);
}
_local2 = ((_local3 < index) ? 1 : -1);
_local1 = _local3;
while (_local1 != index) {
child.swapDepths(_local1 + _local2);
_local1 = _local1 + _local2;
}
}
function getChildIndex(child) {
return(child.getDepth());
}
function getChildAt(index) {
return(com.novelgames.flashgames.commonAS2.NewMovieClip(getInstanceAtDepth(index)));
}
function addEventListener(type, listenerObject, listenerFunctionName) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
onReleaseOutside = onRelease;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE :
onMouseMove = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME :
onEnterFrame = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
}
}
function removeEventListener(type) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = null;
onReleaseOutside = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE :
onMouseMove = null;
break;
case com.novelgames.flashgames.commonAS2.Event.ENTER_FRAME :
onEnterFrame = null;
}
}
function navigateToURL(urlRequest, window) {
getURL(urlRequest.url, window);
}
function createMovie(name) {
var _local4 = getNextHighestDepth();
var _local2;
if (createMovieCount == undefined) {
createMovieCount = 0;
}
if (name) {
_local2 = attachMovie(name, (name + "_") + createMovieCount, _local4);
} else {
_local2 = createEmptyMovieClip((name + "_") + createMovieCount, _local4);
_local2.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
_local2.addedToParent = false;
createMovieCount++;
return(_local2);
}
function createSound(name) {
return(new com.novelgames.flashgames.commonAS2.NewSound(this, name));
}
}
Symbol 277 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewStage] Frame 0
class com.novelgames.flashgames.commonAS2.NewStage
{
var addedListener, onKeyDown, onKeyUp;
function NewStage () {
addedListener = false;
onKeyDown = null;
onKeyUp = null;
}
static function getNewStage() {
if (newStage == null) {
newStage = new com.novelgames.flashgames.commonAS2.NewStage();
}
return(newStage);
}
function get stageWidth() {
return(Stage.width);
}
function get stageHeight() {
return(Stage.height);
}
function set focus(object) {
Selection.setFocus(object);
//return(focus);
}
function get focus() {
return(Selection.getFocus());
}
function addEventListener(type, listenerObject, listenerFunctionName) {
if (!addedListener) {
Key.addListener(this);
addedListener = true;
}
switch (type) {
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN :
onKeyDown = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.KeyboardEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP :
onKeyUp = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.KeyboardEvent(this));
};
}
}
function removeEventListener(type) {
switch (type) {
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_DOWN :
onKeyDown = null;
break;
case com.novelgames.flashgames.commonAS2.KeyboardEvent.KEY_UP :
onKeyUp = null;
}
}
static var newStage = null;
}
Symbol 278 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.KeyboardEvent] Frame 0
class com.novelgames.flashgames.commonAS2.KeyboardEvent
{
function KeyboardEvent () {
}
function get charCode() {
return(Key.getAscii());
}
function get keyCode() {
return(Key.getCode());
}
function updateAfterEvent() {
_global.updateAfterEvent();
}
static var KEY_DOWN = "keyDown";
static var KEY_UP = "keyUp";
}
Symbol 279 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Rectangle] Frame 0
class com.novelgames.flashgames.commonAS2.Rectangle
{
var x, y, width, height;
function Rectangle (x, y, width, height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
function get left() {
return(x);
}
function set left(left) {
x = left;
//return(this.left);
}
function get top() {
return(y);
}
function set top(top) {
y = top;
//return(this.top);
}
function get right() {
return(x + width);
}
function set right(right) {
width = right - x;
//return(this.right);
}
function get bottom() {
return(y + height);
}
function set bottom(bottom) {
height = bottom - y;
//return(this.bottom);
}
function get size() {
return({x:width, y:height});
}
function set size(size) {
width = size.x;
height = size.y;
//return(this.size);
}
function get topLeft() {
return({x:x, y:y});
}
function set topLeft(topLeft) {
x = topLeft.x;
y = topLeft.y;
//return(this.topLeft);
}
function get bottomRight() {
return({x:x + width, y:y + height});
}
function set bottomRight(bottomRight) {
width = x - bottomRight.x;
height = y - bottomRight.y;
//return(this.bottomRight);
}
}
Symbol 280 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.MouseEvent] Frame 0
class com.novelgames.flashgames.commonAS2.MouseEvent
{
var target, currentTarget;
function MouseEvent (target) {
this.target = target;
currentTarget = target;
}
function updateAfterEvent() {
_global.updateAfterEvent();
}
static var CLICK = "click";
static var DOUBLE_CLICK = "doubleClick";
static var MOUSE_DOWN = "mouseDown";
static var MOUSE_MOVE = "mouseMove";
static var MOUSE_OUT = "mouseOut";
static var MOUSE_OVER = "mouseOver";
static var MOUSE_UP = "mouseUp";
static var MOUSE_WHEEL = "mouseWheel";
static var ROLL_OUT = "rollOut";
static var ROLL_OVER = "rollOver";
}
Symbol 281 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Event] Frame 0
class com.novelgames.flashgames.commonAS2.Event
{
function Event () {
}
static var ENTER_FRAME = "enterFrame";
}
Symbol 282 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.URLRequest] Frame 0
class com.novelgames.flashgames.commonAS2.URLRequest
{
var url;
function URLRequest (url) {
this.url = url;
}
}
Symbol 283 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Explosion] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Explosion extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var startTime, totalTime, __get__totalFrames, timer, stop, gotoAndStop, __get__parent;
function Explosion () {
super();
}
function initialize() {
startTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
totalTime = Math.floor((__get__totalFrames() * 1000) / 15);
timer = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onTime");
timer.start();
(stop());// not popped
}
function onTime(timerEvent) {
var _local3 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
var _local2 = (_local3 - startTime) / totalTime;
if (_local2 > 1) {
_local2 = 1;
}
timerEvent.updateAfterEvent();
(gotoAndStop(1 + Math.floor(_local2 * __get__totalFrames())));// not popped
if (_local2 >= 1) {
timer.stop();
__get__parent().removeChild(this);
}
}
}
Symbol 284 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.Timer] Frame 0
interface com.novelgames.flashgames.commonAS2.Timer
{
}
Symbol 285 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewTimer] Frame 0
class com.novelgames.flashgames.commonAS2.NewTimer implements com.novelgames.flashgames.commonAS2.Timer
{
static var pauseTime;
var delay, repeatCount, currentCount, listenerObject, listenerFunctionName, adjustedStartTime, usingDelay, intervalID;
function NewTimer (delay, repeatCount) {
if (repeatCount == undefined) {
repeatCount = 0;
}
this.delay = delay;
this.repeatCount = repeatCount;
currentCount = 0;
}
static function getTimer() {
if (paused) {
return(pauseTime - totalPausedTime);
}
return(getTimer() - totalPausedTime);
}
static function pause() {
if (paused) {
return(undefined);
}
paused = true;
pauseTime = getTimer();
}
static function unpause() {
if (!paused) {
return(undefined);
}
paused = false;
totalPausedTime = totalPausedTime + (getTimer() - pauseTime);
}
function addEventListener(type, listenerObject, listenerFunctionName) {
if (type != com.novelgames.flashgames.commonAS2.TimerEvent.TIMER) {
return(undefined);
}
this.listenerObject = listenerObject;
this.listenerFunctionName = listenerFunctionName;
}
function removeEventListener(type) {
if (type != com.novelgames.flashgames.commonAS2.TimerEvent.TIMER) {
return(undefined);
}
listenerObject = null;
listenerFunctionName = null;
}
function start() {
adjustedStartTime = getTimer();
usingDelay = delay;
clearInterval(intervalID);
intervalID = setInterval(this, "timerEventListener", delay);
}
function stop() {
clearInterval(intervalID);
}
function timerEventListener() {
currentCount++;
if (paused) {
clearInterval(intervalID);
usingDelay = Math.max(delay - (getTimer() - adjustedStartTime), 1);
currentCount--;
intervalID = setInterval(this, "timerEventListener", usingDelay);
return(undefined);
}
if ((getTimer() - adjustedStartTime) >= delay) {
adjustedStartTime = getTimer();
if (usingDelay != delay) {
clearInterval(intervalID);
usingDelay = delay;
intervalID = setInterval(this, "timerEventListener", usingDelay);
}
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.TimerEvent());
if ((repeatCount != 0) && (currentCount >= repeatCount)) {
clearInterval(intervalID);
}
} else {
clearInterval(intervalID);
usingDelay = Math.max(delay - (getTimer() - adjustedStartTime), 1);
currentCount--;
intervalID = setInterval(this, "timerEventListener", usingDelay);
}
}
static var paused = false;
static var totalPausedTime = 0;
}
Symbol 286 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.TimerEvent] Frame 0
class com.novelgames.flashgames.commonAS2.TimerEvent
{
function TimerEvent () {
}
function updateAfterEvent() {
_global.updateAfterEvent();
}
static var TIMER = "timer";
}
Symbol 287 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.ExplosionBullet] Frame 0
class com.novelgames.flashgames.castledefenseAS2.ExplosionBullet extends com.novelgames.flashgames.castledefenseAS2.Explosion
{
function ExplosionBullet () {
super();
}
}
Symbol 288 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.ExplosionEnemy] Frame 0
class com.novelgames.flashgames.castledefenseAS2.ExplosionEnemy extends com.novelgames.flashgames.castledefenseAS2.Explosion
{
function ExplosionEnemy () {
super();
}
}
Symbol 289 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.CannonSet] Frame 0
class com.novelgames.flashgames.castledefenseAS2.CannonSet extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var cannon, background, type, power, frequency, range, price, turnSpeed, bulletSpeed, fireInterval, lastFireTime, __get__y, __get__x, bulletDistance;
function CannonSet () {
super();
cannon.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
background.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
}
function initialize(type) {
this.type = type;
power = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[type][0];
frequency = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[type][1];
range = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[type][2];
price = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[type][3];
turnSpeed = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[type][4];
bulletSpeed = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[type][5];
getBulletDistance();
fireInterval = 1000 / frequency;
lastFireTime = 0;
}
function setDefaultRotation(angle) {
cannon.__set__rotation(angle);
background.__set__rotation(angle);
}
function move(dTime, enemies) {
var _local6;
var _local5;
var _local4;
var _local2;
_local2 = 0;
while (_local2 < enemies.length) {
if (getCanShoot(enemies[_local2])) {
break;
}
_local2++;
}
if (_local2 >= enemies.length) {
return(false);
}
_local6 = (Math.atan2(enemies[_local2].y - __get__y(), enemies[_local2].x - __get__x()) * 180) / Math.PI;
_local5 = (turnSpeed * dTime) / 1000;
_local4 = _local6 - cannon.__get__rotation();
if (_local4 > 180) {
_local4 = _local4 - 360;
} else if (_local4 < -180) {
_local4 = _local4 + 360;
}
if (_local5 <= Math.abs(_local4)) {
_local5 = ((_local4 > 0) ? (_local5) : (-_local5));
cannon.rotation = cannon.rotation + _local5;
return(false);
}
_local5 = _local4;
cannon.rotation = cannon.rotation + _local5;
if ((com.novelgames.flashgames.commonAS2.NewTimer.getTimer() - lastFireTime) >= fireInterval) {
lastFireTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
return(true);
}
return(false);
}
function getBulletDistance() {
var _local3 = com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2;
var _local2 = (range * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE) + (com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2);
bulletDistance = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
}
function getCanShoot(enemy) {
var _local3 = enemy.__get__x() - __get__x();
var _local2 = enemy.__get__y() - __get__y();
return(((_local3 * _local3) + (_local2 * _local2)) <= (bulletDistance * bulletDistance));
}
}
Symbol 290 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Config] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Config
{
function Config () {
}
static var FIELD_X = 0;
static var FIELD_Y = 40;
static var FIELD_DIMENSIONX = 20;
static var FIELD_DIMENSIONY = 12;
static var FIELD_LAYOUT = [" ", " RRRRR ", " R R ", "RRR R RR C ", " R R R R ", " R R R R RRR ", " R R R RRRR R ", " R R R R ", " RRRR R R ", " R RRRRRRR ", " RRRRR "];
static var BLOCK_SIZE = 30;
static var MONEY_INITIAL = 1000;
static var MONEY_PREFIX = "$";
static var CANNON_TYPES = 3;
static var CANNON_INFOS = [[2, 2, 3, 200, 1440, 750], [1, 4, 5, 400, 1080, 1000], [40, 0.5, 2, 600, 720, 500]];
static var CANNON_SELLPRICERATIO = 0.5;
static var ENEMY_TYPES = 3;
static var ENEMY_INFOS = [[20, 100, 360, 10, 50, 50], [10, 500, 720, 5, 100, 100], [100, 50, 180, 50, 150, 200]];
static var CASTLE_LIFE = 100;
static var CASTLE_SHAKETIME = 100;
static var CASTLE_SHAKEAMPLITUDE = 2;
static var CASTLE_LIFESPEED = 20;
static var CASTLE_LIFESTAYTIME = 1000;
static var LEVEL_NO = 10;
static var LEVEL_LIFEINCREASE = 5;
static var LEVEL_INFOS = [[[0, 8]], [[0, 8]], [[1, 3]], [[2, 3]], [[0, 7], [1, 3]], [[1, 5], [0, 10]], [[0, 10], [2, 10], [1, 10]], [[2, 10], [1, 10], [0, 20]], [[1, 10], [0, 10], [2, 20]], [[0, 20], [2, 20], [1, 20]]];
static var DIALOG_SHADECOLOUR = 0;
static var DIALOG_SHADEALPHA = 0.7;
static var BUYDIALOG_HEIGHT = 270;
static var BUYDIALOG_MINWIDTH = 210;
static var BUYDIALOG_CANNONNORMALSIZE = 40;
static var BUYDIALOG_CANNONHIGHLIGHTSIZE = 50;
static var BUYDIALOG_TABSIZE = 70;
static var BUYDIALOG_FOREGROUNDCOLOUR = 13748346;
static var BUYDIALOG_BACKGROUNDCOLOUR = 11576638;
static var BUYDIALOG_BACKGROUNDINSET = 5;
static var BUYDIALOG_BORDERCOLOUR = 13107;
static var BUYDIALOG_BORDERTHICKNESS = 2;
static var BUYDIALOG_CORNERRADIUS = 5;
static var MONEYPOPUP_MOVETIME = 500;
static var MONEYPOPUP_MOVEHEIGHT = 20;
static var MONEYPOPUP_STAYTIME = 200;
static var SCORE_LEVEL = 1000;
static var MESSAGE_LEVELTIME = 1500;
static var MESSAGE_LEVELCLEARTIME = 1000;
static var MESSAGE_ALLCLEARTIME = 2000;
static var MESSAGE_GAMEOVERTIME = 2000;
}
Symbol 291 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Enemy] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Enemy extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var type, life, speed, turnSpeed, damage, money, score, currentX, currentY, moveToX, moveToY, __set__rotation, distanceFromCurrent, __set__x, __set__y, isTurning, x, y, __get__parent, turnTarget, __get__rotation, rotation;
function Enemy () {
super();
}
function initialize(type, enterX, enterY, additionalLife) {
this.type = type;
life = additionalLife + com.novelgames.flashgames.castledefenseAS2.Config.ENEMY_INFOS[type][0];
speed = com.novelgames.flashgames.castledefenseAS2.Config.ENEMY_INFOS[type][1];
turnSpeed = com.novelgames.flashgames.castledefenseAS2.Config.ENEMY_INFOS[type][2];
damage = com.novelgames.flashgames.castledefenseAS2.Config.ENEMY_INFOS[type][3];
money = com.novelgames.flashgames.castledefenseAS2.Config.ENEMY_INFOS[type][4];
score = com.novelgames.flashgames.castledefenseAS2.Config.ENEMY_INFOS[type][5];
currentX = enterX;
currentY = enterY;
moveToX = enterX;
moveToY = enterY;
if (enterX == -1) {
moveToX++;
__set__rotation(0);
} else if (enterX == com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX) {
moveToX--;
__set__rotation(180);
} else if (enterY == -1) {
moveToY++;
__set__rotation(90);
} else {
moveToY--;
__set__rotation(-90);
}
distanceFromCurrent = 0;
__set__x((enterX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE) + (com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2));
__set__y((enterY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE) + (com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2));
isTurning = false;
}
function move(dTime, maxDistance) {
var _local2 = 0;
var _local5;
var _local4;
var _local3 = 0;
if (!isTurning) {
_local2 = (speed * dTime) / 1000;
if (_local2 > maxDistance) {
_local2 = maxDistance;
}
if ((_local2 + distanceFromCurrent) >= com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE) {
_local3 = ((com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE - distanceFromCurrent) * 1000) / speed;
_local2 = com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE - distanceFromCurrent;
}
moveDistance(_local2);
if (_local3 > 0) {
updateDirection();
}
} else {
_local5 = (turnSpeed * dTime) / 1000;
_local4 = turnAngle(_local5);
if (_local4 > 0) {
_local3 = (_local4 * 1000) / turnSpeed;
}
}
if (_local3 > 0) {
move(_local3, maxDistance - _local2);
}
}
function moveDistance(distance) {
x = x + ((moveToX - currentX) * distance);
y = y + ((moveToY - currentY) * distance);
distanceFromCurrent = distanceFromCurrent + distance;
}
function updateDirection() {
var _local3;
var _local2;
__set__x((moveToX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE) + (com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2));
__set__y((moveToY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE) + (com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2));
if (!Object(__get__parent().parent).roads[moveToX][moveToY]) {
currentX = moveToX;
currentY = moveToY;
return(undefined);
}
_local3 = Object(__get__parent().parent).roads[moveToX][moveToY].getNextDirection(currentX, currentY);
if ((currentY - 1) == moveToY) {
_local2 = com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP;
} else if ((currentY + 1) == moveToY) {
_local2 = com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN;
} else if ((currentX - 1) == moveToX) {
_local2 = com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT;
} else {
_local2 = com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT;
}
currentX = moveToX;
currentY = moveToY;
distanceFromCurrent = 0;
switch (_local3) {
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP :
moveToY--;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN :
moveToY++;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT :
moveToX--;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT :
moveToX++;
}
if (_local2 == _local3) {
return(undefined);
}
isTurning = true;
switch (_local3) {
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP :
turnTarget = -90;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN :
turnTarget = 90;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT :
turnTarget = 180;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT :
turnTarget = 0;
}
}
function turnAngle(angle) {
var _local2 = turnTarget - __get__rotation();
var _local4;
if (_local2 > 180) {
_local2 = _local2 - 360;
} else if (_local2 < -180) {
_local2 = _local2 + 360;
}
_local4 = angle - Math.abs(_local2);
if (_local4 <= 0) {
_local4 = 0;
angle = ((_local2 > 0) ? (angle) : (-angle));
} else {
angle = _local2;
isTurning = false;
}
rotation = rotation + angle;
return(_local4);
}
}
Symbol 292 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Road] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Road extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var indexX, indexY, __set__x, __set__y, toUp, toDown, toLeft, toRight, stop, gotoAndStop;
function Road () {
super();
}
function initialize(x, y) {
indexX = x;
indexY = y;
__set__x(x * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__set__y(y * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
toUp = false;
toDown = false;
toLeft = false;
toRight = false;
(stop());// not popped
}
function setDirection(roads) {
var _local2 = "";
if ((indexY > 0) && (roads[indexX][indexY - 1] != null)) {
toUp = true;
_local2 = _local2 + "U";
}
if ((indexX > 0) && (roads[indexX - 1][indexY] != null)) {
toLeft = true;
_local2 = _local2 + "L";
}
if ((indexY < (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY - 1)) && (roads[indexX][indexY + 1] != null)) {
toDown = true;
_local2 = _local2 + "D";
}
if ((indexX < (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX - 1)) && (roads[indexX + 1][indexY] != null)) {
toRight = true;
_local2 = _local2 + "R";
}
if ((_local2 == "U") || (_local2 == "D")) {
toUp = true;
toDown = true;
_local2 = "UD";
} else if ((_local2 == "L") || (_local2 == "R")) {
toLeft = true;
toRight = true;
_local2 = "LR";
}
(gotoAndStop(_local2));// not popped
}
function getNextDirection(fromX, fromY) {
if (toUp && (fromY != (indexY - 1))) {
return(DIRECTION_UP);
}
if (toDown && (fromY != (indexY + 1))) {
return(DIRECTION_DOWN);
}
if (toLeft && (fromX != (indexX - 1))) {
return(DIRECTION_LEFT);
}
if (toRight && (fromX != (indexX + 1))) {
return(DIRECTION_RIGHT);
}
return(DIRECTION_NONE);
}
static var DIRECTION_NONE = 0;
static var DIRECTION_UP = 1;
static var DIRECTION_DOWN = 2;
static var DIRECTION_LEFT = 3;
static var DIRECTION_RIGHT = 4;
}
Symbol 293 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.CannonSet1] Frame 0
class com.novelgames.flashgames.castledefenseAS2.CannonSet1 extends com.novelgames.flashgames.castledefenseAS2.CannonSet
{
function CannonSet1 () {
super();
}
}
Symbol 294 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Enemy0] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Enemy0 extends com.novelgames.flashgames.castledefenseAS2.Enemy
{
function Enemy0 () {
super();
}
}
Symbol 295 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Enemy2] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Enemy2 extends com.novelgames.flashgames.castledefenseAS2.Enemy
{
function Enemy2 () {
super();
}
}
Symbol 296 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Enemy1] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Enemy1 extends com.novelgames.flashgames.castledefenseAS2.Enemy
{
function Enemy1 () {
super();
}
}
Symbol 297 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.CannonSet2] Frame 0
class com.novelgames.flashgames.castledefenseAS2.CannonSet2 extends com.novelgames.flashgames.castledefenseAS2.CannonSet
{
function CannonSet2 () {
super();
}
}
Symbol 298 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.CannonSet0] Frame 0
class com.novelgames.flashgames.castledefenseAS2.CannonSet0 extends com.novelgames.flashgames.castledefenseAS2.CannonSet
{
function CannonSet0 () {
super();
}
}
Symbol 299 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.MessageLevel] Frame 0
class com.novelgames.flashgames.castledefenseAS2.MessageLevel extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var levelText;
function MessageLevel () {
super();
levelText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
}
}
Symbol 300 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewTextField] Frame 0
class com.novelgames.flashgames.commonAS2.NewTextField extends TextField
{
var _x, _y, _rotation, _visible, _alpha, _width, _height, scroll, maxscroll;
function NewTextField () {
super();
}
function set x(x) {
_x = x;
//return(this.x);
}
function get x() {
return(_x);
}
function set y(y) {
_y = y;
//return(this.y);
}
function get y() {
return(_y);
}
function set rotation(rotation) {
_rotation = rotation;
//return(this.rotation);
}
function get rotation() {
return(_rotation);
}
function set visible(visible) {
_visible = visible;
//return(this.visible);
}
function get visible() {
return(_visible);
}
function set alpha(alpha) {
_alpha = alpha * 100;
//return(this.alpha);
}
function get alpha() {
return(_alpha / 100);
}
function get width() {
return(_width);
}
function set width(width) {
_width = width;
//return(this.width);
}
function get height() {
return(_height);
}
function set height(height) {
_height = height;
//return(this.height);
}
function set scrollV(scrollV) {
scroll = scrollV;
//return(this.scrollV);
}
function get scrollV() {
return(scroll);
}
function set maxScrollV(maxScrollV) {
maxscroll = maxScrollV;
//return(this.maxScrollV);
}
function get maxScrollV() {
return(maxscroll);
}
function setTextFormat(textFormat, beginIndex, endIndex) {
if ((beginIndex == undefined) || (endIndex == undefined)) {
super.setTextFormat(textFormat);
} else {
super.setTextFormat(beginIndex, endIndex, textFormat);
}
}
}
Symbol 301 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.MoneyPopup] Frame 0
class com.novelgames.flashgames.castledefenseAS2.MoneyPopup extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var moneyText, __set__x, __set__y, originalY, startTime, timer, __get__parent;
function MoneyPopup () {
super();
moneyText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
}
function initialize(x, y, money) {
__set__x(x);
__set__y(y);
moneyText.text = com.novelgames.flashgames.castledefenseAS2.Config.MONEY_PREFIX + money;
originalY = y;
startTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
timer = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onMoveTime");
timer.start();
}
function onMoveTime(timerEvent) {
var _local3 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
var _local2 = (_local3 - startTime) / com.novelgames.flashgames.castledefenseAS2.Config.MONEYPOPUP_MOVETIME;
if (_local2 > 1) {
_local2 = 1;
}
timerEvent.updateAfterEvent();
__set__y(originalY - (Math.sin(_local2 * Math.PI) * com.novelgames.flashgames.castledefenseAS2.Config.MONEYPOPUP_MOVEHEIGHT));
if (_local2 >= 1) {
timer.stop();
timer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.castledefenseAS2.Config.MONEYPOPUP_STAYTIME, 1);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "stayFinished");
timer.start();
}
}
function stayFinished(timerEvent) {
__get__parent().removeChild(this);
}
}
Symbol 302 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.MessagePlayAgain] Frame 0
class com.novelgames.flashgames.castledefenseAS2.MessagePlayAgain extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var playAgainButton, homeButton;
function MessagePlayAgain () {
super();
playAgainButton.__proto__ = com.novelgames.flashgames.commonAS2.NewButton.prototype;
homeButton.__proto__ = com.novelgames.flashgames.commonAS2.NewButton.prototype;
}
}
Symbol 303 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.NewButton] Frame 0
class com.novelgames.flashgames.commonAS2.NewButton extends Button
{
var _x, _y, _xmouse, _ymouse, _visible, _alpha, _name, onRelease, onRollOver, onRollOut, onPress, onReleaseOutside;
function NewButton () {
super();
}
function set x(x) {
_x = x;
//return(this.x);
}
function get x() {
return(_x);
}
function set y(y) {
_y = y;
//return(this.y);
}
function get y() {
return(_y);
}
function set mouseX(mouseX) {
_xmouse = mouseX;
//return(this.mouseX);
}
function get mouseX() {
return(_xmouse);
}
function set mouseY(mouseY) {
_ymouse = mouseY;
//return(this.mouseY);
}
function get mouseY() {
return(_ymouse);
}
function set visible(visible) {
_visible = visible;
//return(this.visible);
}
function get visible() {
return(_visible);
}
function set alpha(alpha) {
_alpha = alpha * 100;
//return(this.alpha);
}
function get alpha() {
return(_alpha / 100);
}
function get name() {
return(_name);
}
function addEventListener(type, listenerObject, listenerFunctionName) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = function () {
listenerObject[listenerFunctionName](new com.novelgames.flashgames.commonAS2.MouseEvent(this));
};
onReleaseOutside = onRelease;
}
}
function removeEventListener(type) {
switch (type) {
case com.novelgames.flashgames.commonAS2.MouseEvent.CLICK :
onRelease = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OVER :
onRollOver = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.ROLL_OUT :
onRollOut = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN :
onPress = null;
break;
case com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_UP :
onRelease = null;
onReleaseOutside = null;
}
}
}
Symbol 304 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.InstructionsButton] Frame 0
class com.novelgames.flashgames.commonAS2.InstructionsButton extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var onRelease;
function InstructionsButton () {
super();
onRelease = function () {
this._parent._parent.showInstructionsFromGame();
};
}
}
Symbol 305 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.MuteButton] Frame 0
class com.novelgames.flashgames.commonAS2.MuteButton extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var gotoAndStop;
function MuteButton () {
super();
if (new Sound().getVolume() == 0) {
showOff();
} else {
showOn();
}
}
function onPress() {
if (new Sound().getVolume() == 0) {
new Sound().setVolume(100);
showOn();
} else {
new Sound().setVolume(0);
showOff();
}
}
function showOff() {
(gotoAndStop("off"));// not popped
}
function showOn() {
(gotoAndStop("on"));// not popped
}
}
Symbol 306 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.BuyDialog] Frame 0
class com.novelgames.flashgames.castledefenseAS2.BuyDialog extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var cannonsHolder, buyButton, cancelButton, powerText, frequencyText, rangeText, priceText, backgroundHolder, shadeHolder, __set__visible, index, globalToLocal, __get__stage, cannons, __get__parent;
function BuyDialog () {
super();
cannonsHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
buyButton.__proto__ = com.novelgames.flashgames.commonAS2.NewButton.prototype;
cancelButton.__proto__ = com.novelgames.flashgames.commonAS2.NewButton.prototype;
powerText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
frequencyText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
rangeText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
priceText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
backgroundHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
shadeHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
buyButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "buyButtonClicked");
cancelButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "cancelButtonClicked");
__set__visible(false);
}
function show() {
showCannon(0);
__set__visible(true);
}
function hide() {
__set__visible(false);
}
function showCannon(index) {
this.index = index;
drawShade();
drawBackground(index);
createCannons(index);
showNumbers(index);
setButtons(index);
}
function drawShade() {
var _local2 = globalToLocal({x:0, y:0});
var _local3 = globalToLocal({x:__get__stage().__get__stageWidth(), y:__get__stage().__get__stageHeight()});
shadeHolder.__get__graphics().clear();
shadeHolder.__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
shadeHolder.__get__graphics().moveTo(_local2.x, _local2.y);
shadeHolder.__get__graphics().lineTo(_local3.x, _local2.y);
shadeHolder.__get__graphics().lineTo(_local3.x, _local3.y);
shadeHolder.__get__graphics().lineTo(_local2.x, _local3.y);
shadeHolder.__get__graphics().lineTo(_local2.x, _local2.y);
shadeHolder.__get__graphics().endFill();
}
function drawBackground(index) {
var _local10 = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_TYPES * com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_TABSIZE;
var _local4;
var _local3;
var _local7;
var _local8;
var _local2;
var _local5;
var _local6;
if (_local10 < com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_MINWIDTH) {
_local10 = com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_MINWIDTH;
}
_local4 = (-com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_HEIGHT) / 2;
_local3 = (-_local10) / 2;
_local7 = com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_HEIGHT / 2;
_local8 = _local10 / 2;
_local2 = com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_BACKGROUNDINSET;
_local5 = com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_CORNERRADIUS;
_local6 = com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_TABSIZE;
backgroundHolder.__get__graphics().clear();
backgroundHolder.__get__graphics().lineStyle(com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_BORDERTHICKNESS, com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_BORDERCOLOUR);
backgroundHolder.__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_BACKGROUNDCOLOUR);
backgroundHolder.__get__graphics().moveTo((_local3 + _local2) + _local5, _local4 + _local2);
backgroundHolder.__get__graphics().lineTo((_local8 - _local2) - _local5, _local4 + _local2);
backgroundHolder.__get__graphics().curveTo(_local8 - _local2, _local4 + _local2, _local8 - _local2, (_local4 + _local2) + _local5);
backgroundHolder.__get__graphics().lineTo(_local8 - _local2, (_local7 - _local2) - _local5);
backgroundHolder.__get__graphics().curveTo(_local8 - _local2, _local7 - _local2, (_local8 - _local2) - _local5, _local7 - _local2);
backgroundHolder.__get__graphics().lineTo((_local3 + _local2) + _local5, _local7 - _local2);
backgroundHolder.__get__graphics().curveTo(_local3 + _local2, _local7 - _local2, _local3 + _local2, (_local7 - _local2) - _local5);
backgroundHolder.__get__graphics().lineTo(_local3 + _local2, (_local4 + _local2) + _local5);
backgroundHolder.__get__graphics().curveTo(_local3 + _local2, _local4 + _local2, (_local3 + _local2) + _local5, _local4 + _local2);
backgroundHolder.__get__graphics().endFill();
backgroundHolder.__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_FOREGROUNDCOLOUR);
backgroundHolder.__get__graphics().moveTo(_local3 + (index * _local6), _local4 + _local6);
backgroundHolder.__get__graphics().lineTo(_local3 + (index * _local6), _local4 + _local5);
backgroundHolder.__get__graphics().curveTo(_local3 + (index * _local6), _local4, (_local3 + (index * _local6)) + _local5, _local4);
backgroundHolder.__get__graphics().lineTo((_local3 + ((index + 1) * _local6)) - _local5, _local4);
backgroundHolder.__get__graphics().curveTo(_local3 + ((index + 1) * _local6), _local4, _local3 + ((index + 1) * _local6), _local4 + _local5);
backgroundHolder.__get__graphics().lineTo(_local3 + ((index + 1) * _local6), _local4 + _local6);
backgroundHolder.__get__graphics().lineTo(_local8, _local4 + _local6);
backgroundHolder.__get__graphics().lineTo(_local8, _local7 - _local5);
backgroundHolder.__get__graphics().curveTo(_local8, _local7, _local8 - _local5, _local7);
backgroundHolder.__get__graphics().lineTo(_local3 + _local5, _local7);
backgroundHolder.__get__graphics().curveTo(_local3, _local7, _local3, _local7 - _local5);
backgroundHolder.__get__graphics().lineTo(_local3, _local4 + _local6);
backgroundHolder.__get__graphics().lineTo(_local3 + (index * _local6), _local4 + _local6);
backgroundHolder.__get__graphics().endFill();
}
function createCannons(index) {
var _local8 = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_TYPES * com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_TABSIZE;
var _local3;
var _local7;
var _local6;
var _local4;
var _local2;
var _local5;
if (cannons) {
_local2 = 0;
while (_local2 < cannons.length) {
cannonsHolder.removeChild(cannons[_local2]);
_local2++;
}
}
cannons = new Array();
if (_local8 < com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_MINWIDTH) {
_local8 = com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_MINWIDTH;
}
_local2 = 0;
while (_local2 < com.novelgames.flashgames.castledefenseAS2.Config.CANNON_TYPES) {
_local5 = cannonsHolder.createMovie("CannonSet" + _local2);
_local3 = _local5;
_local3.type = _local2;
if (_local2 != index) {
_local4 = com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_CANNONNORMALSIZE;
_local3.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN, this, "cannonClicked");
_local3.__set__buttonMode(true);
} else {
_local4 = com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_CANNONHIGHLIGHTSIZE;
}
_local7 = (((-_local8) / 2) + (_local2 * com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_TABSIZE)) + (com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_TABSIZE / 2);
_local6 = ((-com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_HEIGHT) / 2) + (com.novelgames.flashgames.castledefenseAS2.Config.BUYDIALOG_TABSIZE / 2);
_local3.__set__x(_local7);
_local3.__set__y(_local6);
_local3.__set__width(_local4);
_local3.__set__height(_local4);
cannonsHolder.addChild(_local3);
cannons.push(_local3);
_local2++;
}
}
function showNumbers(index) {
powerText.text = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[index][0].toString();
frequencyText.text = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[index][1].toString();
rangeText.text = com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[index][2].toString();
priceText.text = com.novelgames.flashgames.castledefenseAS2.Config.MONEY_PREFIX + com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[index][3];
}
function setButtons(index) {
buyButton.__set__visible(Object(__get__parent()).money >= com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[index][3]);
}
function cannonClicked(mouseEvent) {
var _local2 = com.novelgames.flashgames.castledefenseAS2.CannonSet(mouseEvent.currentTarget);
showCannon(_local2.type);
}
function buyButtonClicked(mouseEvent) {
hide();
Object(__get__parent()).buyCannon(index);
}
function cancelButtonClicked(mouseEvent) {
hide();
Object(__get__parent()).buyFinished();
}
}
Symbol 307 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.PutDialog] Frame 0
class com.novelgames.flashgames.castledefenseAS2.PutDialog extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var __set__visible, index, cannotPutBlocks, addEventListener, removeEventListener, __get__graphics, __get__stage, cannonSet, removeChild, createMovie, addChild, cross, range, addChildAt, cannonX, __get__mouseX, cannonY, __get__mouseY, __set__buttonMode, __get__parent;
function PutDialog () {
super();
__set__visible(false);
}
function show(index, cannotPutBlocks) {
this.index = index;
this.cannotPutBlocks = cannotPutBlocks;
drawBackground();
createCannonSet();
createCross();
createRange();
addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE, this, "onDragMouseMove");
addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN, this, "onDragMouseDown");
onDragMouseMove();
__set__visible(true);
}
function hide() {
removeEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE);
removeEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN);
__set__visible(false);
}
function drawBackground() {
var _local3;
var _local2;
var _local4;
__get__graphics().clear();
__get__graphics().beginFill(0, 0);
__get__graphics().moveTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), (-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y) + __get__stage().__get__stageHeight());
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, (-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y) + __get__stage().__get__stageHeight());
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().endFill();
if (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y > 0) {
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), 0);
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, 0);
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().endFill();
}
if (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X > 0) {
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, 0);
__get__graphics().lineTo(0, 0);
__get__graphics().lineTo(0, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, 0);
__get__graphics().endFill();
}
if ((com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X + (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE)) < __get__stage().__get__stageWidth()) {
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, 0);
__get__graphics().lineTo(__get__stage().__get__stageWidth() - com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, 0);
__get__graphics().lineTo(__get__stage().__get__stageWidth() - com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, 0);
__get__graphics().endFill();
}
if ((com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y + (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE)) < __get__stage().__get__stageHeight()) {
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), (-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y) + __get__stage().__get__stageHeight());
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, (-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y) + __get__stage().__get__stageHeight());
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().endFill();
}
_local4 = 0;
while (_local4 < cannotPutBlocks.length) {
_local3 = cannotPutBlocks[_local4].x * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE;
_local2 = cannotPutBlocks[_local4].y * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE;
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(_local3, _local2);
__get__graphics().lineTo(_local3 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, _local2);
__get__graphics().lineTo(_local3 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, _local2 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(_local3, _local2 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(_local3, _local2);
__get__graphics().endFill();
_local4++;
}
}
function createCannonSet() {
var _local2;
if (cannonSet) {
removeChild(cannonSet);
}
_local2 = createMovie("CannonSet" + index);
cannonSet = _local2;
cannonSet.initialize(index);
addChild(cannonSet);
}
function createCross() {
var _local2;
if (cross) {
removeChild(cross);
}
_local2 = createMovie("Cross");
cross = _local2;
addChild(cross);
}
function createRange() {
var _local2 = cannonSet.bulletDistance;
var _local3;
if (range) {
removeChild(range);
}
_local3 = createMovie("CannonSetRange");
range = _local3;
range.__set__width(_local2 * 2);
range.__set__height(_local2 * 2);
addChildAt(range, 1);
}
function onDragMouseMove(mouseEvent) {
if (mouseEvent == undefined) {
mouseEvent = null;
}
var _local2;
cannonX = Math.floor(__get__mouseX() / com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
cannonY = Math.floor(__get__mouseY() / com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
if (cannonX < 0) {
cannonX = 0;
} else if (cannonX >= com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX) {
cannonX = com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX - 1;
}
if (cannonY < 0) {
cannonY = 0;
} else if (cannonY >= com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY) {
cannonY = com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY - 1;
}
_local2 = 0;
while (_local2 < cannotPutBlocks.length) {
if ((cannotPutBlocks[_local2].x == cannonX) && (cannotPutBlocks[_local2].y == cannonY)) {
break;
}
_local2++;
}
cannonSet.__set__x((com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2) + (cannonX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE));
cannonSet.__set__y((com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2) + (cannonY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE));
range.__set__x(cannonSet.x);
range.__set__y(cannonSet.y);
if (_local2 < cannotPutBlocks.length) {
cross.__set__x(cannonSet.x);
cross.__set__y(cannonSet.y);
cross.__set__visible(true);
__set__buttonMode(true);
} else {
cross.__set__visible(false);
__set__buttonMode(false);
}
}
function onDragMouseDown(mouseEvent) {
if (cross.__get__visible()) {
return(undefined);
}
hide();
Object(__get__parent()).addCannonSet(cannonX, cannonY, index);
}
}
Symbol 308 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Cross] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Cross extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
function Cross () {
super();
}
}
Symbol 309 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.CannonSetRange] Frame 0
class com.novelgames.flashgames.castledefenseAS2.CannonSetRange extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
function CannonSetRange () {
super();
}
}
Symbol 310 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.SellDialog] Frame 0
class com.novelgames.flashgames.castledefenseAS2.SellDialog extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var sellBubble, __set__visible, cannonSets, addEventListener, removeEventListener, __get__graphics, __get__stage, cannonX, __get__mouseX, cannonY, __get__mouseY, __set__buttonMode, __get__parent;
function SellDialog () {
super();
sellBubble.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
__set__visible(false);
}
function show(cannonSets) {
this.cannonSets = cannonSets;
drawBackground();
addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE, this, "onNormalMove");
addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN, this, "onNormalDown");
onNormalMove();
__set__visible(true);
}
function hide() {
removeEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_MOVE);
removeEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.MOUSE_DOWN);
__set__visible(false);
}
function drawBackground() {
var _local3;
var _local2;
var _local5;
var _local4;
__get__graphics().clear();
__get__graphics().beginFill(0, 0);
__get__graphics().moveTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), (-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y) + __get__stage().__get__stageHeight());
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, (-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y) + __get__stage().__get__stageHeight());
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().endFill();
if (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y > 0) {
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), 0);
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, 0);
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, -com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
__get__graphics().endFill();
}
if (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X > 0) {
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, 0);
__get__graphics().lineTo(0, 0);
__get__graphics().lineTo(0, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, 0);
__get__graphics().endFill();
}
if ((com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X + (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE)) < __get__stage().__get__stageWidth()) {
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, 0);
__get__graphics().lineTo(__get__stage().__get__stageWidth() - com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, 0);
__get__graphics().lineTo(__get__stage().__get__stageWidth() - com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, 0);
__get__graphics().endFill();
}
if ((com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y + (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE)) < __get__stage().__get__stageHeight()) {
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo((-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X) + __get__stage().__get__stageWidth(), (-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y) + __get__stage().__get__stageHeight());
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, (-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y) + __get__stage().__get__stageHeight());
__get__graphics().lineTo(-com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().endFill();
}
_local5 = 0;
while (_local5 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX) {
_local4 = 0;
while (_local4 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY) {
if (cannonSets[_local5][_local4]) {
} else {
_local3 = _local5 * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE;
_local2 = _local4 * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE;
__get__graphics().beginFill(com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADECOLOUR, com.novelgames.flashgames.castledefenseAS2.Config.DIALOG_SHADEALPHA);
__get__graphics().moveTo(_local3, _local2);
__get__graphics().lineTo(_local3 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, _local2);
__get__graphics().lineTo(_local3 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE, _local2 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(_local3, _local2 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
__get__graphics().lineTo(_local3, _local2);
__get__graphics().endFill();
}
_local4++;
}
_local5++;
}
}
function onNormalMove(mouseEvent) {
if (mouseEvent == undefined) {
mouseEvent = null;
}
var _local2;
cannonX = Math.floor(__get__mouseX() / com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
cannonY = Math.floor(__get__mouseY() / com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
_local2 = getCannonSet(cannonX, cannonY);
if (!_local2) {
sellBubble.__set__visible(false);
__set__buttonMode(false);
} else {
sellBubble.__set__x(_local2.x);
sellBubble.__set__y(_local2.y);
sellBubble.moneyText.text = com.novelgames.flashgames.castledefenseAS2.Config.MONEY_PREFIX + (_local2.price * com.novelgames.flashgames.castledefenseAS2.Config.CANNON_SELLPRICERATIO);
sellBubble.__set__visible(true);
__set__buttonMode(true);
}
}
function getCannonSet(x, y) {
if ((x < 0) || (x >= com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX)) {
return(null);
}
if ((y < 0) || (y >= com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY)) {
return(null);
}
return(cannonSets[x][y]);
}
function onNormalDown(mouseEvent) {
if (sellBubble.__get__visible()) {
Object(__get__parent()).sellCannonSet(cannonX, cannonY);
drawBackground();
onNormalMove();
} else {
hide();
Object(__get__parent()).sellFinished();
}
}
}
Symbol 311 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Message] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Message extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var stop, createMovie, messageLevel, addChild, gotoAndStop, messagePlayAgain, removeChild, __get__parent;
function Message () {
super();
(stop());// not popped
}
function showLevel(level) {
var _local2;
hide();
_local2 = createMovie("MessageLevel");
messageLevel = _local2;
messageLevel.levelText.text = level.toString();
addChild(messageLevel);
}
function showLevelClear() {
hide();
(gotoAndStop("levelClear"));// not popped
}
function showGameOver() {
hide();
(gotoAndStop("gameOver"));// not popped
}
function showAllClear() {
hide();
(gotoAndStop("allClear"));// not popped
}
function showPlayAgain() {
var _local2;
hide();
_local2 = createMovie("MessagePlayAgain");
messagePlayAgain = _local2;
messagePlayAgain.playAgainButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "playAgainButtonClicked");
messagePlayAgain.homeButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "homeButtonClicked");
addChild(messagePlayAgain);
}
function hide() {
if (messageLevel) {
removeChild(messageLevel);
messageLevel = null;
}
(gotoAndStop("hide"));// not popped
}
function playAgainButtonClicked(mouseEvent) {
Object(__get__parent().parent).gotoGamePage();
}
function homeButtonClicked(mouseEvent) {
Object(__get__parent().parent).gotoTitlePage();
}
}
Symbol 312 MovieClip [__Packages.com.novelgames.flashgames.commonAS2.CommonGame] Frame 0
class com.novelgames.flashgames.commonAS2.CommonGame extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
function CommonGame () {
super();
}
static function get gameStage() {
return(com.novelgames.flashgames.commonAS2.NewStage.getNewStage());
}
function pause() {
com.novelgames.flashgames.commonAS2.NewTimer.pause();
}
function unpause() {
com.novelgames.flashgames.commonAS2.NewTimer.unpause();
}
}
Symbol 313 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Game] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Game extends com.novelgames.flashgames.commonAS2.CommonGame
{
var message, levelText, scoreText, moneyText, sellDialog, putDialog, buyDialog, sellButton, buyButton, moneysHolder, explosionsHolder, bulletsHolder, cannonSetsHolder, enemiesHolder, roadsHolder, life, soundEnemy, createSound, soundCastle, soundLevelClear, soundAllClear, soundBuySell, soundGameOver, __level, __score, __money, minRoadX, minRoadY, maxRoadX, maxRoadY, roads, castleX, castleY, enterX, enterY, castle, cannonSets, timer, bullets, lastTime, enemies, pause, unpause, __get__parent;
function Game () {
super();
message.__proto__ = com.novelgames.flashgames.castledefenseAS2.Message.prototype;
levelText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
scoreText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
moneyText.__proto__ = com.novelgames.flashgames.commonAS2.NewTextField.prototype;
sellDialog.__proto__ = com.novelgames.flashgames.castledefenseAS2.SellDialog.prototype;
putDialog.__proto__ = com.novelgames.flashgames.castledefenseAS2.PutDialog.prototype;
buyDialog.__proto__ = com.novelgames.flashgames.castledefenseAS2.BuyDialog.prototype;
sellButton.__proto__ = com.novelgames.flashgames.commonAS2.NewButton.prototype;
buyButton.__proto__ = com.novelgames.flashgames.commonAS2.NewButton.prototype;
moneysHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
explosionsHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
bulletsHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
cannonSetsHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
enemiesHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
roadsHolder.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
level = (1);
score = (0);
money = (com.novelgames.flashgames.castledefenseAS2.Config.MONEY_INITIAL);
life = com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_LIFE;
soundEnemy = createSound("SoundEnemy");
soundCastle = createSound("SoundCastle");
soundLevelClear = createSound("SoundLevelClear");
soundAllClear = createSound("SoundAllClear");
soundBuySell = createSound("SoundBuySell");
soundGameOver = createSound("SoundGameOver");
startGame();
}
function set level(level) {
__level = level;
levelText.text = level.toString();
//return(this.level);
}
function get level() {
return(__level);
}
function set score(score) {
__score = score;
scoreText.text = score.toString();
//return(this.score);
}
function get score() {
return(__score);
}
function set money(money) {
__money = money;
moneyText.text = com.novelgames.flashgames.castledefenseAS2.Config.MONEY_PREFIX + money.toString();
//return(this.money);
}
function get money() {
return(__money);
}
function startGame() {
roadsHolder.__set__x(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X);
roadsHolder.__set__y(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
cannonSetsHolder.__set__x(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X);
cannonSetsHolder.__set__y(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
bulletsHolder.__set__x(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X);
bulletsHolder.__set__y(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
enemiesHolder.__set__x(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X);
enemiesHolder.__set__y(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
moneysHolder.__set__x(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X);
moneysHolder.__set__y(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
explosionsHolder.__set__x(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X);
explosionsHolder.__set__y(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
createRoads();
createCastle();
createCannons();
startLevel(1);
}
function createRoads() {
var _local4;
var _local3;
var _local2;
minRoadX = com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX;
minRoadY = com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY;
maxRoadX = -1;
maxRoadY = -1;
roads = new Array();
_local3 = 0;
while (_local3 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX) {
roads[_local3] = new Array();
_local2 = 0;
while (_local2 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY) {
roads[_local3][_local2] = null;
_local2++;
}
_local3++;
}
_local3 = 0;
while (_local3 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_LAYOUT.length) {
_local2 = 0;
while ((_local2 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_LAYOUT[_local3].length) && (_local2 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX)) {
_local4 = com.novelgames.flashgames.castledefenseAS2.Config.FIELD_LAYOUT[_local3].charAt(_local2);
if (_local4 == "R") {
createRoad(_local2, _local3);
if (_local2 < minRoadX) {
minRoadX = _local2;
}
if (_local2 > maxRoadX) {
maxRoadX = _local2;
}
if (_local3 < minRoadY) {
minRoadY = _local3;
}
if (_local3 > maxRoadY) {
maxRoadY = _local3;
}
} else if (_local4 == "C") {
castleX = _local2;
castleY = _local3;
}
_local2++;
}
_local3++;
}
updateRoadDirections();
getEnterXY();
}
function createRoad(x, y) {
var _local3 = roadsHolder.createMovie("Road");
var _local2 = _local3;
_local2.initialize(x, y);
roads[x][y] = _local2;
roadsHolder.addChild(_local2);
}
function updateRoadDirections() {
var _local3;
var _local2;
_local3 = 0;
while (_local3 < roads.length) {
_local2 = 0;
while (_local2 < roads[_local3].length) {
if (!roads[_local3][_local2]) {
} else {
roads[_local3][_local2].setDirection(roads);
}
_local2++;
}
_local3++;
}
}
function getEnterXY() {
var _local2;
_local2 = 0;
while (_local2 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX) {
if (roads[_local2][0] && (roads[_local2][0].toUp)) {
enterX = _local2;
enterY = -1;
return(undefined);
}
if (roads[_local2][com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY - 1] && (roads[_local2][com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY - 1].toDown)) {
enterX = _local2;
enterY = com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY;
return(undefined);
}
_local2++;
}
_local2 = 0;
while (_local2 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY) {
if (roads[0][_local2] && (roads[0][_local2].toLeft)) {
enterX = -1;
enterY = _local2;
return(undefined);
}
if (roads[com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX - 1][_local2] && (roads[com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX - 1][_local2].toRight)) {
enterX = com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX;
enterY = _local2;
return(undefined);
}
_local2++;
}
}
function createCastle() {
var _local2;
_local2 = roadsHolder.createMovie("Castle");
castle = _local2;
castle.__set__x(castleX * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
castle.__set__y(castleY * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE);
roadsHolder.addChild(castle);
}
function createCannons() {
var _local3;
var _local2;
cannonSets = new Array();
_local3 = 0;
while (_local3 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX) {
cannonSets[_local3] = new Array();
_local2 = 0;
while (_local2 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY) {
cannonSets[_local3][_local2] = null;
_local2++;
}
_local3++;
}
}
function startLevel(level) {
this.level = (level);
buyButton.enabled = false;
sellButton.enabled = false;
message.showLevel(level);
timer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.castledefenseAS2.Config.MESSAGE_LEVELTIME, 1);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "showLevelFinished");
timer.start();
}
function showLevelFinished(timerEvent) {
message.hide();
createEnemies();
bullets = new Array();
lastTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
timer = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onPlayTime");
timer.start();
buyButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "showBuyDialog");
buyButton.enabled = true;
sellButton.addEventListener(com.novelgames.flashgames.commonAS2.MouseEvent.CLICK, this, "showSellDialog");
sellButton.enabled = true;
showBuyDialog();
}
function createEnemies() {
var _local8;
var _local2;
var _local5;
var _local7;
var _local4;
var _local3;
var _local6;
_local8 = (level - 1) * com.novelgames.flashgames.castledefenseAS2.Config.LEVEL_LIFEINCREASE;
enemies = new Array();
_local4 = 0;
while (_local4 < com.novelgames.flashgames.castledefenseAS2.Config.LEVEL_INFOS[level - 1].length) {
_local5 = com.novelgames.flashgames.castledefenseAS2.Config.LEVEL_INFOS[level - 1][_local4][0];
_local7 = com.novelgames.flashgames.castledefenseAS2.Config.LEVEL_INFOS[level - 1][_local4][1];
_local3 = 0;
while (_local3 < _local7) {
_local6 = enemiesHolder.createMovie("Enemy" + _local5);
_local2 = _local6;
_local2.initialize(_local5, enterX, enterY, _local8);
enemiesHolder.addChild(_local2);
enemies.push(_local2);
_local3++;
}
_local4++;
}
}
function showBuyDialog(mouseEvent) {
if (mouseEvent == undefined) {
mouseEvent = null;
}
pause();
buyDialog.show();
}
function buyCannon(index) {
var _local2 = getCannotPutCannonBlocks();
money = money - com.novelgames.flashgames.castledefenseAS2.Config.CANNON_INFOS[index][3];
putDialog.__set__x(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X);
putDialog.__set__y(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
putDialog.show(index, _local2);
soundBuySell.play();
}
function getCannotPutCannonBlocks() {
var _local6 = new Array();
var _local3;
var _local2;
_local3 = 0;
while (_local3 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX) {
_local2 = 0;
while (_local2 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY) {
if (getCanPutCannon(_local3, _local2)) {
} else {
_local6.push({x:_local3, y:_local2});
}
_local2++;
}
_local3++;
}
return(_local6);
}
function getCanPutCannon(x, y) {
var _local3;
var _local2;
var _local5;
var _local4;
if (roads[x][y] != null) {
return(false);
}
if (cannonSets[x][y] != null) {
return(false);
}
_local3 = (x * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE) + com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X;
_local2 = (y * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE) + com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y;
_local5 = _local3 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE;
_local4 = _local2 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE;
if (getIntersectsThing(_local3, _local2, _local5, _local4, castle.castle)) {
return(false);
}
if (getIntersectsThing(_local3, _local2, _local5, _local4, buyButton)) {
return(false);
}
if (getIntersectsThing(_local3, _local2, _local5, _local4, sellButton)) {
return(false);
}
return(true);
}
function getIntersectsThing(left, top, right, bottom, thing) {
var _local2 = thing.getBounds(this);
if (left >= _local2.__get__right()) {
return(false);
}
if (right <= _local2.__get__left()) {
return(false);
}
if (top >= _local2.__get__bottom()) {
return(false);
}
if (bottom <= _local2.__get__top()) {
return(false);
}
return(true);
}
function addCannonSet(x, y, type) {
var _local6 = getCannonDirection(x, y);
var _local3 = cannonSetsHolder.createMovie("CannonSet" + type);
var _local2 = _local3;
_local2.__set__x((com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2) + (x * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE));
_local2.__set__y((com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2) + (y * com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE));
_local2.initialize(type);
switch (_local6) {
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP :
_local2.setDefaultRotation(-90);
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN :
_local2.setDefaultRotation(90);
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT :
_local2.setDefaultRotation(180);
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT :
_local2.setDefaultRotation(0);
}
cannonSets[x][y] = _local2;
cannonSetsHolder.addChild(_local2);
showBuyDialog();
}
function getCannonDirection(x, y) {
var _local8 = [com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP, com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN, com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT, com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT];
var _local9 = [[0, -1], [0, 1], [-1, 0], [1, 0]];
var _local6;
var _local7 = Number.MAX_VALUE;
var _local5;
var _local4;
var _local13;
var _local14;
var _local12;
var _local15;
var _local2;
var _local3;
if (x < minRoadX) {
return(com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT);
}
if (x > maxRoadX) {
return(com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT);
}
if (y < minRoadY) {
return(com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN);
}
if (y > maxRoadY) {
return(com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP);
}
_local2 = 0;
while (_local2 < _local8.length) {
_local3 = 1;
while (true) {
_local5 = x + (_local3 * _local9[_local2][0]);
_local4 = y + (_local3 * _local9[_local2][1]);
if ((((_local5 < 0) || (_local5 >= com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX)) || (_local4 < 0)) || (_local4 >= com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY)) {
break;
}
if (roads[_local5][_local4] == null) {
} else {
if (_local3 == _local7) {
_local6.push(_local8[_local2]);
} else if (_local3 < _local7) {
_local6 = [_local8[_local2]];
_local7 = _local3;
}
break;
}
_local3++;
}
_local2++;
}
_local13 = false;
_local14 = false;
_local12 = false;
_local15 = false;
_local2 = 0;
while (_local2 < _local6.length) {
switch (_local6[_local2]) {
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP :
_local12 = true;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN :
_local15 = true;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT :
_local13 = true;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT :
_local14 = true;
}
_local2++;
}
switch (_local6.length) {
case 1 :
return(_local6[0]);
case 2 :
if (_local13 && (_local14)) {
return(((y >= (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY / 2)) ? (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP) : (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN)));
}
if (_local12 && (_local15)) {
return(((x >= (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX / 2)) ? (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT) : (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT)));
}
if (Math.abs(x - (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX / 2)) > Math.abs(y - (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY / 2))) {
return((_local13 ? (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT) : (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT)));
}
return((_local12 ? (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP) : (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN)));
case 3 :
if (!_local13) {
return(com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT);
}
if (!_local14) {
return(com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT);
}
if (!_local12) {
return(com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN);
}
if (_local15) {
break;
}
return(com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP);
}
if (Math.abs(x - (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX / 2)) > Math.abs(y - (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY / 2))) {
return(((x >= (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX / 2)) ? (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT) : (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT)));
}
return(((y >= (com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY / 2)) ? (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP) : (com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN)));
}
function buyFinished() {
unpause();
}
function showSellDialog(mouseEvent) {
pause();
sellDialog.__set__x(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X);
sellDialog.__set__y(com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y);
sellDialog.show(cannonSets);
}
function sellCannonSet(x, y) {
var _local2 = cannonSets[x][y];
money = money + (_local2.price * com.novelgames.flashgames.castledefenseAS2.Config.CANNON_SELLPRICERATIO);
cannonSetsHolder.removeChild(_local2);
cannonSets[x][y] = null;
soundBuySell.play();
}
function sellFinished() {
unpause();
}
function onPlayTime(timerEvent) {
var _local2 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
timerEvent.updateAfterEvent();
moveEnemies(_local2 - lastTime);
moveCannons(_local2 - lastTime);
moveBullets(_local2);
checkHitCastle();
if (!checkGameOver()) {
checkLevelClear();
}
lastTime = _local2;
}
function moveEnemies(dTime) {
var _local3 = Number.POSITIVE_INFINITY;
var _local2;
_local2 = 0;
while (_local2 < enemies.length) {
enemies[_local2].move(dTime, _local3);
if ((_local2 >= 0) && (_local2 < (enemies.length - 1))) {
_local3 = getInterEnemyDistance(enemies[_local2 + 1], enemies[_local2]) - com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE;
if (_local3 < 0) {
_local3 = 0;
}
}
_local2++;
}
}
function getInterEnemyDistance(from, to) {
var _local9 = to.distanceFromCurrent - from.distanceFromCurrent;
var _local5 = from.currentX;
var _local4 = from.currentY;
var _local3 = from.moveToX;
var _local2 = from.moveToY;
var _local7;
var _local6;
while ((_local5 != to.currentX) || (_local4 != to.currentY)) {
_local9 = _local9 + com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE;
_local7 = _local5;
_local6 = _local4;
_local5 = _local3;
_local4 = _local2;
if (!roads[_local3][_local2]) {
break;
}
switch (roads[_local3][_local2].getNextDirection(_local7, _local6)) {
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_UP :
_local2--;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_DOWN :
_local2++;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_LEFT :
_local3--;
break;
case com.novelgames.flashgames.castledefenseAS2.Road.DIRECTION_RIGHT :
_local3++;
}
}
return(_local9);
}
function moveCannons(dTime) {
var _local3;
var _local2;
_local3 = 0;
while (_local3 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONX) {
_local2 = 0;
while (_local2 < com.novelgames.flashgames.castledefenseAS2.Config.FIELD_DIMENSIONY) {
if (!cannonSets[_local3][_local2]) {
} else if (cannonSets[_local3][_local2].move(dTime, enemies)) {
addBullet(_local3, _local2);
}
_local2++;
}
_local3++;
}
}
function addBullet(x, y) {
var _local6 = cannonSets[x][y];
var _local5 = bulletsHolder.createMovie("Bullet" + _local6.type);
var _local4 = _local5;
_local4.initialize(cannonSets[x][y].x, cannonSets[x][y].y, cannonSets[x][y].power, cannonSets[x][y].bulletSpeed, cannonSets[x][y].bulletDistance, cannonSets[x][y].cannon.rotation);
bullets.push(_local4);
bulletsHolder.addChild(_local4);
}
function moveBullets(time) {
var _local5;
var _local4;
var _local3;
var _local2;
_local2 = 0;
while (_local2 < bullets.length) {
_local5 = bullets[_local2].x;
_local4 = bullets[_local2].y;
_local3 = bullets[_local2].move(time);
if (checkHitEnemies(bullets[_local2], _local5, _local4)) {
_local3 = true;
}
if (_local3) {
bulletsHolder.removeChild(bullets[_local2]);
bullets.splice(_local2, 1);
_local2--;
}
_local2++;
}
}
function checkHitEnemies(bullet, oldX, oldY) {
var _local2;
_local2 = 0;
while (_local2 < enemies.length) {
if (checkHitEnemy(bullet, oldX, oldY, enemies[_local2])) {
enemies[_local2].life = enemies[_local2].life - bullet.power;
if (enemies[_local2].life <= 0) {
createExplosionEnemy(enemies[_local2].x, enemies[_local2].y);
createMoneyPopup(enemies[_local2].x, enemies[_local2].y, enemies[_local2].money);
money = money + enemies[_local2].money;
score = score + enemies[_local2].score;
enemiesHolder.removeChild(enemies[_local2]);
enemies.splice(_local2, 1);
soundEnemy.play();
}
return(true);
}
_local2++;
}
return(false);
}
function checkHitEnemy(bullet, oldX, oldY, enemy) {
var _local7 = bullet.__get__x() - oldX;
var _local6 = bullet.__get__y() - oldY;
var _local3 = Math.ceil(Math.max(Math.abs(_local7), Math.abs(_local6)) / (com.novelgames.flashgames.castledefenseAS2.Config.BLOCK_SIZE / 2));
var _local5;
var _local4;
var _local2;
_local2 = 1;
while (_local2 <= _local3) {
_local5 = oldX + ((_local7 * _local2) / _local3);
_local4 = oldY + ((_local6 * _local2) / _local3);
if (enemy.hitTestPoint(_local5 + com.novelgames.flashgames.castledefenseAS2.Config.FIELD_X, _local4 + com.novelgames.flashgames.castledefenseAS2.Config.FIELD_Y, false)) {
createExplosionBullet(_local5, _local4);
return(true);
}
_local2++;
}
return(false);
}
function checkHitCastle() {
if (enemies.length == 0) {
return(undefined);
}
if ((enemies[0].currentX != castleX) || (enemies[0].currentY != castleY)) {
return(undefined);
}
life = life - enemies[0].damage;
if (life < 0) {
life = 0;
}
castle.showDamage(life);
createExplosionEnemy(enemies[0].x, enemies[0].y);
createExplosionCastle();
enemiesHolder.removeChild(enemies[0]);
enemies.splice(0, 1);
soundCastle.play();
}
function createExplosionBullet(x, y) {
var _local3 = explosionsHolder.createMovie("ExplosionBullet");
var _local2 = _local3;
_local2.__set__x(x);
_local2.__set__y(y);
explosionsHolder.addChild(_local2);
_local2.initialize();
}
function createExplosionEnemy(x, y) {
var _local3 = explosionsHolder.createMovie("ExplosionEnemy");
var _local2 = _local3;
_local2.__set__x(x);
_local2.__set__y(y);
explosionsHolder.addChild(_local2);
_local2.initialize();
}
function createExplosionCastle() {
var _local6 = explosionsHolder.createMovie("ExplosionCastle");
var _local5 = _local6;
var _local2;
var _local4;
var _local3;
_local2 = castle.getBounds(roadsHolder);
do {
_local4 = _local2.x + (Math.random() * _local2.width);
_local3 = _local2.y + (Math.random() * _local2.height);
} while (!castle.hitTestPoint(_local4 - roadsHolder.__get__x(), _local3 - roadsHolder.__get__y(), true));
_local5.__set__x(_local4);
_local5.__set__y(_local3);
explosionsHolder.addChild(_local5);
_local5.initialize();
}
function createMoneyPopup(x, y, money) {
var _local3 = moneysHolder.createMovie("MoneyPopup");
var _local2 = _local3;
_local2.initialize(x, y, money);
moneysHolder.addChild(_local2);
}
function checkLevelClear() {
var _local2;
if (enemies.length > 0) {
return(false);
}
score = score + com.novelgames.flashgames.castledefenseAS2.Config.SCORE_LEVEL;
_local2 = 0;
while (_local2 < bullets.length) {
bulletsHolder.removeChild(bullets[_local2]);
_local2++;
}
bullets = new Array();
timer.stop();
buyButton.removeEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER);
buyButton.enabled = false;
sellButton.removeEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER);
buyButton.enabled = false;
if (level < com.novelgames.flashgames.castledefenseAS2.Config.LEVEL_NO) {
message.showLevelClear();
soundLevelClear.play();
timer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.castledefenseAS2.Config.MESSAGE_LEVELCLEARTIME, 1);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "startNextLevel");
timer.start();
} else {
message.showAllClear();
soundAllClear.play();
timer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.castledefenseAS2.Config.MESSAGE_ALLCLEARTIME, 1);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "showPlayAgain");
timer.start();
}
return(true);
}
function startNextLevel(timerEvent) {
startLevel(level + 1);
}
function checkGameOver() {
if (life > 0) {
return(false);
}
timer.stop();
buyButton.removeEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER);
buyButton.enabled = false;
sellButton.removeEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER);
buyButton.enabled = false;
message.showGameOver();
soundGameOver.play();
timer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.castledefenseAS2.Config.MESSAGE_GAMEOVERTIME, 1);
timer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "showPlayAgain");
timer.start();
return(true);
}
function showPlayAgain(timerEvent) {
Object(__get__parent()).showEnterHighScore(score);
message.showPlayAgain();
}
}
Symbol 314 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Castle] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Castle extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var lifeBubble, castle, castleX, castleY, life, targetLife, startShakeTime, shakeTimer, lastLifeTime, lifeTimer;
function Castle () {
super();
lifeBubble.__proto__ = com.novelgames.flashgames.castledefenseAS2.LifeBubble.prototype;
castle.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
castleX = castle.x;
castleY = castle.y;
life = com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_LIFE;
targetLife = life;
lifeBubble.updateBar(1);
lifeBubble.__set__visible(false);
}
function showDamage(targetLife) {
this.targetLife = targetLife;
lifeBubble.__set__visible(true);
startShakeTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
if (shakeTimer) {
shakeTimer.stop();
}
shakeTimer = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
shakeTimer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onShakeTime");
shakeTimer.start();
lastLifeTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
if (lifeTimer) {
lifeTimer.stop();
}
lifeTimer = new com.novelgames.flashgames.commonAS2.NewTimer(1, 0);
lifeTimer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "onLifeTime");
lifeTimer.start();
}
function onShakeTime(timerEvent) {
var _local3 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
var _local2 = (_local3 - startShakeTime) / com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_SHAKETIME;
if (_local2 > 1) {
_local2 = 1;
}
timerEvent.updateAfterEvent();
castle.__set__x(castleX + ((Math.random() < 0.5) ? (-com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_SHAKEAMPLITUDE) : (com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_SHAKEAMPLITUDE)));
castle.__set__y(castleY + ((Math.random() < 0.5) ? (-com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_SHAKEAMPLITUDE) : (com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_SHAKEAMPLITUDE)));
if (_local2 >= 1) {
shakeTimer.stop();
castle.__set__x(castleX);
castle.__set__y(castleY);
}
}
function onLifeTime(timerEvent) {
var _local2 = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
life = life - (((_local2 - lastLifeTime) * com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_LIFESPEED) / 1000);
if (life < targetLife) {
life = targetLife;
}
lifeBubble.updateBar(life / com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_LIFE);
lastLifeTime = _local2;
if (life <= targetLife) {
lifeTimer.stop();
lifeTimer = new com.novelgames.flashgames.commonAS2.NewTimer(com.novelgames.flashgames.castledefenseAS2.Config.CASTLE_LIFESTAYTIME, 1);
lifeTimer.addEventListener(com.novelgames.flashgames.commonAS2.TimerEvent.TIMER, this, "lifeStayFinished");
lifeTimer.start();
}
}
function lifeStayFinished(timerEvent) {
lifeBubble.__set__visible(false);
}
}
Symbol 315 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.LifeBubble] Frame 0
class com.novelgames.flashgames.castledefenseAS2.LifeBubble extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var barMask, maskX;
function LifeBubble () {
super();
barMask.__proto__ = com.novelgames.flashgames.commonAS2.NewMovieClip.prototype;
maskX = barMask.x;
}
function updateBar(ratio) {
barMask.__set__x(maskX + (barMask.__get__width() * ratio));
}
}
Symbol 316 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Bullet] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Bullet extends com.novelgames.flashgames.commonAS2.NewMovieClip
{
var __set__x, __set__y, power, speed, maxDistance, __set__rotation, startX, startY, endX, endY, duration, startTime;
function Bullet () {
super();
}
function initialize(x, y, power, speed, maxDistance, angle) {
__set__x(x);
__set__y(y);
this.power = power;
this.speed = speed;
this.maxDistance = maxDistance;
__set__rotation(angle);
startX = x;
startY = y;
endX = x + (Math.cos((angle * Math.PI) / 180) * maxDistance);
endY = y + (Math.sin((angle * Math.PI) / 180) * maxDistance);
duration = (maxDistance * 1000) / speed;
startTime = com.novelgames.flashgames.commonAS2.NewTimer.getTimer();
}
function move(time) {
var _local2 = (time - startTime) / duration;
if (_local2 > 1) {
_local2 = 1;
}
__set__x((startX * (1 - _local2)) + (endX * _local2));
__set__y((startY * (1 - _local2)) + (endY * _local2));
return(_local2 >= 1);
}
}
Symbol 317 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.ExplosionCastle] Frame 0
class com.novelgames.flashgames.castledefenseAS2.ExplosionCastle extends com.novelgames.flashgames.castledefenseAS2.Explosion
{
function ExplosionCastle () {
super();
}
}
Symbol 318 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Bullet0] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Bullet0 extends com.novelgames.flashgames.castledefenseAS2.Bullet
{
function Bullet0 () {
super();
}
}
Symbol 319 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Bullet1] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Bullet1 extends com.novelgames.flashgames.castledefenseAS2.Bullet
{
function Bullet1 () {
super();
}
}
Symbol 320 MovieClip [__Packages.com.novelgames.flashgames.castledefenseAS2.Bullet2] Frame 0
class com.novelgames.flashgames.castledefenseAS2.Bullet2 extends com.novelgames.flashgames.castledefenseAS2.Bullet
{
function Bullet2 () {
super();
}
}
Symbol 166 MovieClip [__Packages.mx.core.UIObject] Frame 0
class mx.core.UIObject extends MovieClip
{
var _width, _height, _x, _y, _parent, _minHeight, _minWidth, _visible, dispatchEvent, _xscale, _yscale, methodTable, onEnterFrame, tfList, __width, __height, moveTo, lineTo, createTextField, attachMovie, buildDepthTable, findNextAvailableDepth, idNames, childrenCreated, _name, createAccessibilityImplementation, _endInit, validateNow, hasOwnProperty, initProperties, stylecache, className, ignoreClassStyleDeclaration, _tf, fontFamily, fontSize, color, marginLeft, marginRight, fontStyle, fontWeight, textAlign, textIndent, textDecoration, embedFonts, styleName, enabled;
function UIObject () {
super();
constructObject();
}
function get width() {
return(_width);
}
function get height() {
return(_height);
}
function get left() {
return(_x);
}
function get x() {
return(_x);
}
function get top() {
return(_y);
}
function get y() {
return(_y);
}
function get right() {
return(_parent.width - (_x + width));
}
function get bottom() {
return(_parent.height - (_y + height));
}
function getMinHeight(Void) {
return(_minHeight);
}
function setMinHeight(h) {
_minHeight = h;
}
function get minHeight() {
return(getMinHeight());
}
function set minHeight(h) {
setMinHeight(h);
//return(minHeight);
}
function getMinWidth(Void) {
return(_minWidth);
}
function setMinWidth(w) {
_minWidth = w;
}
function get minWidth() {
return(getMinWidth());
}
function set minWidth(w) {
setMinWidth(w);
//return(minWidth);
}
function setVisible(x, noEvent) {
if (x != _visible) {
_visible = x;
if (noEvent != true) {
dispatchEvent({type:(x ? "reveal" : "hide")});
}
}
}
function get visible() {
return(_visible);
}
function set visible(x) {
setVisible(x, false);
//return(visible);
}
function get scaleX() {
return(_xscale);
}
function set scaleX(x) {
_xscale = x;
//return(scaleX);
}
function get scaleY() {
return(_yscale);
}
function set scaleY(y) {
_yscale = y;
//return(scaleY);
}
function doLater(obj, fn) {
if (methodTable == undefined) {
methodTable = new Array();
}
methodTable.push({obj:obj, fn:fn});
onEnterFrame = doLaterDispatcher;
}
function doLaterDispatcher(Void) {
delete onEnterFrame;
if (invalidateFlag) {
redraw();
}
var _local3 = methodTable;
methodTable = new Array();
if (_local3.length > 0) {
var _local2;
while (_local2 = _local3.shift() , _local2 != undefined) {
_local2.obj[_local2.fn]();
}
}
}
function cancelAllDoLaters(Void) {
delete onEnterFrame;
methodTable = new Array();
}
function invalidate(Void) {
invalidateFlag = true;
onEnterFrame = doLaterDispatcher;
}
function invalidateStyle(Void) {
invalidate();
}
function redraw(bAlways) {
if (invalidateFlag || (bAlways)) {
invalidateFlag = false;
var _local2;
for (_local2 in tfList) {
tfList[_local2].draw();
}
draw();
dispatchEvent({type:"draw"});
}
}
function draw(Void) {
}
function move(x, y, noEvent) {
var _local3 = _x;
var _local2 = _y;
_x = x;
_y = y;
if (noEvent != true) {
dispatchEvent({type:"move", oldX:_local3, oldY:_local2});
}
}
function setSize(w, h, noEvent) {
var _local3 = __width;
var _local2 = __height;
__width = w;
__height = h;
size();
if (noEvent != true) {
dispatchEvent({type:"resize", oldWidth:_local3, oldHeight:_local2});
}
}
function size(Void) {
_width = __width;
_height = __height;
}
function drawRect(x1, y1, x2, y2) {
moveTo(x1, y1);
lineTo(x2, y1);
lineTo(x2, y2);
lineTo(x1, y2);
lineTo(x1, y1);
}
function createLabel(name, depth, text) {
createTextField(name, depth, 0, 0, 0, 0);
var _local2 = this[name];
_local2._color = textColorList;
_local2._visible = false;
_local2.__text = text;
if (tfList == undefined) {
tfList = new Object();
}
tfList[name] = _local2;
_local2.invalidateStyle();
invalidate();
_local2.styleName = this;
return(_local2);
}
function createObject(linkageName, id, depth, initobj) {
return(attachMovie(linkageName, id, depth, initobj));
}
function createClassObject(className, id, depth, initobj) {
var _local3 = className.symbolName == undefined;
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className);
}
var _local4 = mx.core.UIObject(createObject(className.symbolOwner.symbolName, id, depth, initobj));
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className.symbolOwner);
}
return(_local4);
}
function createEmptyObject(id, depth) {
return(createClassObject(mx.core.UIObject, id, depth));
}
function destroyObject(id) {
var _local2 = this[id];
if (_local2.getDepth() < 0) {
var _local4 = buildDepthTable();
var _local5 = findNextAvailableDepth(0, _local4, "up");
var _local3 = _local5;
_local2.swapDepths(_local3);
}
_local2.removeMovieClip();
delete this[id];
}
function getSkinIDName(tag) {
return(idNames[tag]);
}
function setSkin(tag, linkageName, initObj) {
if (_global.skinRegistry[linkageName] == undefined) {
mx.skins.SkinElement.registerElement(linkageName, mx.skins.SkinElement);
}
return(createObject(linkageName, getSkinIDName(tag), tag, initObj));
}
function createSkin(tag) {
var _local2 = getSkinIDName(tag);
createEmptyObject(_local2, tag);
return(this[_local2]);
}
function createChildren(Void) {
}
function _createChildren(Void) {
createChildren();
childrenCreated = true;
}
function constructObject(Void) {
if (_name == undefined) {
return(undefined);
}
init();
_createChildren();
createAccessibilityImplementation();
_endInit();
if (validateNow) {
redraw(true);
} else {
invalidate();
}
}
function initFromClipParameters(Void) {
var _local4 = false;
var _local2;
for (_local2 in clipParameters) {
if (hasOwnProperty(_local2)) {
_local4 = true;
this["def_" + _local2] = this[_local2];
delete this[_local2];
}
}
if (_local4) {
for (_local2 in clipParameters) {
var _local3 = this["def_" + _local2];
if (_local3 != undefined) {
this[_local2] = _local3;
}
}
}
}
function init(Void) {
__width = _width;
__height = _height;
if (initProperties == undefined) {
initFromClipParameters();
} else {
initProperties();
}
if (_global.cascadingStyles == true) {
stylecache = new Object();
}
}
function getClassStyleDeclaration(Void) {
var _local4 = this;
var _local3 = className;
while (_local3 != undefined) {
if (ignoreClassStyleDeclaration[_local3] == undefined) {
if (_global.styles[_local3] != undefined) {
return(_global.styles[_local3]);
}
}
_local4 = _local4.__proto__;
_local3 = _local4.className;
}
}
function setColor(color) {
}
function __getTextFormat(tf, bAll) {
var _local8 = stylecache.tf;
if (_local8 != undefined) {
var _local3;
for (_local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
tf[_local3] = _local8[_local3];
}
}
}
return(false);
}
var _local6 = false;
for (var _local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
var _local5 = _tf[_local3];
if (_local5 != undefined) {
tf[_local3] = _local5;
} else if ((_local3 == "font") && (fontFamily != undefined)) {
tf[_local3] = fontFamily;
} else if ((_local3 == "size") && (fontSize != undefined)) {
tf[_local3] = fontSize;
} else if ((_local3 == "color") && (color != undefined)) {
tf[_local3] = color;
} else if ((_local3 == "leftMargin") && (marginLeft != undefined)) {
tf[_local3] = marginLeft;
} else if ((_local3 == "rightMargin") && (marginRight != undefined)) {
tf[_local3] = marginRight;
} else if ((_local3 == "italic") && (fontStyle != undefined)) {
tf[_local3] = fontStyle == _local3;
} else if ((_local3 == "bold") && (fontWeight != undefined)) {
tf[_local3] = fontWeight == _local3;
} else if ((_local3 == "align") && (textAlign != undefined)) {
tf[_local3] = textAlign;
} else if ((_local3 == "indent") && (textIndent != undefined)) {
tf[_local3] = textIndent;
} else if ((_local3 == "underline") && (textDecoration != undefined)) {
tf[_local3] = textDecoration == _local3;
} else if ((_local3 == "embedFonts") && (embedFonts != undefined)) {
tf[_local3] = embedFonts;
} else {
_local6 = true;
}
}
}
}
if (_local6) {
var _local9 = styleName;
if (_local9 != undefined) {
if (typeof(_local9) != "string") {
_local6 = _local9.__getTextFormat(tf, true, this);
} else if (_global.styles[_local9] != undefined) {
_local6 = _global.styles[_local9].__getTextFormat(tf, true, this);
}
}
}
if (_local6) {
var _local10 = getClassStyleDeclaration();
if (_local10 != undefined) {
_local6 = _local10.__getTextFormat(tf, true, this);
}
}
if (_local6) {
if (_global.cascadingStyles) {
if (_parent != undefined) {
_local6 = _parent.__getTextFormat(tf, false);
}
}
}
if (_local6) {
_local6 = _global.style.__getTextFormat(tf, true, this);
}
return(_local6);
}
function _getTextFormat(Void) {
var _local2 = stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
__getTextFormat(_local2, true);
stylecache.tf = _local2;
if (enabled == false) {
var _local3 = getStyle("disabledColor");
_local2.color = _local3;
}
return(_local2);
}
function getStyleName(Void) {
var _local2 = styleName;
if (_local2 != undefined) {
if (typeof(_local2) != "string") {
return(_local2.getStyleName());
}
return(_local2);
}
if (_parent != undefined) {
return(_parent.getStyleName());
}
return(undefined);
}
function getStyle(styleProp) {
var _local3;
_global.getStyleCounter++;
if (this[styleProp] != undefined) {
return(this[styleProp]);
}
var _local6 = styleName;
if (_local6 != undefined) {
if (typeof(_local6) != "string") {
_local3 = _local6.getStyle(styleProp);
} else {
var _local7 = _global.styles[_local6];
_local3 = _local7.getStyle(styleProp);
}
}
if (_local3 != undefined) {
return(_local3);
}
var _local7 = getClassStyleDeclaration();
if (_local7 != undefined) {
_local3 = _local7[styleProp];
}
if (_local3 != undefined) {
return(_local3);
}
if (_global.cascadingStyles) {
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (mx.styles.StyleManager.isColorStyle(styleProp))) {
var _local5 = stylecache;
if (_local5 != undefined) {
if (_local5[styleProp] != undefined) {
return(_local5[styleProp]);
}
}
if (_parent != undefined) {
_local3 = _parent.getStyle(styleProp);
} else {
_local3 = _global.style[styleProp];
}
if (_local5 != undefined) {
_local5[styleProp] = _local3;
}
return(_local3);
}
}
if (_local3 == undefined) {
_local3 = _global.style[styleProp];
}
return(_local3);
}
static function mergeClipParameters(o, p) {
for (var _local3 in p) {
o[_local3] = p[_local3];
}
return(true);
}
static var symbolName = "UIObject";
static var symbolOwner = mx.core.UIObject;
static var version = "2.0.2.127";
static var textColorList = {color:1, disabledColor:1};
var invalidateFlag = false;
var lineWidth = 1;
var lineColor = 0;
var tabEnabled = false;
var clipParameters = {visible:1, minHeight:1, minWidth:1, maxHeight:1, maxWidth:1, preferredHeight:1, preferredWidth:1};
}
Symbol 167 MovieClip [__Packages.mx.core.UIComponent] Frame 0
class mx.core.UIComponent extends mx.core.UIObject
{
var __width, __height, invalidate, stylecache, removeEventListener, dispatchEvent, drawFocus, addEventListener, _xscale, _yscale, _focusrect, watch, enabled;
function UIComponent () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function setVisible(x, noEvent) {
super.setVisible(x, noEvent);
}
function enabledChanged(id, oldValue, newValue) {
setEnabled(newValue);
invalidate();
delete stylecache.tf;
return(newValue);
}
function setEnabled(enabled) {
invalidate();
}
function getFocus() {
var selFocus = Selection.getFocus();
return(((selFocus === null) ? null : (eval (selFocus))));
}
function setFocus() {
Selection.setFocus(this);
}
function getFocusManager() {
var _local2 = this;
while (_local2 != undefined) {
if (_local2.focusManager != undefined) {
return(_local2.focusManager);
}
_local2 = _local2._parent;
}
return(undefined);
}
function onKillFocus(newFocus) {
removeEventListener("keyDown", this);
removeEventListener("keyUp", this);
dispatchEvent({type:"focusOut"});
drawFocus(false);
}
function onSetFocus(oldFocus) {
addEventListener("keyDown", this);
addEventListener("keyUp", this);
dispatchEvent({type:"focusIn"});
if (getFocusManager().bDrawFocus != false) {
drawFocus(true);
}
}
function findFocusInChildren(o) {
if (o.focusTextField != undefined) {
return(o.focusTextField);
}
if (o.tabEnabled == true) {
return(o);
}
return(undefined);
}
function findFocusFromObject(o) {
if (o.tabEnabled != true) {
if (o._parent == undefined) {
return(undefined);
}
if (o._parent.tabEnabled == true) {
o = o._parent;
} else if (o._parent.tabChildren) {
o = findFocusInChildren(o._parent);
} else {
o = findFocusFromObject(o._parent);
}
}
return(o);
}
function pressFocus() {
var _local3 = findFocusFromObject(this);
var _local2 = getFocus();
if (_local3 != _local2) {
_local2.drawFocus(false);
if (getFocusManager().bDrawFocus != false) {
_local3.drawFocus(true);
}
}
}
function releaseFocus() {
var _local2 = findFocusFromObject(this);
if (_local2 != getFocus()) {
_local2.setFocus();
}
}
function isParent(o) {
while (o != undefined) {
if (o == this) {
return(true);
}
o = o._parent;
}
return(false);
}
function size() {
}
function init() {
super.init();
_xscale = 100;
_yscale = 100;
_focusrect = _global.useFocusRect == false;
watch("enabled", enabledChanged);
if (enabled == false) {
setEnabled(false);
}
}
function dispatchValueChangedEvent(value) {
dispatchEvent({type:"valueChanged", value:value});
}
static var symbolName = "UIComponent";
static var symbolOwner = mx.core.UIComponent;
static var version = "2.0.2.127";
static var kStretch = 5000;
var focusEnabled = true;
var tabEnabled = true;
var origBorderStyles = {themeColor:16711680};
var clipParameters = {};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.core.UIComponent.prototype.clipParameters, mx.core.UIObject.prototype.clipParameters);
}
Symbol 168 MovieClip [__Packages.com.novelgames.flashgames.highscoresAS2.HighScores] Frame 0
class com.novelgames.flashgames.highscoresAS2.HighScores extends mx.core.UIComponent
{
var loadingHighScores, showLoadingMessage, shouldEnterPlayerName, records, _visible, __loadScoresAtStart, finishedLoadingScoresAction, page, createObject, __get__width, __get__height, invalidate, __gameID, __loadScoresURL, __saveScoreURL, __dialogColour, __dialogAlpha, __dialogBorderThickness, __dialogBorderColour, __dialogBorderAlpha, __backgroundColour, __backgroundAlpha, __maxNoOfScores, __hashKey, __nameSWFVariable, __highScoresHighlightColour, score, destroyObject, playerName, scoreRange, globalToLocal, scrollDirection, scrollStartTime, scrollStartY, scrollIntervalID, highScoresHighlightIndex;
function HighScores () {
super();
}
function init() {
super.init();
loadingHighScores = false;
showLoadingMessage = false;
shouldEnterPlayerName = true;
records = null;
_visible = false;
if (__loadScoresAtStart) {
finishedLoadingScoresAction = hide;
loadScores();
}
}
function createChildren() {
page = createObject("highScoresTextPage", "page", 0);
page.highScoresModuleText._x = __get__width() / 2;
page.highScoresModuleText._y = __get__height() / 2;
size();
}
function draw() {
super.draw();
page.highScoresModuleText._x = __get__width() / 2;
page.highScoresModuleText._y = __get__height() / 2;
drawBackground();
}
function size() {
super.size();
invalidate();
}
function set gameID(id) {
__gameID = Number(id);
//return(gameID);
}
function get gameID() {
return(__gameID);
}
function set loadScoresURL(url) {
__loadScoresURL = url;
//return(loadScoresURL);
}
function get loadScoresURL() {
return(__loadScoresURL);
}
function set saveScoreURL(url) {
__saveScoreURL = url;
//return(saveScoreURL);
}
function get saveScoreURL() {
return(__saveScoreURL);
}
function set loadScoresAtStart(load) {
__loadScoresAtStart = load;
//return(loadScoresAtStart);
}
function get loadScoresAtStart() {
return(__loadScoresAtStart);
}
function set dialogColour(colour) {
__dialogColour = colour;
//return(dialogColour);
}
function get dialogColour() {
return(__dialogColour);
}
function set dialogAlpha(alpha) {
__dialogAlpha = alpha;
//return(dialogAlpha);
}
function get dialogAlpha() {
return(__dialogAlpha);
}
function set dialogBorderThickness(thickness) {
__dialogBorderThickness = thickness;
//return(dialogBorderThickness);
}
function get dialogBorderThickness() {
return(__dialogBorderThickness);
}
function set dialogBorderColour(colour) {
__dialogBorderColour = colour;
//return(dialogBorderColour);
}
function get dialogBorderColour() {
return(__dialogBorderColour);
}
function set dialogBorderAlpha(alpha) {
__dialogBorderAlpha = alpha;
//return(dialogBorderAlpha);
}
function get dialogBorderAlpha() {
return(__dialogBorderAlpha);
}
function set backgroundColour(colour) {
__backgroundColour = Number(colour);
//return(backgroundColour);
}
function get backgroundColour() {
return(__backgroundColour);
}
function set backgroundAlpha(alpha) {
__backgroundAlpha = Number(alpha);
//return(backgroundAlpha);
}
function get backgroundAlpha() {
return(__backgroundAlpha);
}
function set maxNoOfScores(no) {
__maxNoOfScores = Number(no);
//return(maxNoOfScores);
}
function get maxNoOfScores() {
return(__maxNoOfScores);
}
function set hashKey(hashKey) {
__hashKey = hashKey;
//return(this.hashKey);
}
function get hashKey() {
return(__hashKey);
}
function set nameSWFVariable(nameSWFVariable) {
__nameSWFVariable = nameSWFVariable;
//return(this.nameSWFVariable);
}
function get nameSWFVariable() {
return(__nameSWFVariable);
}
function set highScoresHighlightColour(colour) {
__highScoresHighlightColour = colour;
//return(highScoresHighlightColour);
}
function get highScoresHighlightColour() {
return(__highScoresHighlightColour);
}
function showHighScores() {
showLoadingMessage = true;
finishedLoadingScoresAction = showHighScores;
showHighScoresTable(-1);
}
function showEnterHighScore(score) {
var _local4;
var _local3;
this.score = score;
if (page) {
destroyObject("page");
}
page = createObject("highScoresEnterPage", "page", 0);
page.scoreText.text = score.toString();
page.nameText.text = ((playerName != undefined) ? (playerName) : "");
drawBackground();
_local4 = (((((((page.yourScoreText._height + com.novelgames.flashgames.highscoresAS2.Config.ENTER_LABELFIELDSPACING) + page.scoreText._height) + com.novelgames.flashgames.highscoresAS2.Config.ENTER_SECTIONSPACING) + page.enterText._height) + com.novelgames.flashgames.highscoresAS2.Config.ENTER_LABELFIELDSPACING) + page.nameText._height) + com.novelgames.flashgames.highscoresAS2.Config.ENTER_SECTIONSPACING) + page.okButton._height;
_local3 = (__get__height() - _local4) / 2;
page.yourScoreText._x = __get__width() / 2;
page.yourScoreText._y = _local3 + (page.yourScoreText._height / 2);
_local3 = _local3 + (page.yourScoreText._height + com.novelgames.flashgames.highscoresAS2.Config.ENTER_LABELFIELDSPACING);
page.scoreText.autoSize = "center";
page.scoreText._x = (__get__width() - page.scoreText._width) / 2;
page.scoreText._y = _local3;
_local3 = _local3 + (page.scoreText._height + com.novelgames.flashgames.highscoresAS2.Config.ENTER_SECTIONSPACING);
page.enterText._x = __get__width() / 2;
page.enterText._y = _local3 + (page.enterText._height / 2);
_local3 = _local3 + (page.enterText._height + com.novelgames.flashgames.highscoresAS2.Config.ENTER_LABELFIELDSPACING);
page.nameText._width = __get__width() - (com.novelgames.flashgames.highscoresAS2.Config.ENTER_NAMEFIELDORDER * 2);
page.nameText._x = (__get__width() - page.nameText._width) / 2;
page.nameText._y = _local3;
_local3 = _local3 + (page.nameText._height + com.novelgames.flashgames.highscoresAS2.Config.ENTER_SECTIONSPACING);
page.okButton._x = (__get__width() - com.novelgames.flashgames.highscoresAS2.Config.ENTER_BUTTONSSPACING) / 2;
page.okButton._y = _local3 + (page.okButton._height / 2);
page.cancelButton._x = (__get__width() + com.novelgames.flashgames.highscoresAS2.Config.ENTER_BUTTONSSPACING) / 2;
page.cancelButton._y = _local3 + (page.cancelButton._height / 2);
page.okButton.onRelease = function () {
this._parent._parent.finishedEnterName();
};
page.cancelButton.onRelease = function () {
this._parent._parent.hide();
};
_visible = true;
if (__nameSWFVariable != "") {
shouldEnterPlayerName = false;
playerName = _root[__nameSWFVariable];
if (playerName == null) {
playerName = "";
}
}
if (!shouldEnterPlayerName) {
saveScore();
}
}
function hide() {
showLoadingMessage = false;
if (page) {
destroyObject("page");
}
page = null;
_visible = false;
}
function loadScores() {
var highScores = this;
var _local2 = new XML();
loadingHighScores = true;
_local2.ignoreWhite = true;
_local2.onLoad = function (success) {
highScores.finishedLoadingScores(this.firstChild, success);
};
_local2.load((__loadScoresURL + ((__loadScoresURL.indexOf("?") == -1) ? "?id=" : "&id=")) + __gameID);
if (showLoadingMessage) {
showLoadingHighScores();
}
}
function setPlayerName(playerName) {
this.playerName = playerName;
shouldEnterPlayerName = false;
}
function showHighScoresTable(highlightIndex) {
if (loadingHighScores) {
showLoadingHighScores();
return(undefined);
}
if (records == null) {
loadScores();
return(undefined);
}
if (page) {
destroyObject("page");
}
page = createObject("highScoresTablePage", "page", 0);
drawBackground();
setTitleText();
drawRecords(highlightIndex);
setArrowButtons();
page.okButton._x = __get__width() / 2;
page.okButton._y = __get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_BUTTONFROMBOTTOM;
page.okButton.onRelease = function () {
this._parent._parent.hide();
};
_visible = true;
}
function finishedLoadingScores(rootNode, success) {
var _local2;
loadingHighScores = false;
showLoadingMessage = false;
if (!success) {
if (showLoadingMessage) {
showLoadHighScoresFailed();
}
return(undefined);
}
parseScoreRange(rootNode.attributes.scoreRange);
records = new Array();
_local2 = rootNode.firstChild;
while (_local2) {
if (_local2.nodeName != "RECORD") {
} else {
records.push(new com.novelgames.flashgames.highscoresAS2.Record(_local2.attributes.name, Number(_local2.attributes.score)));
if (records.length >= __maxNoOfScores) {
break;
}
}
_local2 = _local2.nextSibling;
}
finishedLoadingScoresAction();
}
function showLoadingHighScores() {
if (page) {
destroyObject("page");
}
page = createObject("highScoresLoadingPage", "page", 0);
drawBackground();
page.loadingHighScoresText._x = __get__width() / 2;
page.loadingHighScoresText._y = __get__height() / 2;
_visible = true;
}
function showLoadHighScoresFailed() {
if (page) {
destroyObject("page");
}
page = createObject("highScoresLoadFailedPage", "page", 0);
drawBackground();
page.loadHighScoresFailedText._x = __get__width() / 2;
page.loadHighScoresFailedText._y = (__get__height() / 2) - (com.novelgames.flashgames.highscoresAS2.Config.FAILED_TEXTBUTTONSPACING / 2);
page.okButton._x = __get__width() / 2;
page.okButton._y = (__get__height() / 2) + (com.novelgames.flashgames.highscoresAS2.Config.FAILED_TEXTBUTTONSPACING / 2);
page.okButton.onRelease = function () {
this._parent._parent.hide();
};
_visible = true;
}
function showSavingScore() {
if (page) {
destroyObject("page");
}
page = createObject("highScoresSavingPage", "page", 0);
drawBackground();
page.savingScoreText._x = __get__width() / 2;
page.savingScoreText._y = __get__height() / 2;
_visible = true;
}
function showSaveScoreFailed() {
if (page) {
destroyObject("page");
}
page = createObject("highScoresSaveFailedPage", "page", 0);
drawBackground();
page.saveScoreFailedText._x = __get__width() / 2;
page.saveScoreFailedText._y = (__get__height() / 2) - (com.novelgames.flashgames.highscoresAS2.Config.FAILED_TEXTBUTTONSPACING / 2);
page.okButton._x = __get__width() / 2;
page.okButton._y = (__get__height() / 2) + (com.novelgames.flashgames.highscoresAS2.Config.FAILED_TEXTBUTTONSPACING / 2);
page.okButton.onRelease = function () {
this._parent._parent.hide();
};
_visible = true;
}
function parseScoreRange(rangeText) {
switch (rangeText) {
case "eternity" :
scoreRange = SCORERANGE_ETERNITY;
break;
case "pastDay" :
scoreRange = SCORERANGE_PASTDAY;
break;
case "pastWeek" :
scoreRange = SCORERANGE_PASTWEEK;
break;
case "pastMonth" :
scoreRange = SCORERANGE_PASTMONTH;
break;
case "pastYear" :
scoreRange = SCORERANGE_PASTYEAR;
break;
case "thisDay" :
scoreRange = SCORERANGE_THISDAY;
break;
case "thisWeek" :
scoreRange = SCORERANGE_THISWEEK;
break;
case "thisMonth" :
scoreRange = SCORERANGE_THISMONTH;
break;
case "thisYear" :
scoreRange = SCORERANGE_THISYEAR;
}
}
function drawBackground() {
var _local2 = {x:0, y:0};
var _local3 = {x:Stage.width, y:Stage.height};
globalToLocal(_local2);
globalToLocal(_local3);
page.backgroundHolder.clear();
page.backgroundHolder.beginFill(__backgroundColour, __backgroundAlpha * 100);
page.backgroundHolder.moveTo(_local2.x, _local2.y);
page.backgroundHolder.lineTo(_local3.x, _local2.y);
page.backgroundHolder.lineTo(_local3.x, _local3.y);
page.backgroundHolder.lineTo(_local2.x, _local3.y);
page.backgroundHolder.lineTo(_local2.x, _local2.y);
page.backgroundHolder.endFill();
page.backgroundHolder.lineStyle(__dialogBorderThickness, __dialogBorderColour, __dialogBorderAlpha * 100);
page.backgroundHolder.beginFill(__dialogColour, __dialogAlpha * 100);
page.backgroundHolder.moveTo(0, 0);
page.backgroundHolder.lineTo(__get__width(), 0);
page.backgroundHolder.lineTo(__get__width(), __get__height());
page.backgroundHolder.lineTo(0, __get__height());
page.backgroundHolder.lineTo(0, 0);
page.backgroundHolder.endFill();
page.backgroundHolder.onPress = function () {
};
page.backgroundHolder.useHandCursor = false;
}
function setTitleText() {
switch (scoreRange) {
case SCORERANGE_ETERNITY :
page.titleText.gotoAndStop("eternity");
break;
case SCORERANGE_PASTDAY :
page.titleText.gotoAndStop("pastDay");
break;
case SCORERANGE_PASTWEEK :
page.titleText.gotoAndStop("pastWeek");
break;
case SCORERANGE_PASTMONTH :
page.titleText.gotoAndStop("pastMonth");
break;
case SCORERANGE_PASTYEAR :
page.titleText.gotoAndStop("pastYear");
break;
case SCORERANGE_THISDAY :
page.titleText.gotoAndStop("thisDay");
break;
case SCORERANGE_THISWEEK :
page.titleText.gotoAndStop("thisWeek");
break;
case SCORERANGE_THISMONTH :
page.titleText.gotoAndStop("thisMonth");
break;
case SCORERANGE_THISYEAR :
page.titleText.gotoAndStop("thisYear");
}
page.titleText._x = __get__width() / 2;
page.titleText._y = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_TITLEY;
}
function drawRecords(highlightIndex) {
var _local5 = new Array();
var _local6 = new Array();
var _local4 = new Array();
var _local7 = 0;
var _local10 = 0;
var _local8;
var _local9;
var _local3;
var _local2;
_local2 = 0;
while (_local2 < __maxNoOfScores) {
if (_local2 < records.length) {
_local8 = records[_local2].name;
_local9 = records[_local2].score;
} else {
_local8 = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_NONEDISPLAY;
_local9 = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_NONEDISPLAY;
}
_local3 = page.ranksHolder.seedText.duplicateMovieClip("textText" + _local2, _local2);
_local3.textText.autoSize = "left";
_local3.textText.text = _local2 + 1;
if (_local3._width > _local7) {
_local7 = _local3._width;
}
_local5.push(_local3);
_local3 = page.namesHolder.seedText.duplicateMovieClip("textText" + _local2, _local2);
_local3.textText.autoSize = "left";
_local3.textText.text = _local8;
_local6.push(_local3);
_local3 = page.scoresHolder.seedText.duplicateMovieClip("textText" + _local2, _local2);
_local3.textText.autoSize = "left";
_local3.textText.text = _local9;
if (_local3._width > _local10) {
_local10 = _local3._width;
}
_local4.push(_local3);
_local2++;
}
_local2 = 0;
while (_local2 < __maxNoOfScores) {
_local5[_local2]._x = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMLEFT;
_local5[_local2]._y = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP + (_local2 * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING);
_local6[_local2]._x = (com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMLEFT + _local7) + com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_COLUMNSPACING;
_local6[_local2]._y = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP + (_local2 * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING);
_local4[_local2]._x = (__get__width() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMRIGHT) - _local4[_local2]._width;
_local4[_local2]._y = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP + (_local2 * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING);
_local2++;
}
page.ranksMask._x = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMLEFT;
page.ranksMask._y = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP;
page.ranksMask._width = (((__get__width() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMRIGHT) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMLEFT) - _local10) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_COLUMNSPACING;
page.ranksMask._height = (__get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMBOTTOM) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP;
page.namesMask._x = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMLEFT;
page.namesMask._y = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP;
page.namesMask._width = (((__get__width() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMRIGHT) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMLEFT) - _local10) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_COLUMNSPACING;
page.namesMask._height = (__get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMBOTTOM) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP;
page.scoresMask._x = (__get__width() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMRIGHT) - _local10;
page.scoresMask._y = com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP;
page.scoresMask._width = _local10;
page.scoresMask._height = (__get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMBOTTOM) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP;
page.ranksHolder.setMask(page.ranksMask);
page.namesHolder.setMask(page.namesMask);
page.scoresHolder.setMask(page.scoresMask);
if (highlightIndex != -1) {
if (highlightIndex < _local5.length) {
_local5[highlightIndex].textText.textColor = __highScoresHighlightColour;
_local6[highlightIndex].textText.textColor = __highScoresHighlightColour;
_local4[highlightIndex].textText.textColor = __highScoresHighlightColour;
}
scrollToIndex(highlightIndex);
}
}
function setArrowButtons() {
if (page.ranksHolder._height > page.namesMask._height) {
page.upArrowButton._x = __get__width() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_UPARROW_FROMRIGHT;
page.upArrowButton._y = __get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_UPARROW_FROMBOTTOM;
page.downArrowButton._x = __get__width() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_DOWNARROW_FROMRIGHT;
page.downArrowButton._y = __get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_DOWNARROW_FROMBOTTOM;
page.upArrowButton.onPress = function () {
this._parent._parent.startScroll(com.novelgames.flashgames.highscoresAS2.HighScores.SCROLL_UP);
};
page.downArrowButton.onPress = function () {
this._parent._parent.startScroll(com.novelgames.flashgames.highscoresAS2.HighScores.SCROLL_DOWN);
};
page.upArrowButton.onRelease = function () {
this._parent._parent.stopScroll();
};
page.upArrowButton.onReleaseOutside = page.upArrowButton.onRelease;
page.downArrowButton.onRelease = page.upArrowButton.onRelease;
page.downArrowButton.onReleaseOutside = page.upArrowButton.onRelease;
if (page.ranksHolder.y >= 0) {
page.upArrowButton._visible = false;
}
if (((page.ranksHolder.y + com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP) + (__maxNoOfScores * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING)) <= (__get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMBOTTOM)) {
page.downArrowButton._visible = false;
}
} else {
page.upArrowButton._visible = false;
page.downArrowButton._visible = false;
}
}
function startScroll(direction) {
scrollDirection = direction;
scrollStartTime = getTimer();
scrollStartY = page.ranksHolder._y;
clearInterval(scrollIntervalID);
scrollIntervalID = setInterval(this, "performScroll", 1);
}
function stopScroll() {
clearInterval(scrollIntervalID);
}
function performScroll() {
var _local2;
if (scrollDirection == SCROLL_DOWN) {
_local2 = scrollStartY - (((getTimer() - scrollStartTime) * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_SCROLLSPEED) / 1000);
if (((_local2 + com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP) + (__maxNoOfScores * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING)) <= (__get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMBOTTOM)) {
_local2 = ((__get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMBOTTOM) - (__maxNoOfScores * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING)) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP;
stopScroll();
page.downArrowButton._visible = false;
}
page.ranksHolder._y = _local2;
page.namesHolder._y = _local2;
page.scoresHolder._y = _local2;
page.upArrowButton._visible = true;
} else {
_local2 = scrollStartY + (((getTimer() - scrollStartTime) * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_SCROLLSPEED) / 1000);
if (_local2 >= 0) {
_local2 = 0;
stopScroll();
page.upArrowButton._visible = false;
}
page.ranksHolder._y = _local2;
page.namesHolder._y = _local2;
page.scoresHolder._y = _local2;
page.downArrowButton._visible = true;
}
}
function scrollToIndex(index) {
var _local2 = ((-index) * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING) + ((((__get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMBOTTOM) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING) / 2);
if (_local2 > 0) {
_local2 = 0;
} else if (((_local2 + com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP) + (__maxNoOfScores * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING)) <= (__get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMBOTTOM)) {
_local2 = ((__get__height() - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMBOTTOM) - (__maxNoOfScores * com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_ROWSPACING)) - com.novelgames.flashgames.highscoresAS2.Config.HIGHSCORES_LIST_FROMTOP;
}
page.ranksHolder.y = _local2;
page.namesHolder.y = _local2;
page.scoresHolder.y = _local2;
}
function finishedEnterName() {
playerName = page.nameText.text;
saveScore();
}
function saveScore() {
var highScores = this;
var _local3 = new LoadVars();
var _local2;
if (records == null) {
finishedLoadingScoresAction = saveScore;
showLoadingMessage = true;
loadScores();
return(undefined);
}
_local2 = 0;
while (_local2 < records.length) {
if (records[_local2].score <= score) {
break;
}
_local2++;
}
highScoresHighlightIndex = _local2;
records.splice(_local2, 0, new com.novelgames.flashgames.highscoresAS2.Record(playerName, score));
records.splice(__maxNoOfScores);
_local3.id = __gameID;
_local3.name = playerName;
_local3.score = score;
_local3.hash = com.novelgames.flashgames.highscoresAS2.MD5.md5(((("" + __gameID) + playerName) + score) + hashKey);
_local3.onLoad = function (success) {
highScores.finishedSavingScore(this, success);
};
_local3.sendAndLoad(__saveScoreURL, _local3, "POST");
showSavingScore();
}
function finishedSavingScore(loadVars, success) {
if ((!success) || (loadVars.success != "true")) {
showSaveScoreFailed();
return(undefined);
}
showHighScoresWithHighlight();
}
function showHighScoresWithHighlight() {
showLoadingMessage = true;
finishedLoadingScoresAction = showHighScoresWithHighlight;
showHighScoresTable(highScoresHighlightIndex);
}
static var symbolName = "HighScores";
static var symbolOwner = com.novelgames.flashgames.highscoresAS2.HighScores;
var className = "HighScores";
static var SCORERANGE_ETERNITY = 1;
static var SCORERANGE_PASTDAY = 2;
static var SCORERANGE_PASTWEEK = 3;
static var SCORERANGE_PASTMONTH = 4;
static var SCORERANGE_PASTYEAR = 5;
static var SCORERANGE_THISDAY = 6;
static var SCORERANGE_THISWEEK = 7;
static var SCORERANGE_THISMONTH = 8;
static var SCORERANGE_THISYEAR = 9;
static var SCROLL_UP = 1;
static var SCROLL_DOWN = 2;
}
Symbol 237 MovieClip [__Packages.mx.skins.SkinElement] Frame 0
class mx.skins.SkinElement extends MovieClip
{
var _visible, _x, _y, _width, _height;
function SkinElement () {
super();
}
static function registerElement(name, className) {
Object.registerClass(name, ((className == undefined) ? (mx.skins.SkinElement) : (className)));
_global.skinRegistry[name] = true;
}
function __set__visible(visible) {
_visible = visible;
}
function move(x, y) {
_x = x;
_y = y;
}
function setSize(w, h) {
_width = w;
_height = h;
}
}
Symbol 238 MovieClip [__Packages.mx.styles.CSSTextStyles] Frame 0
class mx.styles.CSSTextStyles
{
function CSSTextStyles () {
}
static function addTextStyles(o, bColor) {
o.addProperty("textAlign", function () {
return(this._tf.align);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.align = x;
});
o.addProperty("fontWeight", function () {
return(((this._tf.bold != undefined) ? ((this._tf.bold ? "bold" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.bold = x == "bold";
});
if (bColor) {
o.addProperty("color", function () {
return(this._tf.color);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.color = x;
});
}
o.addProperty("fontFamily", function () {
return(this._tf.font);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.font = x;
});
o.addProperty("textIndent", function () {
return(this._tf.indent);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.indent = x;
});
o.addProperty("fontStyle", function () {
return(((this._tf.italic != undefined) ? ((this._tf.italic ? "italic" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.italic = x == "italic";
});
o.addProperty("marginLeft", function () {
return(this._tf.leftMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.leftMargin = x;
});
o.addProperty("marginRight", function () {
return(this._tf.rightMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.rightMargin = x;
});
o.addProperty("fontSize", function () {
return(this._tf.size);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.size = x;
});
o.addProperty("textDecoration", function () {
return(((this._tf.underline != undefined) ? ((this._tf.underline ? "underline" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.underline = x == "underline";
});
o.addProperty("embedFonts", function () {
return(this._tf.embedFonts);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.embedFonts = x;
});
}
}
Symbol 239 MovieClip [__Packages.mx.styles.StyleManager] Frame 0
class mx.styles.StyleManager
{
function StyleManager () {
}
static function registerInheritingStyle(styleName) {
inheritingStyles[styleName] = true;
}
static function isInheritingStyle(styleName) {
return(inheritingStyles[styleName] == true);
}
static function registerColorStyle(styleName) {
colorStyles[styleName] = true;
}
static function isColorStyle(styleName) {
return(colorStyles[styleName] == true);
}
static function registerColorName(colorName, colorValue) {
colorNames[colorName] = colorValue;
}
static function isColorName(colorName) {
return(colorNames[colorName] != undefined);
}
static function getColorName(colorName) {
return(colorNames[colorName]);
}
static var inheritingStyles = {color:true, direction:true, fontFamily:true, fontSize:true, fontStyle:true, fontWeight:true, textAlign:true, textIndent:true};
static var colorStyles = {barColor:true, trackColor:true, borderColor:true, buttonColor:true, color:true, dateHeaderColor:true, dateRollOverColor:true, disabledColor:true, fillColor:true, highlightColor:true, scrollTrackColor:true, selectedDateColor:true, shadowColor:true, strokeColor:true, symbolBackgroundColor:true, symbolBackgroundDisabledColor:true, symbolBackgroundPressedColor:true, symbolColor:true, symbolDisabledColor:true, themeColor:true, todayIndicatorColor:true, shadowCapColor:true, borderCapColor:true, focusColor:true};
static var colorNames = {black:0, white:16777215, red:16711680, green:65280, blue:255, magenta:16711935, yellow:16776960, cyan:65535, haloGreen:8453965, haloBlue:2881013, haloOrange:16761344};
static var TextFormatStyleProps = {font:true, size:true, color:true, leftMargin:false, rightMargin:false, italic:true, bold:true, align:true, indent:true, underline:false, embedFonts:false};
static var TextStyleMap = {textAlign:true, fontWeight:true, color:true, fontFamily:true, textIndent:true, fontStyle:true, lineHeight:true, marginLeft:true, marginRight:true, fontSize:true, textDecoration:true, embedFonts:true};
}
Symbol 240 MovieClip [__Packages.mx.styles.CSSStyleDeclaration] Frame 0
class mx.styles.CSSStyleDeclaration
{
var _tf;
function CSSStyleDeclaration () {
}
function __getTextFormat(tf, bAll) {
var _local5 = false;
if (_tf != undefined) {
var _local2;
for (_local2 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local2])) {
if (tf[_local2] == undefined) {
var _local3 = _tf[_local2];
if (_local3 != undefined) {
tf[_local2] = _local3;
} else {
_local5 = true;
}
}
}
}
} else {
_local5 = true;
}
return(_local5);
}
function getStyle(styleProp) {
var _local2 = this[styleProp];
var _local3 = mx.styles.StyleManager.getColorName(_local2);
return(((_local3 == undefined) ? (_local2) : (_local3)));
}
static function classConstruct() {
mx.styles.CSSTextStyles.addTextStyles(mx.styles.CSSStyleDeclaration.prototype, true);
return(true);
}
static var classConstructed = classConstruct();
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
}
Symbol 241 MovieClip [__Packages.com.novelgames.flashgames.highscoresAS2.Config] Frame 0
class com.novelgames.flashgames.highscoresAS2.Config
{
function Config () {
}
static var HIGHSCORES_TITLEY = 20;
static var HIGHSCORES_LIST_FROMLEFT = 10;
static var HIGHSCORES_LIST_FROMTOP = 50;
static var HIGHSCORES_LIST_FROMRIGHT = 10;
static var HIGHSCORES_LIST_FROMBOTTOM = 50;
static var HIGHSCORES_LIST_ROWSPACING = 15;
static var HIGHSCORES_LIST_COLUMNSPACING = 10;
static var HIGHSCORES_LIST_BUTTONFROMBOTTOM = 20;
static var HIGHSCORES_UPARROW_FROMRIGHT = 34;
static var HIGHSCORES_UPARROW_FROMBOTTOM = 40;
static var HIGHSCORES_DOWNARROW_FROMRIGHT = 18;
static var HIGHSCORES_DOWNARROW_FROMBOTTOM = 40;
static var HIGHSCORES_SCROLLSPEED = 100;
static var HIGHSCORES_NONEDISPLAY = "-";
static var HIGHSCORES_HIGHLIGHTCOLOUR = 16711680;
static var ENTER_LABELFIELDSPACING = 5;
static var ENTER_SECTIONSPACING = 30;
static var ENTER_NAMEFIELDORDER = 20;
static var ENTER_BUTTONSSPACING = 70;
static var FAILED_TEXTBUTTONSPACING = 50;
}
Symbol 242 MovieClip [__Packages.com.novelgames.flashgames.highscoresAS2.Record] Frame 0
class com.novelgames.flashgames.highscoresAS2.Record
{
var name, score;
function Record (name, score) {
this.name = name;
this.score = score;
}
}
Symbol 243 MovieClip [__Packages.com.novelgames.flashgames.highscoresAS2.MD5] Frame 0
class com.novelgames.flashgames.highscoresAS2.MD5
{
function MD5 () {
}
static function md5(message) {
var _local19;
var _local17;
var _local1;
var _local4;
var _local7;
_local19 = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21];
_local17 = new Array(64);
_local1 = 0;
while (_local1 < 64) {
_local17[_local1] = Math.floor(Math.abs(Math.sin(_local1 + 1)) * 4294967296);
_local1++;
}
var _local16 = 1732584193 /* 0x67452301 */;
var _local15 = 4023233417;
var _local14 = 2562383102;
var _local13 = 271733878 /* 0x10325476 */;
var _local21 = message.length * 8;
var _local6 = new Array(message.length);
_local1 = 0;
while (_local1 < message.length) {
_local6[_local1] = message.charCodeAt(_local1);
_local1++;
}
_local6.push(128);
while (((_local6.length * 8) % 512) != 448) {
_local6.push(0);
}
_local6.push(_local21 & 255);
_local6.push((_local21 >> 8) & 255);
_local6.push((_local21 >> 16) & 255);
_local6.push((_local21 >> 24) & 255);
_local6.push(0);
_local6.push(0);
_local6.push(0);
_local6.push(0);
var _local20 = (_local6.length * 8) / 512;
_local7 = 0;
while (_local7 < _local20) {
var _local11 = new Array(16);
_local4 = 0;
while (_local4 < 16) {
_local11[_local4] = (((_local6[((_local7 * 64) + (_local4 * 4)) + 3] << 24) | (_local6[((_local7 * 64) + (_local4 * 4)) + 2] << 16)) | (_local6[((_local7 * 64) + (_local4 * 4)) + 1] << 8)) | _local6[(_local7 * 64) + (_local4 * 4)];
_local4++;
}
var _local10 = _local16;
var _local2 = _local15;
var _local5 = _local14;
var _local3 = _local13;
var _local9;
var _local8;
var _local12;
_local1 = 0;
while (_local1 < 64) {
if (_local1 < 16) {
_local9 = (_local2 & _local5) | ((~_local2) & _local3);
_local8 = _local1;
} else if (_local1 < 32) {
_local9 = (_local3 & _local2) | ((~_local3) & _local5);
_local8 = ((5 * _local1) + 1) % 16;
} else if (_local1 < 48) {
_local9 = (_local2 ^ _local5) ^ _local3;
_local8 = ((3 * _local1) + 5) % 16;
} else {
_local9 = _local5 ^ (_local2 | (~_local3));
_local8 = (7 * _local1) % 16;
}
_local12 = _local3;
_local3 = _local5;
_local5 = _local2;
_local2 = _local2 + leftRotate(((_local10 + _local9) + _local17[_local1]) + _local11[_local8], _local19[_local1]);
_local10 = _local12;
_local1++;
}
_local16 = _local16 + _local10;
_local15 = _local15 + _local2;
_local14 = _local14 + _local5;
_local13 = _local13 + _local3;
_local7++;
}
return(((hexToString(_local16) + hexToString(_local15)) + hexToString(_local14)) + hexToString(_local13));
}
static function leftRotate(x, c) {
var _local2 = (1 << c) - 1;
return((x << c) | ((x >> (32 - c)) & _local2));
}
static function hexToString(hex) {
return(((hexByteToString(hex & 255) + hexByteToString((hex >> 8) & 255)) + hexByteToString((hex >> 16) & 255)) + hexByteToString((hex >> 24) & 255));
}
static function hexByteToString(byte) {
var _local1 = byte.toString(16);
while (_local1.length < 2) {
_local1 = "0" + _local1;
}
return(_local1);
}
}
Symbol 244 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 245 MovieClip [__Packages.mx.events.UIEventDispatcher] Frame 0
class mx.events.UIEventDispatcher extends mx.events.EventDispatcher
{
var dispatchQueue, owner, __sentLoadEvent, __origAddEventListener;
function UIEventDispatcher () {
super();
}
static function addKeyEvents(obj) {
if (obj.keyHandler == undefined) {
var _local1 = (obj.keyHandler = new Object());
_local1.owner = obj;
_local1.onKeyDown = _fEventDispatcher.onKeyDown;
_local1.onKeyUp = _fEventDispatcher.onKeyUp;
}
Key.addListener(obj.keyHandler);
}
static function removeKeyEvents(obj) {
Key.removeListener(obj.keyHandler);
}
static function addLoadEvents(obj) {
if (obj.onLoad == undefined) {
obj.onLoad = _fEventDispatcher.onLoad;
obj.onUnload = _fEventDispatcher.onUnload;
if (obj.getBytesTotal() == obj.getBytesLoaded()) {
obj.doLater(obj, "onLoad");
}
}
}
static function removeLoadEvents(obj) {
delete obj.onLoad;
delete obj.onUnload;
}
static function initialize(obj) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.UIEventDispatcher();
}
obj.addEventListener = _fEventDispatcher.__addEventListener;
obj.__origAddEventListener = _fEventDispatcher.addEventListener;
obj.removeEventListener = _fEventDispatcher.removeEventListener;
obj.dispatchEvent = _fEventDispatcher.dispatchEvent;
obj.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(mx.events.EventDispatcher, eventObj);
dispatchQueue(this, eventObj);
}
function onKeyDown(Void) {
owner.dispatchEvent({type:"keyDown", code:Key.getCode(), ascii:Key.getAscii(), shiftKey:Key.isDown(16), ctrlKey:Key.isDown(17)});
}
function onKeyUp(Void) {
owner.dispatchEvent({type:"keyUp", code:Key.getCode(), ascii:Key.getAscii(), shiftKey:Key.isDown(16), ctrlKey:Key.isDown(17)});
}
function onLoad(Void) {
if (__sentLoadEvent != true) {
dispatchEvent({type:"load"});
}
__sentLoadEvent = true;
}
function onUnload(Void) {
dispatchEvent({type:"unload"});
}
function __addEventListener(event, handler) {
__origAddEventListener(event, handler);
var _local3 = lowLevelEvents;
for (var _local5 in _local3) {
if (mx.events.UIEventDispatcher[_local5][event] != undefined) {
var _local2 = _local3[_local5][0];
mx.events.UIEventDispatcher[_local2](this);
}
}
}
function removeEventListener(event, handler) {
var _local6 = "__q_" + event;
mx.events.EventDispatcher._removeEventListener(this[_local6], event, handler);
if (this[_local6].length == 0) {
var _local2 = lowLevelEvents;
for (var _local5 in _local2) {
if (mx.events.UIEventDispatcher[_local5][event] != undefined) {
var _local3 = _local2[_local5][1];
mx.events.UIEventDispatcher[_local2[_local5][1]](this);
}
}
}
}
static var keyEvents = {keyDown:1, keyUp:1};
static var loadEvents = {load:1, unload:1};
static var lowLevelEvents = {keyEvents:["addKeyEvents", "removeKeyEvents"], loadEvents:["addLoadEvents", "removeLoadEvents"]};
static var _fEventDispatcher = undefined;
}
Symbol 246 MovieClip [__Packages.mx.skins.ColoredSkinElement] Frame 0
class mx.skins.ColoredSkinElement
{
var getStyle, _color, onEnterFrame;
function ColoredSkinElement () {
}
function setColor(c) {
if (c != undefined) {
var _local2 = new Color(this);
_local2.setRGB(c);
}
}
function draw(Void) {
setColor(getStyle(_color));
onEnterFrame = undefined;
}
function invalidateStyle(Void) {
onEnterFrame = draw;
}
static function setColorStyle(p, colorStyle) {
if (p._color == undefined) {
p._color = colorStyle;
}
p.setColor = mixins.setColor;
p.invalidateStyle = mixins.invalidateStyle;
p.draw = mixins.draw;
p.setColor(p.getStyle(colorStyle));
}
static var mixins = new mx.skins.ColoredSkinElement();
}
Symbol 247 MovieClip [__Packages.mx.core.ext.UIObjectExtensions] Frame 0
class mx.core.ext.UIObjectExtensions
{
function UIObjectExtensions () {
}
static function addGeometry(tf, ui) {
tf.addProperty("width", ui.__get__width, null);
tf.addProperty("height", ui.__get__height, null);
tf.addProperty("left", ui.__get__left, null);
tf.addProperty("x", ui.__get__x, null);
tf.addProperty("top", ui.__get__top, null);
tf.addProperty("y", ui.__get__y, null);
tf.addProperty("right", ui.__get__right, null);
tf.addProperty("bottom", ui.__get__bottom, null);
tf.addProperty("visible", ui.__get__visible, ui.__set__visible);
}
static function Extensions() {
if (bExtended == true) {
return(true);
}
bExtended = true;
var _local6 = mx.core.UIObject.prototype;
var _local9 = mx.skins.SkinElement.prototype;
addGeometry(_local9, _local6);
mx.events.UIEventDispatcher.initialize(_local6);
var _local13 = mx.skins.ColoredSkinElement;
mx.styles.CSSTextStyles.addTextStyles(_local6);
var _local5 = MovieClip.prototype;
_local5.getTopLevel = _local6.getTopLevel;
_local5.createLabel = _local6.createLabel;
_local5.createObject = _local6.createObject;
_local5.createClassObject = _local6.createClassObject;
_local5.createEmptyObject = _local6.createEmptyObject;
_local5.destroyObject = _local6.destroyObject;
_global.ASSetPropFlags(_local5, "getTopLevel", 1);
_global.ASSetPropFlags(_local5, "createLabel", 1);
_global.ASSetPropFlags(_local5, "createObject", 1);
_global.ASSetPropFlags(_local5, "createClassObject", 1);
_global.ASSetPropFlags(_local5, "createEmptyObject", 1);
_global.ASSetPropFlags(_local5, "destroyObject", 1);
_local5.__getTextFormat = _local6.__getTextFormat;
_local5._getTextFormat = _local6._getTextFormat;
_local5.getStyleName = _local6.getStyleName;
_local5.getStyle = _local6.getStyle;
_global.ASSetPropFlags(_local5, "__getTextFormat", 1);
_global.ASSetPropFlags(_local5, "_getTextFormat", 1);
_global.ASSetPropFlags(_local5, "getStyleName", 1);
_global.ASSetPropFlags(_local5, "getStyle", 1);
var _local7 = TextField.prototype;
addGeometry(_local7, _local6);
_local7.addProperty("enabled", function () {
return(this.__enabled);
}, function (x) {
this.__enabled = x;
this.invalidateStyle();
});
_local7.move = _local9.move;
_local7.setSize = _local9.setSize;
_local7.invalidateStyle = function () {
this.invalidateFlag = true;
};
_local7.draw = function () {
if (this.invalidateFlag) {
this.invalidateFlag = false;
var _local2 = this._getTextFormat();
this.setTextFormat(_local2);
this.setNewTextFormat(_local2);
this.embedFonts = _local2.embedFonts == true;
if (this.__text != undefined) {
if (this.text == "") {
this.text = this.__text;
}
delete this.__text;
}
this._visible = true;
}
};
_local7.setColor = function (color) {
this.textColor = color;
};
_local7.getStyle = _local5.getStyle;
_local7.__getTextFormat = _local6.__getTextFormat;
_local7.setValue = function (v) {
this.text = v;
};
_local7.getValue = function () {
return(this.text);
};
_local7.addProperty("value", function () {
return(this.getValue());
}, function (v) {
this.setValue(v);
});
_local7._getTextFormat = function () {
var _local2 = this.stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
this.__getTextFormat(_local2);
this.stylecache.tf = _local2;
if (this.__enabled == false) {
if (this.enabledColor == undefined) {
var _local4 = this.getTextFormat();
this.enabledColor = _local4.color;
}
var _local3 = this.getStyle("disabledColor");
_local2.color = _local3;
} else if (this.enabledColor != undefined) {
if (_local2.color == undefined) {
_local2.color = this.enabledColor;
}
}
return(_local2);
};
_local7.getPreferredWidth = function () {
this.draw();
return(this.textWidth + 4);
};
_local7.getPreferredHeight = function () {
this.draw();
return(this.textHeight + 4);
};
TextFormat.prototype.getTextExtent2 = function (s) {
var _local3 = _root._getTextExtent;
if (_local3 == undefined) {
_root.createTextField("_getTextExtent", -2, 0, 0, 1000, 100);
_local3 = _root._getTextExtent;
_local3._visible = false;
}
_root._getTextExtent.text = s;
var _local4 = this.align;
this.align = "left";
_root._getTextExtent.setTextFormat(this);
this.align = _local4;
return({width:_local3.textWidth, height:_local3.textHeight});
};
if (_global.style == undefined) {
_global.style = new mx.styles.CSSStyleDeclaration();
_global.cascadingStyles = true;
_global.styles = new Object();
_global.skinRegistry = new Object();
if (_global._origWidth == undefined) {
_global.origWidth = Stage.width;
_global.origHeight = Stage.height;
}
}
var _local4 = _root;
while (_local4._parent != undefined) {
_local4 = _local4._parent;
}
_local4.addProperty("width", function () {
return(Stage.width);
}, null);
_local4.addProperty("height", function () {
return(Stage.height);
}, null);
_global.ASSetPropFlags(_local4, "width", 1);
_global.ASSetPropFlags(_local4, "height", 1);
return(true);
}
static var bExtended = false;
static var UIObjectExtended = Extensions();
static var UIObjectDependency = mx.core.UIObject;
static var SkinElementDependency = mx.skins.SkinElement;
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
static var UIEventDispatcherDependency = mx.events.UIEventDispatcher;
}
Symbol 248 MovieClip [__Packages.mx.skins.halo.Defaults] Frame 0
class mx.skins.halo.Defaults
{
var beginGradientFill, beginFill, moveTo, lineTo, curveTo, endFill;
function Defaults () {
}
static function setThemeDefaults() {
var _local2 = _global.style;
_local2.themeColor = 8453965 /* 0x80FF4D */;
_local2.disabledColor = 8684164 /* 0x848284 */;
_local2.modalTransparency = 0;
_local2.filled = true;
_local2.stroked = true;
_local2.strokeWidth = 1;
_local2.strokeColor = 0;
_local2.fillColor = 16777215 /* 0xFFFFFF */;
_local2.repeatInterval = 35;
_local2.repeatDelay = 500;
_local2.fontFamily = "_sans";
_local2.fontSize = 12;
_local2.selectionColor = 13500353 /* 0xCDFFC1 */;
_local2.rollOverColor = 14942166 /* 0xE3FFD6 */;
_local2.useRollOver = true;
_local2.backgroundDisabledColor = 14540253 /* 0xDDDDDD */;
_local2.selectionDisabledColor = 14540253 /* 0xDDDDDD */;
_local2.selectionDuration = 200;
_local2.openDuration = 250;
_local2.borderStyle = "inset";
_local2.color = 734012 /* 0x0B333C */;
_local2.textSelectedColor = 24371;
_local2.textRollOverColor = 2831164 /* 0x2B333C */;
_local2.textDisabledColor = 16777215 /* 0xFFFFFF */;
_local2.vGridLines = true;
_local2.hGridLines = false;
_local2.vGridLineColor = 6710886 /* 0x666666 */;
_local2.hGridLineColor = 6710886 /* 0x666666 */;
_local2.headerColor = 15395562 /* 0xEAEAEA */;
_local2.indentation = 17;
_local2.folderOpenIcon = "TreeFolderOpen";
_local2.folderClosedIcon = "TreeFolderClosed";
_local2.defaultLeafIcon = "TreeNodeIcon";
_local2.disclosureOpenIcon = "TreeDisclosureOpen";
_local2.disclosureClosedIcon = "TreeDisclosureClosed";
_local2.popupDuration = 150;
_local2.todayColor = 6710886 /* 0x666666 */;
_local2 = (_global.styles.ScrollSelectList = new mx.styles.CSSStyleDeclaration());
_local2.backgroundColor = 16777215 /* 0xFFFFFF */;
_local2.borderColor = 13290186 /* 0xCACACA */;
_local2.borderStyle = "inset";
_local2 = (_global.styles.ComboBox = new mx.styles.CSSStyleDeclaration());
_local2.borderStyle = "inset";
_local2 = (_global.styles.NumericStepper = new mx.styles.CSSStyleDeclaration());
_local2.textAlign = "center";
_local2 = (_global.styles.RectBorder = new mx.styles.CSSStyleDeclaration());
_local2.borderColor = 14015965 /* 0xD5DDDD */;
_local2.buttonColor = 7305079 /* 0x6F7777 */;
_local2.shadowColor = 15658734 /* 0xEEEEEE */;
_local2.highlightColor = 12897484 /* 0xC4CCCC */;
_local2.shadowCapColor = 14015965 /* 0xD5DDDD */;
_local2.borderCapColor = 9542041 /* 0x919999 */;
var _local4 = new Object();
_local4.borderColor = 16711680 /* 0xFF0000 */;
_local4.buttonColor = 16711680 /* 0xFF0000 */;
_local4.shadowColor = 16711680 /* 0xFF0000 */;
_local4.highlightColor = 16711680 /* 0xFF0000 */;
_local4.shadowCapColor = 16711680 /* 0xFF0000 */;
_local4.borderCapColor = 16711680 /* 0xFF0000 */;
mx.core.UIComponent.prototype.origBorderStyles = _local4;
var _local3;
_local3 = (_global.styles.TextInput = new mx.styles.CSSStyleDeclaration());
_local3.backgroundColor = 16777215 /* 0xFFFFFF */;
_local3.borderStyle = "inset";
_global.styles.TextArea = _global.styles.TextInput;
_local3 = (_global.styles.Window = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "default";
_local3 = (_global.styles.windowStyles = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3 = (_global.styles.dataGridStyles = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3 = (_global.styles.Alert = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "alert";
_local3 = (_global.styles.ScrollView = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "inset";
_local3 = (_global.styles.View = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "none";
_local3 = (_global.styles.ProgressBar = new mx.styles.CSSStyleDeclaration());
_local3.color = 11187123 /* 0xAAB3B3 */;
_local3.fontWeight = "bold";
_local3 = (_global.styles.AccordionHeader = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3.fontSize = "11";
_local3 = (_global.styles.Accordion = new mx.styles.CSSStyleDeclaration());
_local3.borderStyle = "solid";
_local3.backgroundColor = 16777215 /* 0xFFFFFF */;
_local3.borderColor = 9081738 /* 0x8A938A */;
_local3.headerHeight = 22;
_local3.marginLeft = (_local3.marginRight = (_local3.marginTop = (_local3.marginBottom = -1)));
_local3.verticalGap = -1;
_local3 = (_global.styles.DateChooser = new mx.styles.CSSStyleDeclaration());
_local3.borderColor = 9542041 /* 0x919999 */;
_local3.headerColor = 16777215 /* 0xFFFFFF */;
_local3 = (_global.styles.CalendarLayout = new mx.styles.CSSStyleDeclaration());
_local3.fontSize = 10;
_local3.textAlign = "right";
_local3.color = 2831164 /* 0x2B333C */;
_local3 = (_global.styles.WeekDayStyle = new mx.styles.CSSStyleDeclaration());
_local3.fontWeight = "bold";
_local3.fontSize = 11;
_local3.textAlign = "center";
_local3.color = 2831164 /* 0x2B333C */;
_local3 = (_global.styles.TodayStyle = new mx.styles.CSSStyleDeclaration());
_local3.color = 16777215 /* 0xFFFFFF */;
_local3 = (_global.styles.HeaderDateText = new mx.styles.CSSStyleDeclaration());
_local3.fontSize = 12;
_local3.fontWeight = "bold";
_local3.textAlign = "center";
}
function drawRoundRect(x, y, w, h, r, c, alpha, rot, gradient, ratios) {
if (typeof(r) == "object") {
var _local18 = r.br;
var _local16 = r.bl;
var _local15 = r.tl;
var _local10 = r.tr;
} else {
var _local10 = r;
var _local15 = _local10;
var _local16 = _local15;
var _local18 = _local16;
}
if (typeof(c) == "object") {
if (typeof(alpha) != "object") {
var _local9 = [alpha, alpha];
} else {
var _local9 = alpha;
}
if (ratios == undefined) {
ratios = [0, 255];
}
var _local14 = h * 0.7;
if (typeof(rot) != "object") {
var _local11 = {matrixType:"box", x:-_local14, y:_local14, w:w * 2, h:h * 4, r:rot * 0.0174532925199433 /* Math.PI/180 */};
} else {
var _local11 = rot;
}
if (gradient == "radial") {
beginGradientFill("radial", c, _local9, ratios, _local11);
} else {
beginGradientFill("linear", c, _local9, ratios, _local11);
}
} else if (c != undefined) {
beginFill(c, alpha);
}
r = _local18;
var _local13 = r - (r * 0.707106781186547);
var _local12 = r - (r * 0.414213562373095);
moveTo(x + w, (y + h) - r);
lineTo(x + w, (y + h) - r);
curveTo(x + w, (y + h) - _local12, (x + w) - _local13, (y + h) - _local13);
curveTo((x + w) - _local12, y + h, (x + w) - r, y + h);
r = _local16;
_local13 = r - (r * 0.707106781186547);
_local12 = r - (r * 0.414213562373095);
lineTo(x + r, y + h);
curveTo(x + _local12, y + h, x + _local13, (y + h) - _local13);
curveTo(x, (y + h) - _local12, x, (y + h) - r);
r = _local15;
_local13 = r - (r * 0.707106781186547);
_local12 = r - (r * 0.414213562373095);
lineTo(x, y + r);
curveTo(x, y + _local12, x + _local13, y + _local13);
curveTo(x + _local12, y, x + r, y);
r = _local10;
_local13 = r - (r * 0.707106781186547);
_local12 = r - (r * 0.414213562373095);
lineTo((x + w) - r, y);
curveTo((x + w) - _local12, y, (x + w) - _local13, y + _local13);
curveTo(x + w, y + _local12, x + w, y + r);
lineTo(x + w, (y + h) - r);
if (c != undefined) {
endFill();
}
}
static function classConstruct() {
mx.core.ext.UIObjectExtensions.Extensions();
setThemeDefaults();
mx.core.UIObject.prototype.drawRoundRect = mx.skins.halo.Defaults.prototype.drawRoundRect;
return(true);
}
static var classConstructed = classConstruct();
static var CSSStyleDeclarationDependency = mx.styles.CSSStyleDeclaration;
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
static var UIObjectDependency = mx.core.UIObject;
}
Symbol 249 MovieClip [__Packages.mx.managers.DepthManager] Frame 0
class mx.managers.DepthManager
{
var _childCounter, createClassObject, createObject, _parent, swapDepths, _topmost, getDepth;
function DepthManager () {
MovieClip.prototype.createClassChildAtDepth = createClassChildAtDepth;
MovieClip.prototype.createChildAtDepth = createChildAtDepth;
MovieClip.prototype.setDepthTo = setDepthTo;
MovieClip.prototype.setDepthAbove = setDepthAbove;
MovieClip.prototype.setDepthBelow = setDepthBelow;
MovieClip.prototype.findNextAvailableDepth = findNextAvailableDepth;
MovieClip.prototype.shuffleDepths = shuffleDepths;
MovieClip.prototype.getDepthByFlag = getDepthByFlag;
MovieClip.prototype.buildDepthTable = buildDepthTable;
_global.ASSetPropFlags(MovieClip.prototype, "createClassChildAtDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "createChildAtDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthTo", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthAbove", 1);
_global.ASSetPropFlags(MovieClip.prototype, "setDepthBelow", 1);
_global.ASSetPropFlags(MovieClip.prototype, "findNextAvailableDepth", 1);
_global.ASSetPropFlags(MovieClip.prototype, "shuffleDepths", 1);
_global.ASSetPropFlags(MovieClip.prototype, "getDepthByFlag", 1);
_global.ASSetPropFlags(MovieClip.prototype, "buildDepthTable", 1);
}
static function sortFunction(a, b) {
if (a.getDepth() > b.getDepth()) {
return(1);
}
return(-1);
}
static function test(depth) {
if (depth == reservedDepth) {
return(false);
}
return(true);
}
static function createClassObjectAtDepth(className, depthSpace, initObj) {
var _local1;
switch (depthSpace) {
case kCursor :
_local1 = holder.createClassChildAtDepth(className, kTopmost, initObj);
break;
case kTooltip :
_local1 = holder.createClassChildAtDepth(className, kTop, initObj);
break;
}
return(_local1);
}
static function createObjectAtDepth(linkageName, depthSpace, initObj) {
var _local1;
switch (depthSpace) {
case kCursor :
_local1 = holder.createChildAtDepth(linkageName, kTopmost, initObj);
break;
case kTooltip :
_local1 = holder.createChildAtDepth(linkageName, kTop, initObj);
break;
}
return(_local1);
}
function createClassChildAtDepth(className, depthFlag, initObj) {
if (_childCounter == undefined) {
_childCounter = 0;
}
var _local3 = buildDepthTable();
var _local2 = getDepthByFlag(depthFlag, _local3);
var _local5 = "down";
if (depthFlag == kBottom) {
_local5 = "up";
}
var _local6;
if (_local3[_local2] != undefined) {
_local6 = _local2;
_local2 = findNextAvailableDepth(_local2, _local3, _local5);
}
var _local4 = createClassObject(className, "depthChild" + (_childCounter++), _local2, initObj);
if (_local6 != undefined) {
_local3[_local2] = _local4;
shuffleDepths(_local4, _local6, _local3, _local5);
}
if (depthFlag == kTopmost) {
_local4._topmost = true;
}
return(_local4);
}
function createChildAtDepth(linkageName, depthFlag, initObj) {
if (_childCounter == undefined) {
_childCounter = 0;
}
var _local3 = buildDepthTable();
var _local2 = getDepthByFlag(depthFlag, _local3);
var _local5 = "down";
if (depthFlag == kBottom) {
_local5 = "up";
}
var _local6;
if (_local3[_local2] != undefined) {
_local6 = _local2;
_local2 = findNextAvailableDepth(_local2, _local3, _local5);
}
var _local4 = createObject(linkageName, "depthChild" + (_childCounter++), _local2, initObj);
if (_local6 != undefined) {
_local3[_local2] = _local4;
shuffleDepths(_local4, _local6, _local3, _local5);
}
if (depthFlag == kTopmost) {
_local4._topmost = true;
}
return(_local4);
}
function setDepthTo(depthFlag) {
var _local2 = _parent.buildDepthTable();
var _local3 = _parent.getDepthByFlag(depthFlag, _local2);
if (_local2[_local3] != undefined) {
shuffleDepths(MovieClip(this), _local3, _local2, undefined);
} else {
swapDepths(_local3);
}
if (depthFlag == kTopmost) {
_topmost = true;
} else {
delete _topmost;
}
}
function setDepthAbove(targetInstance) {
if (targetInstance._parent != _parent) {
return(undefined);
}
var _local2 = targetInstance.getDepth() + 1;
var _local3 = _parent.buildDepthTable();
if ((_local3[_local2] != undefined) && (getDepth() < _local2)) {
_local2 = _local2 - 1;
}
if (_local2 > highestDepth) {
_local2 = highestDepth;
}
if (_local2 == highestDepth) {
_parent.shuffleDepths(this, _local2, _local3, "down");
} else if (_local3[_local2] != undefined) {
_parent.shuffleDepths(this, _local2, _local3, undefined);
} else {
swapDepths(_local2);
}
}
function setDepthBelow(targetInstance) {
if (targetInstance._parent != _parent) {
return(undefined);
}
var _local6 = targetInstance.getDepth() - 1;
var _local3 = _parent.buildDepthTable();
if ((_local3[_local6] != undefined) && (getDepth() > _local6)) {
_local6 = _local6 + 1;
}
var _local4 = lowestDepth + numberOfAuthortimeLayers;
var _local5;
for (_local5 in _local3) {
var _local2 = _local3[_local5];
if (_local2._parent != undefined) {
_local4 = Math.min(_local4, _local2.getDepth());
}
}
if (_local6 < _local4) {
_local6 = _local4;
}
if (_local6 == _local4) {
_parent.shuffleDepths(this, _local6, _local3, "up");
} else if (_local3[_local6] != undefined) {
_parent.shuffleDepths(this, _local6, _local3, undefined);
} else {
swapDepths(_local6);
}
}
function findNextAvailableDepth(targetDepth, depthTable, direction) {
var _local5 = lowestDepth + numberOfAuthortimeLayers;
if (targetDepth < _local5) {
targetDepth = _local5;
}
if (depthTable[targetDepth] == undefined) {
return(targetDepth);
}
var _local1 = targetDepth;
var _local2 = targetDepth;
if (direction == "down") {
while (depthTable[_local2] != undefined) {
_local2--;
}
return(_local2);
}
while (depthTable[_local1] != undefined) {
_local1++;
}
return(_local1);
}
function shuffleDepths(subject, targetDepth, depthTable, direction) {
var _local9 = lowestDepth + numberOfAuthortimeLayers;
var _local8 = _local9;
var _local5;
for (_local5 in depthTable) {
var _local7 = depthTable[_local5];
if (_local7._parent != undefined) {
_local9 = Math.min(_local9, _local7.getDepth());
}
}
if (direction == undefined) {
if (subject.getDepth() > targetDepth) {
direction = "up";
} else {
direction = "down";
}
}
var _local1 = new Array();
for (_local5 in depthTable) {
var _local7 = depthTable[_local5];
if (_local7._parent != undefined) {
_local1.push(_local7);
}
}
_local1.sort(sortFunction);
if (direction == "up") {
var _local3;
var _local11;
do {
if (_local1.length <= 0) {
break;
}
_local3 = _local1.pop();
} while (_local3 != subject);
do {
if (_local1.length <= 0) {
break;
}
_local11 = subject.getDepth();
_local3 = _local1.pop();
var _local4 = _local3.getDepth();
if (_local11 > (_local4 + 1)) {
if (_local4 >= 0) {
subject.swapDepths(_local4 + 1);
} else if ((_local11 > _local8) && (_local4 < _local8)) {
subject.swapDepths(_local8);
}
}
subject.swapDepths(_local3);
} while (_local4 != targetDepth);
} else if (direction == "down") {
var _local3;
do {
if (_local1.length <= 0) {
break;
}
_local3 = _local1.shift();
} while (_local3 != subject);
do {
if (_local1.length <= 0) {
break;
}
var _local11 = _local3.getDepth();
_local3 = _local1.shift();
var _local4 = _local3.getDepth();
if ((_local11 < (_local4 - 1)) && (_local4 > 0)) {
subject.swapDepths(_local4 - 1);
}
subject.swapDepths(_local3);
} while (_local4 != targetDepth);
}
}
function getDepthByFlag(depthFlag, depthTable) {
var _local2 = 0;
if ((depthFlag == kTop) || (depthFlag == kNotopmost)) {
var _local5 = 0;
var _local7 = false;
var _local8;
for (_local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
if (!_local9._topmost) {
_local2 = Math.max(_local2, _local9.getDepth());
} else if (!_local7) {
_local5 = _local9.getDepth();
_local7 = true;
} else {
_local5 = Math.min(_local5, _local9.getDepth());
}
}
}
}
_local2 = _local2 + 20;
if (_local7) {
if (_local2 >= _local5) {
_local2 = _local5 - 1;
}
}
} else if (depthFlag == kBottom) {
for (var _local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
_local2 = Math.min(_local2, _local9.getDepth());
}
}
}
_local2 = _local2 - 20;
} else if (depthFlag == kTopmost) {
for (var _local8 in depthTable) {
var _local9 = depthTable[_local8];
var _local3 = typeof(_local9);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local9.__getTextFormat != undefined))) {
if (_local9.getDepth() <= highestDepth) {
_local2 = Math.max(_local2, _local9.getDepth());
}
}
}
_local2 = _local2 + 100;
}
if (_local2 >= highestDepth) {
_local2 = highestDepth;
}
var _local6 = lowestDepth + numberOfAuthortimeLayers;
for (var _local9 in depthTable) {
var _local4 = depthTable[_local9];
if (_local4._parent != undefined) {
_local6 = Math.min(_local6, _local4.getDepth());
}
}
if (_local2 <= _local6) {
_local2 = _local6;
}
return(_local2);
}
function buildDepthTable(Void) {
var _local5 = new Array();
var _local4;
for (_local4 in this) {
var _local2 = this[_local4];
var _local3 = typeof(_local2);
if ((_local3 == "movieclip") || ((_local3 == "object") && (_local2.__getTextFormat != undefined))) {
if (_local2._parent == this) {
_local5[_local2.getDepth()] = _local2;
}
}
}
return(_local5);
}
static var reservedDepth = 1048575;
static var highestDepth = 1048574;
static var lowestDepth = -16383;
static var numberOfAuthortimeLayers = 383;
static var kCursor = 101;
static var kTooltip = 102;
static var kTop = 201;
static var kBottom = 202;
static var kTopmost = 203;
static var kNotopmost = 204;
static var holder = _root.createEmptyMovieClip("reserved", reservedDepth);
static var __depthManager = new mx.managers.DepthManager();
}
Symbol 250 MovieClip [__Packages.mx.controls.SimpleButton] Frame 0
class mx.controls.SimpleButton extends mx.core.UIComponent
{
static var emphasizedStyleDeclaration;
var preset, boundingBox_mc, useHandCursor, skinName, linkLength, iconName, destroyObject, __width, _width, __height, _height, __emphaticStyleName, styleName, enabled, invalidate, pressFocus, dispatchEvent, autoRepeat, interval, getStyle, releaseFocus, createLabel, invalidateStyle;
function SimpleButton () {
super();
}
function init(Void) {
super.init();
if (preset == undefined) {
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
useHandCursor = false;
}
function createChildren(Void) {
if (preset != undefined) {
var _local2 = this[idNames[preset]];
this[refNames[preset]] = _local2;
skinName = _local2;
if (falseOverSkin.length == 0) {
rolloverSkin = fus;
}
if (falseOverIcon.length == 0) {
rolloverIcon = fui;
}
initializing = false;
} else if (__state == true) {
setStateVar(true);
} else {
if (falseOverSkin.length == 0) {
rolloverSkin = fus;
}
if (falseOverIcon.length == 0) {
rolloverIcon = fui;
}
}
}
function setIcon(tag, linkageName) {
return(setSkin(tag + 8, linkageName));
}
function changeIcon(tag, linkageName) {
linkLength = linkageName.length;
var _local2 = stateNames[tag] + "Icon";
this[_local2] = linkageName;
this[idNames[tag + 8]] = _local2;
setStateVar(getState());
}
function changeSkin(tag, linkageName) {
var _local2 = stateNames[tag] + "Skin";
this[_local2] = linkageName;
this[idNames[tag]] = _local2;
setStateVar(getState());
}
function viewIcon(varName) {
var _local4 = varName + "Icon";
var _local3 = this[_local4];
if (typeof(_local3) == "string") {
var _local5 = _local3;
if (__emphasized) {
if (this[_local3 + "Emphasized"].length > 0) {
_local3 = _local3 + "Emphasized";
}
}
if (this[_local3].length == 0) {
return(undefined);
}
_local3 = setIcon(tagMap[_local5], this[_local3]);
if ((_local3 == undefined) && (_global.isLivePreview)) {
_local3 = setIcon(0, "ButtonIcon");
}
this[_local4] = _local3;
}
iconName._visible = false;
iconName = _local3;
iconName._visible = true;
}
function removeIcons() {
var _local3 = 0;
while (_local3 < 2) {
var _local2 = 8;
while (_local2 < 16) {
destroyObject(idNames[_local2]);
this[stateNames[_local2 - 8] + "Icon"] = "";
_local2++;
}
_local3++;
}
refresh();
}
function setSkin(tag, linkageName, initobj) {
var _local3 = super.setSkin(tag, linkageName, ((initobj != undefined) ? (initobj) : ({styleName:this})));
calcSize(tag, _local3);
return(_local3);
}
function calcSize(Void) {
__width = _width;
__height = _height;
}
function viewSkin(varName, initObj) {
var _local3 = varName + "Skin";
var _local2 = this[_local3];
if (typeof(_local2) == "string") {
var _local4 = _local2;
if (__emphasized) {
if (this[_local2 + "Emphasized"].length > 0) {
_local2 = _local2 + "Emphasized";
}
}
if (this[_local2].length == 0) {
return(undefined);
}
_local2 = setSkin(tagMap[_local4], this[_local2], ((initObj != undefined) ? (initObj) : ({styleName:this})));
this[_local3] = _local2;
}
skinName._visible = false;
skinName = _local2;
skinName._visible = true;
}
function showEmphasized(e) {
if (e && (!__emphatic)) {
if (emphasizedStyleDeclaration != undefined) {
__emphaticStyleName = styleName;
styleName = emphasizedStyleDeclaration;
}
__emphatic = true;
} else {
if (__emphatic) {
styleName = __emphaticStyleName;
}
__emphatic = false;
}
}
function refresh(Void) {
var _local2 = getState();
if (enabled == false) {
viewIcon("disabled");
viewSkin("disabled");
} else {
viewSkin(phase);
viewIcon(phase);
}
setView(phase == "down");
iconName.enabled = enabled;
}
function setView(offset) {
if (iconName == undefined) {
return(undefined);
}
var _local2 = (offset ? (btnOffset) : 0);
iconName._x = ((__width - iconName._width) / 2) + _local2;
iconName._y = ((__height - iconName._height) / 2) + _local2;
}
function setStateVar(state) {
if (state) {
if (trueOverSkin.length == 0) {
rolloverSkin = tus;
} else {
rolloverSkin = trs;
}
if (trueOverIcon.length == 0) {
rolloverIcon = tui;
} else {
rolloverIcon = tri;
}
upSkin = tus;
downSkin = tds;
disabledSkin = dts;
upIcon = tui;
downIcon = tdi;
disabledIcon = dti;
} else {
if (falseOverSkin.length == 0) {
rolloverSkin = fus;
} else {
rolloverSkin = frs;
}
if (falseOverIcon.length == 0) {
rolloverIcon = fui;
} else {
rolloverIcon = fri;
}
upSkin = fus;
downSkin = fds;
disabledSkin = dfs;
upIcon = fui;
downIcon = fdi;
disabledIcon = dfi;
}
__state = state;
}
function setState(state) {
if (state != __state) {
setStateVar(state);
invalidate();
}
}
function size(Void) {
refresh();
}
function draw(Void) {
if (initializing) {
initializing = false;
skinName.visible = true;
iconName.visible = true;
}
size();
}
function getState(Void) {
return(__state);
}
function setToggle(val) {
__toggle = val;
if (__toggle == false) {
setState(false);
}
}
function getToggle(Void) {
return(__toggle);
}
function set toggle(val) {
setToggle(val);
//return(toggle);
}
function get toggle() {
return(getToggle());
}
function set value(val) {
setSelected(val);
//return(value);
}
function get value() {
return(getSelected());
}
function set selected(val) {
setSelected(val);
//return(selected);
}
function get selected() {
return(getSelected());
}
function setSelected(val) {
if (__toggle) {
setState(val);
} else {
setState((initializing ? (val) : (__state)));
}
}
function getSelected() {
return(__state);
}
function setEnabled(val) {
if (enabled != val) {
super.setEnabled(val);
invalidate();
}
}
function onPress(Void) {
pressFocus();
phase = "down";
refresh();
dispatchEvent({type:"buttonDown"});
if (autoRepeat) {
interval = setInterval(this, "onPressDelay", getStyle("repeatDelay"));
}
}
function onPressDelay(Void) {
dispatchEvent({type:"buttonDown"});
if (autoRepeat) {
clearInterval(interval);
interval = setInterval(this, "onPressRepeat", getStyle("repeatInterval"));
}
}
function onPressRepeat(Void) {
dispatchEvent({type:"buttonDown"});
updateAfterEvent();
}
function onRelease(Void) {
releaseFocus();
phase = "rollover";
if (interval != undefined) {
clearInterval(interval);
delete interval;
}
if (getToggle()) {
setState(!getState());
} else {
refresh();
}
dispatchEvent({type:"click"});
}
function onDragOut(Void) {
phase = "up";
refresh();
dispatchEvent({type:"buttonDragOut"});
}
function onDragOver(Void) {
if (phase != "up") {
onPress();
return(undefined);
}
phase = "down";
refresh();
}
function onReleaseOutside(Void) {
releaseFocus();
phase = "up";
if (interval != undefined) {
clearInterval(interval);
delete interval;
}
}
function onRollOver(Void) {
phase = "rollover";
refresh();
}
function onRollOut(Void) {
phase = "up";
refresh();
}
function getLabel(Void) {
return(fui.text);
}
function setLabel(val) {
if (typeof(fui) == "string") {
createLabel("fui", 8, val);
fui.styleName = this;
} else {
fui.text = val;
}
var _local4 = fui._getTextFormat();
var _local2 = _local4.getTextExtent2(val);
fui._width = _local2.width + 5;
fui._height = _local2.height + 5;
iconName = fui;
setView(__state);
}
function get emphasized() {
return(__emphasized);
}
function set emphasized(val) {
__emphasized = val;
var _local2 = 0;
while (_local2 < 8) {
this[idNames[_local2]] = stateNames[_local2] + "Skin";
if (typeof(this[idNames[_local2 + 8]]) == "movieclip") {
this[idNames[_local2 + 8]] = stateNames[_local2] + "Icon";
}
_local2++;
}
showEmphasized(__emphasized);
setStateVar(__state);
invalidateStyle();
//return(emphasized);
}
function keyDown(e) {
if (e.code == 32) {
onPress();
}
}
function keyUp(e) {
if (e.code == 32) {
onRelease();
}
}
function onKillFocus(newFocus) {
super.onKillFocus();
if (phase != "up") {
phase = "up";
refresh();
}
}
static var symbolName = "SimpleButton";
static var symbolOwner = mx.controls.SimpleButton;
static var version = "2.0.2.127";
var className = "SimpleButton";
var style3dInset = 4;
var btnOffset = 1;
var __toggle = false;
var __state = false;
var __emphasized = false;
var __emphatic = false;
static var falseUp = 0;
static var falseDown = 1;
static var falseOver = 2;
static var falseDisabled = 3;
static var trueUp = 4;
static var trueDown = 5;
static var trueOver = 6;
static var trueDisabled = 7;
var falseUpSkin = "SimpleButtonUp";
var falseDownSkin = "SimpleButtonIn";
var falseOverSkin = "";
var falseDisabledSkin = "SimpleButtonUp";
var trueUpSkin = "SimpleButtonIn";
var trueDownSkin = "";
var trueOverSkin = "";
var trueDisabledSkin = "SimpleButtonIn";
var falseUpIcon = "";
var falseDownIcon = "";
var falseOverIcon = "";
var falseDisabledIcon = "";
var trueUpIcon = "";
var trueDownIcon = "";
var trueOverIcon = "";
var trueDisabledIcon = "";
var phase = "up";
var fui = "falseUpIcon";
var fus = "falseUpSkin";
var fdi = "falseDownIcon";
var fds = "falseDownSkin";
var frs = "falseOverSkin";
var fri = "falseOverIcon";
var dfi = "falseDisabledIcon";
var dfs = "falseDisabledSkin";
var tui = "trueUpIcon";
var tus = "trueUpSkin";
var tdi = "trueDownIcon";
var tds = "trueDownSkin";
var trs = "trueOverSkin";
var tri = "trueOverIcon";
var dts = "trueDisabledSkin";
var dti = "trueDisabledIcon";
var rolloverSkin = mx.controls.SimpleButton.prototype.frs;
var rolloverIcon = mx.controls.SimpleButton.prototype.fri;
var upSkin = mx.controls.SimpleButton.prototype.fus;
var downSkin = mx.controls.SimpleButton.prototype.fds;
var disabledSkin = mx.controls.SimpleButton.prototype.dfs;
var upIcon = mx.controls.SimpleButton.prototype.fui;
var downIcon = mx.controls.SimpleButton.prototype.fdi;
var disabledIcon = mx.controls.SimpleButton.prototype.dfi;
var initializing = true;
var idNames = ["fus", "fds", "frs", "dfs", "tus", "tds", "trs", "dts", "fui", "fdi", "fri", "dfi", "tui", "tdi", "tri", "dti"];
var stateNames = ["falseUp", "falseDown", "falseOver", "falseDisabled", "trueUp", "trueDown", "trueOver", "trueDisabled"];
var refNames = ["upSkin", "downSkin", "rolloverSkin", "disabledSkin"];
var tagMap = {falseUpSkin:0, falseDownSkin:1, falseOverSkin:2, falseDisabledSkin:3, trueUpSkin:4, trueDownSkin:5, trueOverSkin:6, trueDisabledSkin:7, falseUpIcon:0, falseDownIcon:1, falseOverIcon:2, falseDisabledIcon:3, trueUpIcon:4, trueDownIcon:5, trueOverIcon:6, trueDisabledIcon:7};
}
Symbol 251 MovieClip [__Packages.mx.managers.SystemManager] Frame 0
class mx.managers.SystemManager
{
static var _xAddEventListener, addEventListener, __addEventListener, _xRemoveEventListener, removeEventListener, __removeEventListener, form, __screen, dispatchEvent;
function SystemManager () {
}
static function init(Void) {
if (_initialized == false) {
_initialized = true;
mx.events.EventDispatcher.initialize(mx.managers.SystemManager);
Mouse.addListener(mx.managers.SystemManager);
Stage.addListener(mx.managers.SystemManager);
_xAddEventListener = addEventListener;
addEventListener = __addEventListener;
_xRemoveEventListener = removeEventListener;
removeEventListener = __removeEventListener;
}
}
static function addFocusManager(f) {
form = f;
f.focusManager.activate();
}
static function removeFocusManager(f) {
}
static function onMouseDown(Void) {
var _local1 = form;
_local1.focusManager._onMouseDown();
}
static function onResize(Void) {
var _local7 = Stage.width;
var _local6 = Stage.height;
var _local9 = _global.origWidth;
var _local8 = _global.origHeight;
var _local3 = Stage.align;
var _local5 = (_local9 - _local7) / 2;
var _local4 = (_local8 - _local6) / 2;
if (_local3 == "T") {
_local4 = 0;
} else if (_local3 == "B") {
_local4 = _local8 - _local6;
} else if (_local3 == "L") {
_local5 = 0;
} else if (_local3 == "R") {
_local5 = _local9 - _local7;
} else if (_local3 == "LT") {
_local4 = 0;
_local5 = 0;
} else if (_local3 == "TR") {
_local4 = 0;
_local5 = _local9 - _local7;
} else if (_local3 == "LB") {
_local4 = _local8 - _local6;
_local5 = 0;
} else if (_local3 == "RB") {
_local4 = _local8 - _local6;
_local5 = _local9 - _local7;
}
if (__screen == undefined) {
__screen = new Object();
}
__screen.x = _local5;
__screen.y = _local4;
__screen.width = _local7;
__screen.height = _local6;
_root.focusManager.relocate();
dispatchEvent({type:"resize"});
}
static function get screen() {
init();
if (__screen == undefined) {
onResize();
}
return(__screen);
}
static var _initialized = false;
static var idleFrames = 0;
static var isMouseDown = false;
static var forms = new Array();
}
Symbol 252 MovieClip [__Packages.mx.managers.FocusManager] Frame 0
class mx.managers.FocusManager extends mx.core.UIComponent
{
var __defaultPushButton, defPushButton, form, move, tabEnabled, _width, _height, _x, _y, _alpha, _parent, tabCapture, watch, lastMouse, _visible, lastFocus, doLater, lastSelFocus, cancelAllDoLaters, _searchKey, _lastTarget, _firstNode, _nextIsNext, _nextNode, _lastx, _prevNode, _needPrev, _foundList, _prevObj, _nextObj, _firstObj, _lastObj, _lastNode, lastTabFocus, findFocusFromObject;
function FocusManager () {
super();
}
function get defaultPushButton() {
return(__defaultPushButton);
}
function set defaultPushButton(x) {
if (x != __defaultPushButton) {
__defaultPushButton.__set__emphasized(false);
__defaultPushButton = x;
defPushButton = x;
x.__set__emphasized(true);
}
//return(defaultPushButton);
}
function getMaxTabIndex(o) {
var _local3 = 0;
var _local6;
for (_local6 in o) {
var _local2 = o[_local6];
if (_local2._parent == o) {
if (_local2.tabIndex != undefined) {
if (_local2.tabIndex > _local3) {
_local3 = _local2.tabIndex;
}
}
if (_local2.tabChildren == true) {
var _local4 = getMaxTabIndex(_local2);
if (_local4 > _local3) {
_local3 = _local4;
}
}
}
}
return(_local3);
}
function getNextTabIndex(Void) {
return(getMaxTabIndex(form) + 1);
}
function get nextTabIndex() {
return(getNextTabIndex());
}
function relocate(Void) {
var _local2 = mx.managers.SystemManager.__get__screen();
move(_local2.x - 1, _local2.y - 1);
}
function init(Void) {
super.init();
tabEnabled = false;
_width = (_height = 1);
_x = (_y = -1);
_alpha = 0;
_parent.focusManager = this;
_parent.tabChildren = true;
_parent.tabEnabled = false;
form = _parent;
_parent.addEventListener("hide", this);
_parent.addEventListener("reveal", this);
mx.managers.SystemManager.init();
mx.managers.SystemManager.addFocusManager(form);
tabCapture.tabIndex = 0;
watch("enabled", enabledChanged);
Selection.addListener(this);
lastMouse = new Object();
_global.ASSetPropFlags(_parent, "focusManager", 1);
_global.ASSetPropFlags(_parent, "tabChildren", 1);
_global.ASSetPropFlags(_parent, "tabEnabled", 1);
}
function enabledChanged(id, oldValue, newValue) {
_visible = newValue;
return(newValue);
}
function activate(Void) {
Key.addListener(this);
activated = (_visible = true);
if (lastFocus != undefined) {
bNeedFocus = true;
if (!mx.managers.SystemManager.isMouseDown) {
doLater(this, "restoreFocus");
}
}
}
function deactivate(Void) {
Key.removeListener(this);
activated = (_visible = false);
var _local2 = getSelectionFocus();
var _local3 = getActualFocus(_local2);
if (isOurFocus(_local3)) {
lastSelFocus = _local2;
lastFocus = _local3;
}
cancelAllDoLaters();
}
function isOurFocus(o) {
if (o.focusManager == this) {
return(true);
}
while (o != undefined) {
if (o.focusManager != undefined) {
return(false);
}
if (o._parent == _parent) {
return(true);
}
o = o._parent;
}
return(false);
}
function onSetFocus(o, n) {
if (n == null) {
if (activated) {
bNeedFocus = true;
}
} else {
var _local2 = getFocus();
if (isOurFocus(_local2)) {
bNeedFocus = false;
lastFocus = _local2;
lastSelFocus = n;
}
}
}
function restoreFocus(Void) {
var _local2 = lastSelFocus.hscroll;
if (_local2 != undefined) {
var _local5 = lastSelFocus.scroll;
var _local4 = lastSelFocus.background;
}
lastFocus.setFocus();
var _local3 = Selection;
Selection.setSelection(_local3.lastBeginIndex, _local3.lastEndIndex);
if (_local2 != undefined) {
lastSelFocus.scroll = _local5;
lastSelFocus.hscroll = _local2;
lastSelFocus.background = _local4;
}
}
function onUnload(Void) {
mx.managers.SystemManager.removeFocusManager(form);
}
function setFocus(o) {
if (o == null) {
Selection.setFocus(null);
} else if (o.setFocus == undefined) {
Selection.setFocus(o);
} else {
o.setFocus();
}
}
function getActualFocus(o) {
var _local1 = o._parent;
while (_local1 != undefined) {
if (_local1.focusTextField != undefined) {
while (_local1.focusTextField != undefined) {
o = _local1;
_local1 = _local1._parent;
if (_local1 == undefined) {
return(undefined);
}
if (_local1.focusTextField == undefined) {
return(o);
}
}
}
if (_local1.tabEnabled != true) {
return(o);
}
o = _local1;
_local1 = o._parent;
}
return(undefined);
}
function getSelectionFocus() {
var m = Selection.getFocus();
var o = eval (m);
return(o);
}
function getFocus(Void) {
var _local2 = getSelectionFocus();
return(getActualFocus(_local2));
}
function walkTree(p, index, groupName, dir, lookup, firstChild) {
var _local5 = true;
var _local11;
for (_local11 in p) {
var _local2 = p[_local11];
if ((((_local2._parent == p) && (_local2.enabled != false)) && (_local2._visible != false)) && ((_local2.tabEnabled == true) || ((_local2.tabEnabled != false) && ((((((((_local2.onPress != undefined) || (_local2.onRelease != undefined)) || (_local2.onReleaseOutside != undefined)) || (_local2.onDragOut != undefined)) || (_local2.onDragOver != undefined)) || (_local2.onRollOver != undefined)) || (_local2.onRollOut != undefined)) || (_local2 instanceof TextField))))) {
if (_local2._searchKey == _searchKey) {
continue;
}
_local2._searchKey = _searchKey;
if (_local2 != _lastTarget) {
if (((_local2.groupName != undefined) || (groupName != undefined)) && (_local2.groupName == groupName)) {
continue;
}
if ((_local2 instanceof TextField) && (_local2.selectable == false)) {
continue;
}
if (_local5 || (((_local2.groupName != undefined) && (_local2.groupName == _firstNode.groupName)) && (_local2.selected == true))) {
if (firstChild) {
_firstNode = _local2;
firstChild = false;
}
}
if (_nextIsNext == true) {
if ((((_local2.groupName != undefined) && (_local2.groupName == _nextNode.groupName)) && (_local2.selected == true)) || ((_nextNode == undefined) && ((_local2.groupName == undefined) || ((_local2.groupName != undefined) && (_local2.groupName != groupName))))) {
_nextNode = _local2;
}
}
if ((_local2.groupName == undefined) || (groupName != _local2.groupName)) {
if (((_lastx.groupName != undefined) && (_local2.groupName == _lastx.groupName)) && (_lastx.selected == true)) {
} else {
_lastx = _local2;
}
}
} else {
_prevNode = _lastx;
_needPrev = false;
_nextIsNext = true;
}
if (_local2.tabIndex != undefined) {
if (_local2.tabIndex == index) {
if (_foundList[_local2._name] == undefined) {
if (_needPrev) {
_prevObj = _local2;
_needPrev = false;
}
_nextObj = _local2;
}
}
if (dir && (_local2.tabIndex > index)) {
if (((_nextObj == undefined) || ((_nextObj.tabIndex > _local2.tabIndex) && (((_local2.groupName == undefined) || (_nextObj.groupName == undefined)) || (_local2.groupName != _nextObj.groupName)))) || ((((_nextObj.groupName != undefined) && (_nextObj.groupName == _local2.groupName)) && (_nextObj.selected != true)) && ((_local2.selected == true) || (_nextObj.tabIndex > _local2.tabIndex)))) {
_nextObj = _local2;
}
} else if ((!dir) && (_local2.tabIndex < index)) {
if (((_prevObj == undefined) || ((_prevObj.tabIndex < _local2.tabIndex) && (((_local2.groupName == undefined) || (_prevObj.groupName == undefined)) || (_local2.groupName != _prevObj.groupName)))) || ((((_prevObj.groupName != undefined) && (_prevObj.groupName == _local2.groupName)) && (_prevObj.selected != true)) && ((_local2.selected == true) || (_prevObj.tabIndex < _local2.tabIndex)))) {
_prevObj = _local2;
}
}
if (((_firstObj == undefined) || ((_local2.tabIndex < _firstObj.tabIndex) && (((_local2.groupName == undefined) || (_firstObj.groupName == undefined)) || (_local2.groupName != _firstObj.groupName)))) || ((((_firstObj.groupName != undefined) && (_firstObj.groupName == _local2.groupName)) && (_firstObj.selected != true)) && ((_local2.selected == true) || (_local2.tabIndex < _firstObj.tabIndex)))) {
_firstObj = _local2;
}
if (((_lastObj == undefined) || ((_local2.tabIndex > _lastObj.tabIndex) && (((_local2.groupName == undefined) || (_lastObj.groupName == undefined)) || (_local2.groupName != _lastObj.groupName)))) || ((((_lastObj.groupName != undefined) && (_lastObj.groupName == _local2.groupName)) && (_lastObj.selected != true)) && ((_local2.selected == true) || (_local2.tabIndex > _lastObj.tabIndex)))) {
_lastObj = _local2;
}
}
if (_local2.tabChildren) {
getTabCandidateFromChildren(_local2, index, groupName, dir, _local5 && (firstChild));
}
_local5 = false;
} else if (((_local2._parent == p) && (_local2.tabChildren == true)) && (_local2._visible != false)) {
if (_local2 == _lastTarget) {
if (_local2._searchKey == _searchKey) {
continue;
}
_local2._searchKey = _searchKey;
if (_prevNode == undefined) {
var _local3 = _lastx;
var _local7 = false;
while (_local3 != undefined) {
if (_local3 == _local2) {
_local7 = true;
break;
}
_local3 = _local3._parent;
}
if (_local7 == false) {
_prevNode = _lastx;
}
}
_needPrev = false;
if (_nextNode == undefined) {
_nextIsNext = true;
}
} else if (!((_local2.focusManager != undefined) && (_local2.focusManager._parent == _local2))) {
if (_local2._searchKey == _searchKey) {
continue;
}
_local2._searchKey = _searchKey;
getTabCandidateFromChildren(_local2, index, groupName, dir, _local5 && (firstChild));
}
_local5 = false;
}
}
_lastNode = _lastx;
if (lookup) {
if (p._parent != undefined) {
if (p != _parent) {
if ((_prevNode == undefined) && (dir)) {
_needPrev = true;
} else if ((_nextNode == undefined) && (!dir)) {
_nextIsNext = false;
}
_lastTarget = _lastTarget._parent;
getTabCandidate(p._parent, index, groupName, dir, true);
}
}
}
}
function getTabCandidate(o, index, groupName, dir, firstChild) {
var _local2;
var _local3 = true;
if (o == _parent) {
_local2 = o;
_local3 = false;
} else {
_local2 = o._parent;
if (_local2 == undefined) {
_local2 = o;
_local3 = false;
}
}
walkTree(_local2, index, groupName, dir, _local3, firstChild);
}
function getTabCandidateFromChildren(o, index, groupName, dir, firstChild) {
walkTree(o, index, groupName, dir, false, firstChild);
}
function getFocusManagerFromObject(o) {
while (o != undefined) {
if (o.focusManager != undefined) {
return(o.focusManager);
}
o = o._parent;
}
return(undefined);
}
function tabHandler(Void) {
bDrawFocus = true;
var _local5 = getSelectionFocus();
var _local4 = getActualFocus(_local5);
if (_local4 != _local5) {
_local5 = _local4;
}
if (getFocusManagerFromObject(_local5) != this) {
_local5 == undefined;
}
if (_local5 == undefined) {
_local5 = form;
} else if (_local5.tabIndex != undefined) {
if ((_foundList != undefined) || (_foundList.tabIndex != _local5.tabIndex)) {
_foundList = new Object();
_foundList.tabIndex = _local5.tabIndex;
}
_foundList[_local5._name] = _local5;
}
var _local3 = Key.isDown(16) != true;
_searchKey = getTimer();
_needPrev = true;
_nextIsNext = false;
_lastx = undefined;
_firstNode = undefined;
_lastNode = undefined;
_nextNode = undefined;
_prevNode = undefined;
_firstObj = undefined;
_lastObj = undefined;
_nextObj = undefined;
_prevObj = undefined;
_lastTarget = _local5;
var _local6 = _local5;
getTabCandidate(_local6, ((_local5.tabIndex == undefined) ? 0 : (_local5.tabIndex)), _local5.groupName, _local3, true);
var _local2;
if (_local3) {
if (_nextObj != undefined) {
_local2 = _nextObj;
} else {
_local2 = _firstObj;
}
} else if (_prevObj != undefined) {
_local2 = _prevObj;
} else {
_local2 = _lastObj;
}
if (_local2.tabIndex != _local5.tabIndex) {
_foundList = new Object();
_foundList.tabIndex = _local2.tabIndex;
_foundList[_local2._name] = _local2;
} else {
if (_foundList == undefined) {
_foundList = new Object();
_foundList.tabIndex = _local2.tabIndex;
}
_foundList[_local2._name] = _local2;
}
if (_local2 == undefined) {
if (_local3 == false) {
if (_nextNode != undefined) {
_local2 = _nextNode;
} else {
_local2 = _firstNode;
}
} else if ((_prevNode == undefined) || (_local5 == form)) {
_local2 = _lastNode;
} else {
_local2 = _prevNode;
}
}
if (_local2 == undefined) {
return(undefined);
}
lastTabFocus = _local2;
setFocus(_local2);
if (_local2.emphasized != undefined) {
if (defPushButton != undefined) {
_local5 = defPushButton;
defPushButton = mx.controls.SimpleButton(_local2);
_local5.emphasized = false;
_local2.emphasized = true;
}
} else if ((defPushButton != undefined) && (defPushButton != __defaultPushButton)) {
_local5 = defPushButton;
defPushButton = __defaultPushButton;
_local5.emphasized = false;
__defaultPushButton.__set__emphasized(true);
}
}
function onKeyDown(Void) {
mx.managers.SystemManager.idleFrames = 0;
if (defaultPushButtonEnabled) {
if (Key.getCode() == 13) {
if (defaultPushButton != undefined) {
doLater(this, "sendDefaultPushButtonEvent");
}
}
}
}
function sendDefaultPushButtonEvent(Void) {
defPushButton.dispatchEvent({type:"click"});
}
function getMousedComponentFromChildren(x, y, o) {
for (var _local7 in o) {
var _local2 = o[_local7];
if (((_local2._visible && (_local2.enabled)) && (_local2._parent == o)) && (_local2._searchKey != _searchKey)) {
_local2._searchKey = _searchKey;
if (_local2.hitTest(x, y, true)) {
if ((_local2.onPress != undefined) || (_local2.onRelease != undefined)) {
return(_local2);
}
var _local3 = getMousedComponentFromChildren(x, y, _local2);
if (_local3 != undefined) {
return(_local3);
}
return(_local2);
}
}
}
return(undefined);
}
function mouseActivate(Void) {
if (!bNeedFocus) {
return(undefined);
}
_searchKey = getTimer();
var _local2 = getMousedComponentFromChildren(lastMouse.x, lastMouse.y, form);
if (_local2 instanceof mx.core.UIComponent) {
return(undefined);
}
_local2 = findFocusFromObject(_local2);
if (_local2 == lastFocus) {
return(undefined);
}
if (_local2 == undefined) {
doLater(this, "restoreFocus");
return(undefined);
}
var _local3 = _local2.hscroll;
if (_local3 != undefined) {
var _local6 = _local2.scroll;
var _local5 = _local2.background;
}
setFocus(_local2);
var _local4 = Selection;
Selection.setSelection(_local4.lastBeginIndex, _local4.lastEndIndex);
if (_local3 != undefined) {
_local2.scroll = _local6;
_local2.hscroll = _local3;
_local2.background = _local5;
}
}
function _onMouseDown(Void) {
bDrawFocus = false;
if (lastFocus != undefined) {
lastFocus.drawFocus(false);
}
mx.managers.SystemManager.idleFrames = 0;
var _local3 = Selection;
_local3.lastBeginIndex = Selection.getBeginIndex();
_local3.lastEndIndex = Selection.getEndIndex();
lastMouse.x = _root._xmouse;
lastMouse.y = _root._ymouse;
_root.localToGlobal(lastMouse);
}
function onMouseUp(Void) {
if (_visible) {
doLater(this, "mouseActivate");
}
}
function handleEvent(e) {
if (e.type == "reveal") {
mx.managers.SystemManager.activate(form);
} else {
mx.managers.SystemManager.deactivate(form);
}
}
static function enableFocusManagement() {
if (!initialized) {
initialized = true;
Object.registerClass("FocusManager", mx.managers.FocusManager);
if (_root.focusManager == undefined) {
_root.createClassObject(mx.managers.FocusManager, "focusManager", mx.managers.DepthManager.highestDepth--);
}
}
}
static var symbolName = "FocusManager";
static var symbolOwner = mx.managers.FocusManager;
static var version = "2.0.2.127";
var className = "FocusManager";
var bNeedFocus = false;
var bDrawFocus = false;
var defaultPushButtonEnabled = true;
var activated = true;
static var initialized = false;
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
}
Symbol 253 MovieClip [__Packages.mx.skins.halo.FocusRect] Frame 0
class mx.skins.halo.FocusRect extends mx.skins.SkinElement
{
var boundingBox_mc, _xscale, _yscale, clear, beginFill, drawRoundRect, endFill, _visible;
function FocusRect () {
super();
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
function draw(o) {
o.adjustFocusRect();
}
function setSize(w, h, r, a, rectCol) {
_xscale = (_yscale = 100);
clear();
if (typeof(r) == "object") {
r.br = ((r.br > 2) ? (r.br - 2) : 0);
r.bl = ((r.bl > 2) ? (r.bl - 2) : 0);
r.tr = ((r.tr > 2) ? (r.tr - 2) : 0);
r.tl = ((r.tl > 2) ? (r.tl - 2) : 0);
beginFill(rectCol, a * 0.3);
drawRoundRect(0, 0, w, h, r);
drawRoundRect(2, 2, w - 4, h - 4, r);
endFill();
r.br = ((r.br > 1) ? (r.br + 1) : 0);
r.bl = ((r.bl > 1) ? (r.bl + 1) : 0);
r.tr = ((r.tr > 1) ? (r.tr + 1) : 0);
r.tl = ((r.tl > 1) ? (r.tl + 1) : 0);
beginFill(rectCol, a * 0.3);
drawRoundRect(1, 1, w - 2, h - 2, r);
r.br = ((r.br > 1) ? (r.br - 1) : 0);
r.bl = ((r.bl > 1) ? (r.bl - 1) : 0);
r.tr = ((r.tr > 1) ? (r.tr - 1) : 0);
r.tl = ((r.tl > 1) ? (r.tl - 1) : 0);
drawRoundRect(2, 2, w - 4, h - 4, r);
endFill();
} else {
var _local5;
if (r != 0) {
_local5 = r - 2;
} else {
_local5 = 0;
}
beginFill(rectCol, a * 0.3);
drawRoundRect(0, 0, w, h, r);
drawRoundRect(2, 2, w - 4, h - 4, _local5);
endFill();
beginFill(rectCol, a * 0.3);
if (r != 0) {
_local5 = r - 2;
r = r - 1;
} else {
_local5 = 0;
r = 0;
}
drawRoundRect(1, 1, w - 2, h - 2, r);
drawRoundRect(2, 2, w - 4, h - 4, _local5);
endFill();
}
}
function handleEvent(e) {
if (e.type == "unload") {
_visible = true;
} else if (e.type == "resize") {
e.target.adjustFocusRect();
} else if (e.type == "move") {
e.target.adjustFocusRect();
}
}
static function classConstruct() {
mx.core.UIComponent.prototype.drawFocus = function (focused) {
var _local2 = this._parent.focus_mc;
if (!focused) {
_local2._visible = false;
this.removeEventListener("unload", _local2);
this.removeEventListener("move", _local2);
this.removeEventListener("resize", _local2);
} else {
if (_local2 == undefined) {
_local2 = this._parent.createChildAtDepth("FocusRect", mx.managers.DepthManager.kTop);
_local2.tabEnabled = false;
this._parent.focus_mc = _local2;
} else {
_local2._visible = true;
}
_local2.draw(this);
if (_local2.getDepth() < this.getDepth()) {
_local2.setDepthAbove(this);
}
this.addEventListener("unload", _local2);
this.addEventListener("move", _local2);
this.addEventListener("resize", _local2);
}
};
mx.core.UIComponent.prototype.adjustFocusRect = function () {
var _local2 = this.getStyle("themeColor");
if (_local2 == undefined) {
_local2 = 8453965 /* 0x80FF4D */;
}
var _local3 = this._parent.focus_mc;
_local3.setSize(this.width + 4, this.height + 4, 0, 100, _local2);
_local3.move(this.x - 2, this.y - 2);
};
TextField.prototype.drawFocus = mx.core.UIComponent.prototype.drawFocus;
TextField.prototype.adjustFocusRect = mx.core.UIComponent.prototype.adjustFocusRect;
mx.skins.halo.FocusRect.prototype.drawRoundRect = mx.skins.halo.Defaults.prototype.drawRoundRect;
return(true);
}
static var classConstructed = classConstruct();
static var DefaultsDependency = mx.skins.halo.Defaults;
static var UIComponentDependency = mx.core.UIComponent;
}
Symbol 254 MovieClip [__Packages.mx.managers.OverlappedWindows] Frame 0
class mx.managers.OverlappedWindows
{
function OverlappedWindows () {
}
static function checkIdle(Void) {
if (mx.managers.SystemManager.idleFrames > 10) {
mx.managers.SystemManager.dispatchEvent({type:"idle"});
} else {
mx.managers.SystemManager.idleFrames++;
}
}
static function __addEventListener(e, o, l) {
if (e == "idle") {
if (mx.managers.SystemManager.interval == undefined) {
mx.managers.SystemManager.interval = setInterval(mx.managers.SystemManager.checkIdle, 100);
}
}
mx.managers.SystemManager._xAddEventListener(e, o, l);
}
static function __removeEventListener(e, o, l) {
if (e == "idle") {
if (mx.managers.SystemManager._xRemoveEventListener(e, o, l) == 0) {
clearInterval(mx.managers.SystemManager.interval);
}
} else {
mx.managers.SystemManager._xRemoveEventListener(e, o, l);
}
}
static function onMouseDown(Void) {
mx.managers.SystemManager.idleFrames = 0;
mx.managers.SystemManager.isMouseDown = true;
var _local5 = _root;
var _local3;
var _local8 = _root._xmouse;
var _local7 = _root._ymouse;
if (mx.managers.SystemManager.form.modalWindow == undefined) {
if (mx.managers.SystemManager.forms.length > 1) {
var _local6 = mx.managers.SystemManager.forms.length;
var _local4;
_local4 = 0;
while (_local4 < _local6) {
var _local2 = mx.managers.SystemManager.forms[_local4];
if (_local2._visible) {
if (_local2.hitTest(_local8, _local7)) {
if (_local3 == undefined) {
_local3 = _local2.getDepth();
_local5 = _local2;
} else if (_local3 < _local2.getDepth()) {
_local3 = _local2.getDepth();
_local5 = _local2;
}
}
}
_local4++;
}
if (_local5 != mx.managers.SystemManager.form) {
mx.managers.SystemManager.activate(_local5);
}
}
}
var _local9 = mx.managers.SystemManager.form;
_local9.focusManager._onMouseDown();
}
static function onMouseMove(Void) {
mx.managers.SystemManager.idleFrames = 0;
}
static function onMouseUp(Void) {
mx.managers.SystemManager.isMouseDown = false;
mx.managers.SystemManager.idleFrames = 0;
}
static function activate(f) {
if (mx.managers.SystemManager.form != undefined) {
if ((mx.managers.SystemManager.form != f) && (mx.managers.SystemManager.forms.length > 1)) {
var _local1 = mx.managers.SystemManager.form;
_local1.focusManager.deactivate();
}
}
mx.managers.SystemManager.form = f;
f.focusManager.activate();
}
static function deactivate(f) {
if (mx.managers.SystemManager.form != undefined) {
if ((mx.managers.SystemManager.form == f) && (mx.managers.SystemManager.forms.length > 1)) {
var _local5 = mx.managers.SystemManager.form;
_local5.focusManager.deactivate();
var _local3 = mx.managers.SystemManager.forms.length;
var _local1;
var _local2;
_local1 = 0;
while (_local1 < _local3) {
if (mx.managers.SystemManager.forms[_local1] == f) {
_local1 = _local1 + 1;
while (_local1 < _local3) {
if (mx.managers.SystemManager.forms[_local1]._visible == true) {
_local2 = mx.managers.SystemManager.forms[_local1];
}
_local1++;
}
mx.managers.SystemManager.form = _local2;
break;
}
if (mx.managers.SystemManager.forms[_local1]._visible == true) {
_local2 = mx.managers.SystemManager.forms[_local1];
}
_local1++;
}
_local5 = mx.managers.SystemManager.form;
_local5.focusManager.activate();
}
}
}
static function addFocusManager(f) {
mx.managers.SystemManager.forms.push(f);
mx.managers.SystemManager.activate(f);
}
static function removeFocusManager(f) {
var _local3 = mx.managers.SystemManager.forms.length;
var _local1;
_local1 = 0;
while (_local1 < _local3) {
if (mx.managers.SystemManager.forms[_local1] == f) {
if (mx.managers.SystemManager.form == f) {
mx.managers.SystemManager.deactivate(f);
}
mx.managers.SystemManager.forms.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
static function enableOverlappedWindows() {
if (!initialized) {
initialized = true;
mx.managers.SystemManager.checkIdle = checkIdle;
mx.managers.SystemManager.__addEventListener = __addEventListener;
mx.managers.SystemManager.__removeEventListener = __removeEventListener;
mx.managers.SystemManager.onMouseDown = onMouseDown;
mx.managers.SystemManager.onMouseMove = onMouseMove;
mx.managers.SystemManager.onMouseUp = onMouseUp;
mx.managers.SystemManager.activate = activate;
mx.managers.SystemManager.deactivate = deactivate;
mx.managers.SystemManager.addFocusManager = addFocusManager;
mx.managers.SystemManager.removeFocusManager = removeFocusManager;
}
}
static var initialized = false;
static var SystemManagerDependency = mx.managers.SystemManager;
}
Symbol 255 MovieClip [__Packages.mx.styles.CSSSetStyle] Frame 0
class mx.styles.CSSSetStyle
{
var styleName, stylecache, _color, setColor, invalidateStyle;
function CSSSetStyle () {
}
function _setStyle(styleProp, newValue) {
this[styleProp] = newValue;
if (mx.styles.StyleManager.TextStyleMap[styleProp] != undefined) {
if (styleProp == "color") {
if (isNaN(newValue)) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
}
_level0.changeTextStyleInChildren(styleProp);
return(undefined);
}
if (mx.styles.StyleManager.isColorStyle(styleProp)) {
if (isNaN(newValue)) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
if (styleProp == "themeColor") {
var _local7 = mx.styles.StyleManager.colorNames.haloBlue;
var _local6 = mx.styles.StyleManager.colorNames.haloGreen;
var _local8 = mx.styles.StyleManager.colorNames.haloOrange;
var _local4 = {};
_local4[_local7] = 12188666 /* 0xB9FBFA */;
_local4[_local6] = 13500353 /* 0xCDFFC1 */;
_local4[_local8] = 16766319 /* 0xFFD56F */;
var _local5 = {};
_local5[_local7] = 13958653 /* 0xD4FDFD */;
_local5[_local6] = 14942166 /* 0xE3FFD6 */;
_local5[_local8] = 16772787 /* 0xFFEEB3 */;
var _local9 = _local4[newValue];
var _local10 = _local5[newValue];
if (_local9 == undefined) {
_local9 = newValue;
}
if (_local10 == undefined) {
_local10 = newValue;
}
setStyle("selectionColor", _local9);
setStyle("rollOverColor", _local10);
}
_level0.changeColorStyleInChildren(styleName, styleProp, newValue);
} else {
if ((styleProp == "backgroundColor") && (isNaN(newValue))) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
_level0.notifyStyleChangeInChildren(styleName, styleProp, newValue);
}
}
function changeTextStyleInChildren(styleProp) {
var _local4 = getTimer();
var _local5;
for (_local5 in this) {
var _local2 = this[_local5];
if (_local2._parent == this) {
if (_local2.searchKey != _local4) {
if (_local2.stylecache != undefined) {
delete _local2.stylecache.tf;
delete _local2.stylecache[styleProp];
}
_local2.invalidateStyle(styleProp);
_local2.changeTextStyleInChildren(styleProp);
_local2.searchKey = _local4;
}
}
}
}
function changeColorStyleInChildren(sheetName, colorStyle, newValue) {
var _local6 = getTimer();
var _local7;
for (_local7 in this) {
var _local2 = this[_local7];
if (_local2._parent == this) {
if (_local2.searchKey != _local6) {
if (((_local2.getStyleName() == sheetName) || (sheetName == undefined)) || (sheetName == "_global")) {
if (_local2.stylecache != undefined) {
delete _local2.stylecache[colorStyle];
}
if (typeof(_local2._color) == "string") {
if (_local2._color == colorStyle) {
var _local4 = _local2.getStyle(colorStyle);
if (colorStyle == "color") {
if (stylecache.tf.color != undefined) {
stylecache.tf.color = _local4;
}
}
_local2.setColor(_local4);
}
} else if (_local2._color[colorStyle] != undefined) {
if (typeof(_local2) != "movieclip") {
_local2._parent.invalidateStyle();
} else {
_local2.invalidateStyle(colorStyle);
}
}
}
_local2.changeColorStyleInChildren(sheetName, colorStyle, newValue);
_local2.searchKey = _local6;
}
}
}
}
function notifyStyleChangeInChildren(sheetName, styleProp, newValue) {
var _local5 = getTimer();
var _local6;
for (_local6 in this) {
var _local2 = this[_local6];
if (_local2._parent == this) {
if (_local2.searchKey != _local5) {
if (((_local2.styleName == sheetName) || ((_local2.styleName != undefined) && (typeof(_local2.styleName) == "movieclip"))) || (sheetName == undefined)) {
if (_local2.stylecache != undefined) {
delete _local2.stylecache[styleProp];
delete _local2.stylecache.tf;
}
delete _local2.enabledColor;
_local2.invalidateStyle(styleProp);
}
_local2.notifyStyleChangeInChildren(sheetName, styleProp, newValue);
_local2.searchKey = _local5;
}
}
}
}
function setStyle(styleProp, newValue) {
if (stylecache != undefined) {
delete stylecache[styleProp];
delete stylecache.tf;
}
this[styleProp] = newValue;
if (mx.styles.StyleManager.isColorStyle(styleProp)) {
if (isNaN(newValue)) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
if (styleProp == "themeColor") {
var _local10 = mx.styles.StyleManager.colorNames.haloBlue;
var _local9 = mx.styles.StyleManager.colorNames.haloGreen;
var _local11 = mx.styles.StyleManager.colorNames.haloOrange;
var _local6 = {};
_local6[_local10] = 12188666 /* 0xB9FBFA */;
_local6[_local9] = 13500353 /* 0xCDFFC1 */;
_local6[_local11] = 16766319 /* 0xFFD56F */;
var _local7 = {};
_local7[_local10] = 13958653 /* 0xD4FDFD */;
_local7[_local9] = 14942166 /* 0xE3FFD6 */;
_local7[_local11] = 16772787 /* 0xFFEEB3 */;
var _local12 = _local6[newValue];
var _local13 = _local7[newValue];
if (_local12 == undefined) {
_local12 = newValue;
}
if (_local13 == undefined) {
_local13 = newValue;
}
setStyle("selectionColor", _local12);
setStyle("rollOverColor", _local13);
}
if (typeof(_color) == "string") {
if (_color == styleProp) {
if (styleProp == "color") {
if (stylecache.tf.color != undefined) {
stylecache.tf.color = newValue;
}
}
setColor(newValue);
}
} else if (_color[styleProp] != undefined) {
invalidateStyle(styleProp);
}
changeColorStyleInChildren(undefined, styleProp, newValue);
} else {
if ((styleProp == "backgroundColor") && (isNaN(newValue))) {
newValue = mx.styles.StyleManager.getColorName(newValue);
this[styleProp] = newValue;
if (newValue == undefined) {
return(undefined);
}
}
invalidateStyle(styleProp);
}
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (styleProp == "styleName")) {
var _local8;
var _local5 = newValue;
if (styleProp == "styleName") {
_local8 = ((typeof(newValue) == "string") ? (_global.styles[newValue]) : (_local5));
_local5 = _local8.themeColor;
if (_local5 != undefined) {
_local8.rollOverColor = (_local8.selectionColor = _local5);
}
}
notifyStyleChangeInChildren(undefined, styleProp, newValue);
}
}
static function enableRunTimeCSS() {
}
static function classConstruct() {
var _local2 = MovieClip.prototype;
var _local3 = mx.styles.CSSSetStyle.prototype;
mx.styles.CSSStyleDeclaration.prototype.setStyle = _local3._setStyle;
_local2.changeTextStyleInChildren = _local3.changeTextStyleInChildren;
_local2.changeColorStyleInChildren = _local3.changeColorStyleInChildren;
_local2.notifyStyleChangeInChildren = _local3.notifyStyleChangeInChildren;
_local2.setStyle = _local3.setStyle;
_global.ASSetPropFlags(_local2, "changeTextStyleInChildren", 1);
_global.ASSetPropFlags(_local2, "changeColorStyleInChildren", 1);
_global.ASSetPropFlags(_local2, "notifyStyleChangeInChildren", 1);
_global.ASSetPropFlags(_local2, "setStyle", 1);
var _local4 = TextField.prototype;
_local4.setStyle = _local2.setStyle;
_local4.changeTextStyleInChildren = _local3.changeTextStyleInChildren;
return(true);
}
static var classConstructed = classConstruct();
static var CSSStyleDeclarationDependency = mx.styles.CSSStyleDeclaration;
}
Symbol 256 MovieClip [__Packages.mx.core.ext.UIComponentExtensions] Frame 0
class mx.core.ext.UIComponentExtensions
{
function UIComponentExtensions () {
}
static function Extensions() {
if (bExtended == true) {
return(true);
}
bExtended = true;
TextField.prototype.setFocus = function () {
Selection.setFocus(this);
};
TextField.prototype.onSetFocus = function (oldFocus) {
if (this.tabEnabled != false) {
if (this.getFocusManager().bDrawFocus) {
this.drawFocus(true);
}
}
};
TextField.prototype.onKillFocus = function (oldFocus) {
if (this.tabEnabled != false) {
this.drawFocus(false);
}
};
TextField.prototype.drawFocus = mx.core.UIComponent.prototype.drawFocus;
TextField.prototype.getFocusManager = mx.core.UIComponent.prototype.getFocusManager;
mx.managers.OverlappedWindows.enableOverlappedWindows();
mx.styles.CSSSetStyle.enableRunTimeCSS();
mx.managers.FocusManager.enableFocusManagement();
}
static var bExtended = false;
static var UIComponentExtended = Extensions();
static var UIComponentDependency = mx.core.UIComponent;
static var FocusManagerDependency = mx.managers.FocusManager;
static var OverlappedWindowsDependency = mx.managers.OverlappedWindows;
}