[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (346 B)
_global.GAMEID = "evilnights";
_global.GAME_ID = "evilnights";
_global.LC = new LocalConnection();
FORMAT01 = new TextFormat();
FORMAT01.bold = true;
FORMAT01.font = "avquest";
_global.FORMAT01 = FORMAT01;
_global.LOADSOUND = new Sound();
_global.LOADSOUND.setVolume(0);
MochiAd.showPreloaderAd({id:"8bbd9153e6f1d9e9", res:"700x600"});
Frame 2 (23 B)
gotoAndStop ("dummy");
Frame 11 (1 B)
Frame 20 (23 B)
gotoAndStop ("sound");
Frame 30 (78 B)
stopAllSounds();
_global.LOADSOUND.setVolume(100);
gotoAndStop ("splash1");
Frame 40 (8 B)
stop();
Frame 50 (8 B)
stop();
Frame 60 (95 B)
stop();
stopAllSounds();
_global.LOADSOUND.setVolume(100);
_global.SHOWINSTRUCTIONS = true;
Symbol 7 MovieClip [Defaults] Frame 1 (86 B)
#initclip 50
Object.registerClass("Defaults", mx.skins.halo.Defaults);
#endinitclip
Symbol 8 MovieClip [UIObjectExtensions] Frame 1 (104 B)
#initclip 51
Object.registerClass("UIObjectExtensions", mx.core.ext.UIObjectExtensions);
#endinitclip
Symbol 9 MovieClip [UIObject] Frame 1 (90 B)
#initclip 52
Object.registerClass("UIObject", mx.core.UIObject);
#endinitclip
stop();
Symbol 10 MovieClip [Border] Frame 1 (87 B)
#initclip 53
Object.registerClass("Border", mx.skins.Border);
#endinitclip
stop();
Symbol 11 MovieClip [RectBorder] Frame 1 (200 B)
#initclip 54
mx.skins.SkinElement.registerElement(mx.skins.RectBorder.symbolName, Object(mx.skins.RectBorder));
Object.registerClass("RectBorder", mx.skins.halo.RectBorder);
#endinitclip
stop();
Symbol 14 Button (51 B)
on (keyPress "<Tab>") {
this.tabHandler();
}
Symbol 15 MovieClip Frame 1 (245 B)
#initclip 55
Object.registerClass("FocusManager", mx.managers.FocusManager);
if (_root.focusManager == undefined) {
_root.createClassObject(mx.managers.FocusManager, "focusManager", mx.managers.DepthManager.highestDepth--);
}
#endinitclip
Symbol 18 MovieClip [FocusRect] Frame 1 (88 B)
#initclip 56
Object.registerClass("FocusRect", mx.skins.halo.FocusRect);
#endinitclip
Symbol 19 MovieClip [FocusManager] Frame 1 (102 B)
#initclip 57
Object.registerClass("FocusManager", mx.managers.FocusManager);
#endinitclip
stop();
Symbol 20 MovieClip [UIComponentExtensions] Frame 1 (110 B)
#initclip 58
Object.registerClass("UIComponentExtensions", mx.core.ext.UIComponentExtensions);
#endinitclip
Symbol 21 MovieClip [UIComponent] Frame 1 (96 B)
#initclip 59
Object.registerClass("UIComponent", mx.core.UIComponent);
#endinitclip
stop();
Symbol 22 MovieClip [TextInput] Frame 1 (96 B)
#initclip 60
Object.registerClass("TextInput", mx.controls.TextInput);
#endinitclip
stop();
Symbol 45 MovieClip [View] Frame 1 (82 B)
#initclip 61
Object.registerClass("View", mx.core.View);
#endinitclip
stop();
Symbol 46 MovieClip [Loader] Frame 1 (90 B)
#initclip 62
Object.registerClass("Loader", mx.controls.Loader);
#endinitclip
stop();
Symbol 53 MovieClip [CheckThemeColor1] Frame 1 (63 B)
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 64 MovieClip [CheckBoxAssets] Frame 1 (528 B)
#initclip 63
mx.controls.CheckBox.prototype.adjustFocusRect = function () {
var _local4 = this._parent.focus_mc;
var _local2 = this.iconName;
var _local3 = this.getStyle("themeColor");
if (_local3 == undefined) {
_local3 = 8453965 /* 0x80FF4D */;
}
var _local8 = _local2._width + 4;
var _local5 = _local2._height + 4;
_local4.setSize(_local8, _local5, 0, 100, _local3);
var _local7 = _local2._x;
var _local6 = _local2._y;
_local4.move((this.x - 2) + _local7, (this.y + _local6) - 2);
};
#endinitclip
Symbol 66 MovieClip [BrdrShdw] Frame 1 (64 B)
mx.skins.ColoredSkinElement.setColorStyle(this, "shadowColor");
Symbol 68 MovieClip [BrdrFace] Frame 1 (64 B)
mx.skins.ColoredSkinElement.setColorStyle(this, "buttonColor");
Symbol 71 MovieClip [BrdrBlk] Frame 1 (64 B)
mx.skins.ColoredSkinElement.setColorStyle(this, "borderColor");
Symbol 73 MovieClip [BrdrHilght] Frame 1 (67 B)
mx.skins.ColoredSkinElement.setColorStyle(this, "highlightColor");
Symbol 76 MovieClip [SimpleButton] Frame 1 (102 B)
#initclip 64
Object.registerClass("SimpleButton", mx.controls.SimpleButton);
#endinitclip
stop();
Symbol 77 MovieClip [ButtonSkin] Frame 1 (90 B)
#initclip 65
Object.registerClass("ButtonSkin", mx.skins.halo.ButtonSkin);
#endinitclip
Symbol 78 MovieClip [Button] Frame 1 (90 B)
#initclip 66
Object.registerClass("Button", mx.controls.Button);
#endinitclip
stop();
Instance of Symbol 76 MovieClip [SimpleButton] in Symbol 78 MovieClip [Button] Frame 2 (152 B)
//component parameters
onClipEvent (initialize) {
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 79 MovieClip [CheckBox] Frame 1 (94 B)
#initclip 67
Object.registerClass("CheckBox", mx.controls.CheckBox);
#endinitclip
stop();
Instance of Symbol 78 MovieClip [Button] in Symbol 79 MovieClip [CheckBox] Frame 2 (210 B)
//component parameters
onClipEvent (initialize) {
icon = "";
label = "Button";
labelPlacement = "right";
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 86 MovieClip [RadioThemeColor1] Frame 1 (63 B)
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 90 MovieClip [RadioThemeColor2] Frame 1 (63 B)
mx.skins.ColoredSkinElement.setColorStyle(this, "themeColor");
Symbol 96 MovieClip [RadioButtonAssets] Frame 1 (531 B)
#initclip 68
mx.controls.RadioButton.prototype.adjustFocusRect = function () {
var _local4 = this._parent.focus_mc;
var _local2 = this.iconName;
var _local3 = this.getStyle("themeColor");
if (_local3 == undefined) {
_local3 = 8453965 /* 0x80FF4D */;
}
var _local5 = _local2._width + 4;
var _local6 = _local2._height + 4;
_local4.setSize(_local5, _local6, 8, 100, _local3);
var _local8 = _local2._x;
var _local7 = _local2._y;
_local4.move((this.x - 2) + _local8, (this.y + _local7) - 2);
};
#endinitclip
Symbol 97 MovieClip [RadioButton] Frame 1 (100 B)
#initclip 69
Object.registerClass("RadioButton", mx.controls.RadioButton);
#endinitclip
stop();
Instance of Symbol 78 MovieClip [Button] "foo" in Symbol 97 MovieClip [RadioButton] Frame 2 (210 B)
//component parameters
onClipEvent (initialize) {
icon = "";
label = "Button";
labelPlacement = "right";
selected = false;
toggle = false;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 100 MovieClip Frame 1 (8 B)
stop();
Symbol 3048 MovieClip [__Packages.MochiAd] Frame 0 (13.71 KiB) ● ●
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("1.5");
}
static function showPreloaderAd(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();
}};
options = _parseOptions(options, _local27);
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_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 = function (width, height) {
};
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) {
_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 showTimedAd(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();
}};
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_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.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) {
_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 _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 _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local25);
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 _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
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) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
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 _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
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 _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_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++;
}
}
return(_local4);
}
}
Symbol 3049 MovieClip [__Packages.numbers] Frame 0 (1.66 KiB) ●
class numbers
{
function numbers () {
}
static function format(_AMOUNT) {
var _local5;
var _local3;
var _local1;
var _local2;
var _local4;
var _local6;
_local5 = "";
_local4 = _AMOUNT / 1000000;
_local4 = Math.floor(_local4);
if (_local4 > 0) {
_local3 = _local4 + ",";
if (_local3.length == 2) {
_local3 = "00" + _local3;
}
if (_local3.length == 3) {
_local3 = "0" + _local3;
}
_local5 = _local5 + _local3;
_AMOUNT = _AMOUNT - (_local4 * 1000000);
}
_local6 = _AMOUNT / 1000;
_local6 = Math.floor(_local6);
if ((_local6 > 0) || (_local4 > 0)) {
_local1 = _local6 + ",";
if (_local5.length > 0) {
if (_local1.length == 2) {
_local1 = "00" + _local1;
}
if (_local1.length == 3) {
_local1 = "0" + _local1;
}
}
_local5 = _local5 + _local1;
_AMOUNT = _AMOUNT - (_local6 * 1000);
}
_local2 = String(Math.round(_AMOUNT));
if (_local5.length > 0) {
if (_local2.length == 1) {
_local2 = "00" + _local2;
}
if (_local2.length == 2) {
_local2 = "0" + _local2;
}
}
_local5 = _local5 + _local2;
return(_local5);
}
static function formatSeconds(_AMOUNT) {
var _local4;
var _local3;
var _local1;
var _local2;
_local4 = "";
_local2 = _AMOUNT / 60;
_local2 = Math.floor(_local2);
_local3 = _local2 + ":";
if (_local3.length == 2) {
_local3 = "0" + _local3;
}
_local4 = _local4 + _local3;
_AMOUNT = _AMOUNT - (_local2 * 60);
_local1 = String(_AMOUNT);
if (_local1.length == 1) {
_local1 = "0" + _local1;
}
_local4 = _local4 + _local1;
return(_local4);
}
}
Symbol 3050 MovieClip [__Packages.aiGroundUnit2] Frame 0 (7.42 KiB) ● ●
class aiGroundUnit2 extends MovieClip
{
var INDEX, IDLE, GOLEFT, GORIGHT, JUMPLEFT, JUMPRIGHT, DEAD, MSTATE, ALIVE, JUMPACC, TARGETY, FRAMESICED, SIDE, BODYORIENTATION, BODY, _x, TARGETX, SPEED, JUMPSPEED, STARTJUMPSPEED, _y, _width, _height, SPAWNCOUNT, CURPOISONBALL, attachMovie, getNextHighestDepth, ICEDAMAGE, ME, HEALTHPCT, HFACTOR, HEALTHBAR;
function aiGroundUnit2 () {
super();
INDEX = 1;
IDLE = INDEX++;
GOLEFT = INDEX++;
GORIGHT = INDEX++;
JUMPLEFT = INDEX++;
JUMPRIGHT = INDEX++;
DEAD = INDEX++;
MSTATE = IDLE;
ALIVE = true;
JUMPACC = 1;
TARGETY = 367;
FRAMESICED = 0;
}
function nextState() {
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED > 0) {
return(undefined);
}
switch (MSTATE) {
case IDLE :
movementDecision();
break;
case GOLEFT :
stateGoLeft();
break;
case GORIGHT :
stateGoRight();
break;
case JUMPLEFT :
stateJumpLeft();
break;
case JUMPRIGHT :
stateJumpRight();
}
}
function setLeft() {
SIDE = 2;
BODYORIENTATION.gotoAndStop(1);
}
function setRight() {
SIDE = 1;
BODYORIENTATION.gotoAndStop(2);
}
function movementDecision() {
if ((MSTATE != GORIGHT) && (MSTATE != GOLEFT)) {
BODY.run();
}
var _local3 = _global.HERO._x - _x;
if (_local3 < 0) {
TARGETX = (_global.HERO._x - 100) - Math.round(300 * Math.random());
MSTATE = GOLEFT;
setLeft();
} else {
TARGETX = (_global.HERO._x + 100) + Math.round(300 * Math.random());
MSTATE = GORIGHT;
setRight();
}
}
function stateGoLeft() {
_x = _x - SPEED;
var _local3 = _x - _global.HERO._x;
if ((_local3 > 0) && (_local3 <= 150)) {
startJump(JUMPLEFT);
return(undefined);
}
if (_x < TARGETX) {
movementDecision();
}
}
function stateGoRight() {
_x = _x + SPEED;
var _local3 = _global.HERO._x - _x;
if ((_local3 > 0) && (_local3 <= 150)) {
startJump(JUMPRIGHT);
return(undefined);
}
if (_x > TARGETX) {
movementDecision();
}
}
function startJump(_JUMPSIDE) {
MSTATE = _JUMPSIDE;
JUMPSPEED = STARTJUMPSPEED;
BODY.jumpUp();
}
function stateJumpLeft() {
_x = _x - SPEED;
JUMPSPEED = JUMPSPEED + JUMPACC;
if (JUMPSPEED < 0) {
BODY.jumpUp();
} else {
BODY.jumpDown();
}
if ((_y + JUMPSPEED) > TARGETY) {
_y = TARGETY;
MSTATE = GOLEFT;
BODY.run();
} else {
_y = _y + JUMPSPEED;
}
_global.HERO.underMeleeAttack(this);
}
function stateJumpRight() {
_x = _x + SPEED;
JUMPSPEED = JUMPSPEED + JUMPACC;
if (JUMPSPEED < 0) {
BODY.jumpUp();
} else {
BODY.jumpDown();
}
if ((_y + JUMPSPEED) > TARGETY) {
_y = TARGETY;
MSTATE = GORIGHT;
BODY.run();
} else {
_y = _y + JUMPSPEED;
}
_global.HERO.underMeleeAttack(this);
}
function underAttack(_PROJ) {
if (!ALIVE) {
return(undefined);
}
var _local10 = _x - (_width / 2);
var _local8 = _x + (_width / 2);
var _local14 = _PROJ._x - (_PROJ._width / 4);
var _local12 = _PROJ._x + (_PROJ._width / 4);
if (((_local14 < _local8) && (_local14 > _local10)) || ((_local12 < _local8) && (_local12 > _local10))) {
var _local9 = _y - (_height / 2);
var _local7 = _y;
var _local13 = _PROJ._y - (_PROJ._height / 4);
var _local11 = _PROJ._y + (_PROJ._height / 4);
if (((_local13 < _local7) && (_local13 > _local9)) || ((_local11 < _local7) && (_local11 > _local9))) {
if (FRAMESICED > 0) {
_PROJ.DAMAGE = _PROJ.DAMAGE * 3;
}
if (_PROJ.POISONFRAMES > 0) {
SPAWNCOUNT++;
if (CURPOISONBALL == undefined) {
CURPOISONBALL = attachMovie("poisonCloud", ("poisonCloud" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
CURPOISONBALL._x = 0;
CURPOISONBALL._y = 0;
CURPOISONBALL.FRAMESCOUNT = _PROJ.POISONFRAMES;
CURPOISONBALL.DAMAGE = _PROJ.DAMAGE;
CURPOISONBALL.UNIT = this;
} else {
CURPOISONBALL.FRAMESCOUNT = CURPOISONBALL.FRAMESCOUNT + _PROJ.POISONFRAMES;
}
} else if (_PROJ.ICEFRAMES > 0) {
FRAMESICED = FRAMESICED + _PROJ.ICEFRAMES;
ICEDAMAGE = _PROJ.DAMAGE;
_global.SCENEMANAGER.SPAWNCOUNT++;
var _local5 = _global.SCENEMANAGER.SCENE.attachMovie("coldblast", ("coldblast" + String(_global.SCENEMANAGER.SPAWNCOUNT)) + "_mc", _global.SCENEMANAGER.SCENE.getNextHighestDepth());
_local5._x = _PROJ._x;
_local5._y = _PROJ._y;
ME.ice();
} else {
if (_PROJ.DAMAGEHEALTH) {
_global.HERO.addHealth(_PROJ.DAMAGE);
SPAWNCOUNT++;
var _local4 = attachMovie("blood", ("blood" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
_local4._x = 0;
_local4._y = 0;
} else if (_PROJ.ARROW == undefined) {
_global.SCENEMANAGER.SPAWNCOUNT++;
var _local6 = _global.SCENEMANAGER.SCENE.attachMovie("flameblast", ("flameblast" + String(_global.SCENEMANAGER.SPAWNCOUNT)) + "_mc", _global.SCENEMANAGER.SCENE.getNextHighestDepth());
_local6._x = _PROJ._x;
_local6._y = _PROJ._y;
}
HEALTHPCT = HEALTHPCT - ((_PROJ.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
return(true);
}
}
return(false);
}
function underLightningAttack(_LIGHTNING) {
if (!ALIVE) {
return(undefined);
}
var _local5 = _x - (_width / 2);
var _local4 = _x + (_width / 2);
var _local7 = _LIGHTNING._x - 75;
var _local6 = _LIGHTNING._x + 75;
if (((_local7 < _local4) && (_local7 > _local5)) || ((_local6 < _local4) && (_local6 > _local5))) {
if (FRAMESICED > 0) {
_LIGHTNING.DAMAGE = _LIGHTNING.DAMAGE * 3;
}
SPAWNCOUNT++;
var _local2 = attachMovie("sparks", ("sparks" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
_local2._x = 0;
_local2._y = 0;
HEALTHPCT = HEALTHPCT - ((_LIGHTNING.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
}
function underFirewall(_FIREWALL) {
if (!ALIVE) {
return(undefined);
}
var _local4 = _x - (_width / 2);
var _local3 = _x + (_width / 2);
var _local6 = _FIREWALL._x - 50;
var _local5 = _FIREWALL._x + 50;
if (((_local6 < _local3) && (_local6 > _local4)) || ((_local5 < _local3) && (_local5 > _local4))) {
var _local9 = _y - (_height / 2);
var _local7 = _y;
var _local8 = _FIREWALL._y - _FIREWALL._height;
var _local10 = _FIREWALL._y;
if (_local8 < _local7) {
if (FRAMESICED > 0) {
_FIREWALL.DAMAGE = _FIREWALL.DAMAGE * 3;
}
HEALTHPCT = HEALTHPCT - ((_FIREWALL.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
}
}
function poisonUnit(_DAMAGE) {
HEALTHPCT = HEALTHPCT - ((_DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
function iceDamage() {
HEALTHPCT = HEALTHPCT - ((ICEDAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
}
Symbol 3051 MovieClip [__Packages.aiGroundUnit1] Frame 0 (7.47 KiB) ● ●
class aiGroundUnit1 extends MovieClip
{
var ALIVE, TARGETY, FRAMESICED, INDEX, IDLE, GOLEFT, GORIGHT, MSTATE, AHEROINTERVAL, SIDE, BODYORIENTATION, _x, BODY, TARGETX, SPEED, _width, _height, _y, SPAWNCOUNT, CURPOISONBALL, attachMovie, getNextHighestDepth, ICEDAMAGE, ME, HEALTHPCT, HFACTOR, HEALTHBAR, DAMAGEHERO, PROJTYPE;
function aiGroundUnit1 () {
super();
ALIVE = true;
TARGETY = 61;
FRAMESICED = 0;
INDEX = 0;
IDLE = INDEX++;
GOLEFT = INDEX++;
GORIGHT = INDEX++;
MSTATE = IDLE;
_global.EVTMANAGER.evt(AHEROINTERVAL, attackHero, this);
}
function nextState() {
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED > 0) {
return(undefined);
}
switch (MSTATE) {
case IDLE :
movementDecision();
break;
case GOLEFT :
stateGoLeft();
break;
case GORIGHT :
stateGoRight();
}
}
function setLeft() {
SIDE = 2;
BODYORIENTATION.gotoAndStop(1);
}
function setRight() {
SIDE = 1;
BODYORIENTATION.gotoAndStop(2);
}
function movementDecision() {
var _local3 = _global.HERO._x - _x;
if (_local3 < 0) {
if (Math.abs(_local3) <= 300) {
MSTATE = IDLE;
BODY.ready();
} else {
TARGETX = (_global.HERO._x + 100) + Math.round(200 * Math.random());
if ((MSTATE != GORIGHT) && (MSTATE != GOLEFT)) {
BODY.run();
}
MSTATE = GOLEFT;
setLeft();
}
} else if (Math.abs(_local3) <= 300) {
MSTATE = IDLE;
BODY.ready();
} else {
TARGETX = (_global.HERO._x - 100) - Math.round(200 * Math.random());
if ((MSTATE != GORIGHT) && (MSTATE != GOLEFT)) {
BODY.run();
}
MSTATE = GORIGHT;
setRight();
}
}
function stateGoLeft() {
_x = _x - SPEED;
setLeft();
var _local3 = _x - _global.HERO._x;
if ((_x < TARGETX) || (_local3 <= 150)) {
movementDecision();
}
}
function stateGoRight() {
_x = _x + SPEED;
setRight();
var _local3 = _global.HERO._x - _x;
if ((_x > TARGETX) || (_local3 <= 150)) {
movementDecision();
}
}
function underAttack(_PROJ) {
if (!ALIVE) {
return(undefined);
}
var _local10 = _x - (_width / 2);
var _local8 = _x + (_width / 2);
var _local14 = _PROJ._x - (_PROJ._width / 4);
var _local12 = _PROJ._x + (_PROJ._width / 4);
if (((_local14 < _local8) && (_local14 > _local10)) || ((_local12 < _local8) && (_local12 > _local10))) {
var _local9 = _y - (_height / 2);
var _local7 = _y;
var _local13 = _PROJ._y - (_PROJ._height / 4);
var _local11 = _PROJ._y + (_PROJ._height / 4);
if (((_local13 < _local7) && (_local13 > _local9)) || ((_local11 < _local7) && (_local11 > _local9))) {
if (FRAMESICED > 0) {
_PROJ.DAMAGE = _PROJ.DAMAGE * 3;
}
if (_PROJ.POISONFRAMES > 0) {
SPAWNCOUNT++;
if (CURPOISONBALL == undefined) {
CURPOISONBALL = attachMovie("poisonCloud", ("poisonCloud" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
CURPOISONBALL._x = 0;
CURPOISONBALL._y = 0;
CURPOISONBALL.FRAMESCOUNT = _PROJ.POISONFRAMES;
CURPOISONBALL.DAMAGE = _PROJ.DAMAGE;
CURPOISONBALL.UNIT = this;
} else {
CURPOISONBALL.FRAMESCOUNT = CURPOISONBALL.FRAMESCOUNT + _PROJ.POISONFRAMES;
}
} else if (_PROJ.ICEFRAMES > 0) {
FRAMESICED = FRAMESICED + _PROJ.ICEFRAMES;
ICEDAMAGE = _PROJ.DAMAGE;
_global.SCENEMANAGER.SPAWNCOUNT++;
var _local5 = _global.SCENEMANAGER.SCENE.attachMovie("coldblast", ("coldblast" + String(_global.SCENEMANAGER.SPAWNCOUNT)) + "_mc", _global.SCENEMANAGER.SCENE.getNextHighestDepth());
_local5._x = _PROJ._x;
_local5._y = _PROJ._y;
ME.ice();
} else {
if (_PROJ.DAMAGEHEALTH) {
_global.HERO.addHealth(_PROJ.DAMAGE);
SPAWNCOUNT++;
var _local4 = attachMovie("blood", ("blood" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
_local4._x = 0;
_local4._y = 0;
} else if (_PROJ.ARROW == undefined) {
_global.SCENEMANAGER.SPAWNCOUNT++;
var _local6 = _global.SCENEMANAGER.SCENE.attachMovie("flameblast", ("flameblast" + String(_global.SCENEMANAGER.SPAWNCOUNT)) + "_mc", _global.SCENEMANAGER.SCENE.getNextHighestDepth());
_local6._x = _PROJ._x;
_local6._y = _PROJ._y;
}
HEALTHPCT = HEALTHPCT - ((_PROJ.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
return(true);
}
}
return(false);
}
function underLightningAttack(_LIGHTNING) {
if (!ALIVE) {
return(undefined);
}
var _local5 = _x - (_width / 2);
var _local4 = _x + (_width / 2);
var _local7 = _LIGHTNING._x - 75;
var _local6 = _LIGHTNING._x + 75;
if (((_local7 < _local4) && (_local7 > _local5)) || ((_local6 < _local4) && (_local6 > _local5))) {
if (FRAMESICED > 0) {
_LIGHTNING.DAMAGE = _LIGHTNING.DAMAGE * 3;
}
SPAWNCOUNT++;
var _local2 = attachMovie("sparks", ("sparks" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
_local2._x = 0;
_local2._y = 0;
HEALTHPCT = HEALTHPCT - ((_LIGHTNING.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
}
function underFirewall(_FIREWALL) {
if (!ALIVE) {
return(undefined);
}
var _local4 = _x - (_width / 2);
var _local3 = _x + (_width / 2);
var _local6 = _FIREWALL._x - 50;
var _local5 = _FIREWALL._x + 50;
if (((_local6 < _local3) && (_local6 > _local4)) || ((_local5 < _local3) && (_local5 > _local4))) {
var _local9 = _y - (_height / 2);
var _local7 = _y;
var _local8 = _FIREWALL._y - _FIREWALL._height;
var _local10 = _FIREWALL._y;
if (_local8 < _local7) {
if (FRAMESICED > 0) {
_FIREWALL.DAMAGE = _FIREWALL.DAMAGE * 3;
}
HEALTHPCT = HEALTHPCT - ((_FIREWALL.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
}
}
function attackHero() {
if ((!ALIVE) || (_global.INTERFACE.MISSIONFAILED)) {
return(undefined);
}
_global.EVTMANAGER.evt(AHEROINTERVAL, attackHero, this);
if (_global.INTERFACE.GAMEPAUSED) {
return(undefined);
}
if (FRAMESICED > 0) {
return(undefined);
}
var _local4 = {NAME:PROJTYPE, DAMAGE:DAMAGEHERO};
var _local3 = _global.SCENEMANAGER.findArcherNear(this);
if (_local3 != undefined) {
if (_local3._x < _x) {
setLeft();
} else {
setRight();
}
_global.SCENEMANAGER.addUnitToArcherProjectile(this, _local3, _local4);
} else {
var _local5 = Math.abs(_global.SCENEMANAGER.HERO._x - _x);
if (_local5 > 350) {
return(undefined);
}
if (_global.SCENEMANAGER.HERO._x < _x) {
setLeft();
} else {
setRight();
}
_global.SCENEMANAGER.addUnitProjectile(this, _local4);
}
}
function poisonUnit(_DAMAGE) {
HEALTHPCT = HEALTHPCT - ((_DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
function iceDamage() {
HEALTHPCT = HEALTHPCT - ((ICEDAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
}
Symbol 3052 MovieClip [__Packages.aiFlyUnit] Frame 0 (12.13 KiB) ● ●
class aiFlyUnit extends MovieClip
{
var INDEX, IDLE, GOLEFT, GORIGHT, GOOUT, GOTOHOUSE, GOOUTDIE, ATTACKHOUSE, TAKEPERSON, CREATINGSPELL, DEAD, MSTATE, ALIVE, FRAMESICED, ATTACKSCOUNT, AHOUSEINTERVAL, AHEROINTERVAL, SIDE, BODYORIENTATION, TARGETX, BODY, _x, SPEED, TARGETY, _y, HOUSETOATTACK, ME, _width, _height, SPAWNCOUNT, CURPOISONBALL, attachMovie, getNextHighestDepth, ICEDAMAGE, HEALTHPCT, HFACTOR, HEALTHBAR, CREATEUNITFACTOR, DAMAGEHERO, PROJTYPE, GROUNDUNITSQTY, GROUNDUNIT1, GROUNDUNIT2, GROUNDUNIT3, CREATEUNITBALL, DAMAGEHOUSE;
function aiFlyUnit () {
super();
INDEX = 1;
IDLE = INDEX++;
GOLEFT = INDEX++;
GORIGHT = INDEX++;
GOOUT = INDEX++;
GOTOHOUSE = INDEX++;
GOOUTDIE = INDEX++;
ATTACKHOUSE = INDEX++;
TAKEPERSON = INDEX++;
CREATINGSPELL = INDEX++;
DEAD = INDEX++;
MSTATE = IDLE;
ALIVE = true;
FRAMESICED = 0;
ATTACKSCOUNT = 0;
_global.EVTMANAGER.evt(AHOUSEINTERVAL, attackHouse, this);
_global.EVTMANAGER.evt(AHEROINTERVAL, attackHero, this);
}
function nextState() {
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED > 0) {
return(undefined);
}
switch (MSTATE) {
case IDLE :
movementDecision();
break;
case GOLEFT :
stateGoLeft();
break;
case GORIGHT :
stateGoRight();
break;
case GOOUT :
stateGoOut();
break;
case GOOUTDIE :
stateGoOutDie();
break;
case GOTOHOUSE :
stateGoToHouse();
}
}
function setLeft() {
SIDE = 2;
BODYORIENTATION.gotoAndStop(1);
}
function setRight() {
SIDE = 1;
BODYORIENTATION.gotoAndStop(2);
}
function movementDecision() {
if (!ALIVE) {
return(undefined);
}
var _local3 = _global.SCENEMANAGER.XMAX - _global.SCENEMANAGER.XMIN;
TARGETX = _global.SCENEMANAGER.XMIN + Math.round(_local3 * Math.random());
if ((MSTATE != GORIGHT) && (MSTATE != GOLEFT)) {
BODY.fly();
}
if (_x < TARGETX) {
MSTATE = GORIGHT;
setRight();
} else {
MSTATE = GOLEFT;
setLeft();
}
}
function stateGoLeft() {
_x = _x - SPEED;
if ((_y + SPEED) < TARGETY) {
_y = _y + SPEED;
} else if ((_y - SPEED) > TARGETY) {
_y = _y - SPEED;
} else {
_y = TARGETY;
}
if (_x < TARGETX) {
movementDecision();
}
}
function stateGoRight() {
_x = _x + SPEED;
if ((_y + SPEED) < TARGETY) {
_y = _y + SPEED;
} else if ((_y - SPEED) > TARGETY) {
_y = _y - SPEED;
} else {
_y = TARGETY;
}
if (_x > TARGETX) {
movementDecision();
}
}
function stateGoOut() {
_y = _y - SPEED;
if (_y < -300) {
movementDecision();
_global.EVTMANAGER.evt(AHOUSEINTERVAL, attackHouse, this);
}
}
function stateGoToHouse() {
var _local4 = false;
var _local3 = false;
if (_y <= (HOUSETOATTACK._y + 44)) {
_y = _y + SPEED;
if (SIDE == 2) {
if (_x > (HOUSETOATTACK._x + 100)) {
_x = _x - SPEED;
} else {
_local3 = true;
}
} else if (_x < (HOUSETOATTACK._x + 100)) {
_x = _x + SPEED;
} else {
_local3 = true;
}
} else {
_local4 = true;
if (SIDE == 2) {
if (_x > (HOUSETOATTACK._x + 100)) {
_x = _x - SPEED;
} else {
_local3 = true;
}
} else if (_x < (HOUSETOATTACK._x + 100)) {
_x = _x + SPEED;
} else {
_local3 = true;
}
}
if (_local3 && (_local4)) {
if (HOUSETOATTACK.PROTECTED) {
if (HOUSETOATTACK.HEALTH > 0) {
MSTATE = ATTACKHOUSE;
BODY.attackHouse();
if (_x < (HOUSETOATTACK._x + 100)) {
setRight();
} else {
setLeft();
}
} else {
movementDecision();
}
} else if (HOUSETOATTACK.PEOPLEIN > 0) {
MSTATE = TAKEPERSON;
BODY.takePerson();
_global.JUKEBOX.playSound1("sound_takeperson");
if (_x < (HOUSETOATTACK._x + 100)) {
setRight();
} else {
setLeft();
}
} else {
movementDecision();
}
}
}
function stateGoOutDie() {
_y = _y - SPEED;
if (_y < -50) {
ME.die();
}
}
function underAttack(_PROJ) {
if (!ALIVE) {
return(undefined);
}
var _local10 = _x - (_width / 5);
var _local8 = _x + (_width / 5);
var _local14 = _PROJ._x - (_PROJ._width / 4);
var _local12 = _PROJ._x + (_PROJ._width / 4);
if (((_local14 < _local8) && (_local14 > _local10)) || ((_local12 < _local8) && (_local12 > _local10))) {
var _local9 = _y - (_height / 4);
var _local7 = _y;
var _local13 = _PROJ._y - (_PROJ._height / 4);
var _local11 = _PROJ._y + (_PROJ._height / 4);
if (((_local13 < _local7) && (_local13 > _local9)) || ((_local11 < _local7) && (_local11 > _local9))) {
if (FRAMESICED > 0) {
_PROJ.DAMAGE = _PROJ.DAMAGE * 3;
}
if (_PROJ.POISONFRAMES > 0) {
SPAWNCOUNT++;
if (CURPOISONBALL == undefined) {
CURPOISONBALL = attachMovie("poisonCloud", ("poisonCloud" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
CURPOISONBALL._x = 0;
CURPOISONBALL._y = 0;
CURPOISONBALL.FRAMESCOUNT = _PROJ.POISONFRAMES;
CURPOISONBALL.DAMAGE = _PROJ.DAMAGE;
CURPOISONBALL.UNIT = this;
} else {
CURPOISONBALL.FRAMESCOUNT = CURPOISONBALL.FRAMESCOUNT + _PROJ.POISONFRAMES;
}
} else if (_PROJ.ICEFRAMES > 0) {
FRAMESICED = FRAMESICED + _PROJ.ICEFRAMES;
ICEDAMAGE = _PROJ.DAMAGE;
_global.SCENEMANAGER.SPAWNCOUNT++;
var _local5 = _global.SCENEMANAGER.SCENE.attachMovie("coldblast", ("coldblast" + String(_global.SCENEMANAGER.SPAWNCOUNT)) + "_mc", _global.SCENEMANAGER.SCENE.getNextHighestDepth());
_local5._x = _PROJ._x;
_local5._y = _PROJ._y;
ME.ice();
} else {
if (_PROJ.DAMAGEHEALTH) {
_global.HERO.addHealth(_PROJ.DAMAGE);
SPAWNCOUNT++;
var _local4 = attachMovie("blood", ("blood" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
_local4._x = 0;
_local4._y = 0;
} else if (_PROJ.ARROW == undefined) {
_global.SCENEMANAGER.SPAWNCOUNT++;
var _local6 = _global.SCENEMANAGER.SCENE.attachMovie("flameblast", ("flameblast" + String(_global.SCENEMANAGER.SPAWNCOUNT)) + "_mc", _global.SCENEMANAGER.SCENE.getNextHighestDepth());
_local6._x = _PROJ._x;
_local6._y = _PROJ._y;
}
HEALTHPCT = HEALTHPCT - ((_PROJ.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
return(true);
}
}
return(false);
}
function underLightningAttack(_LIGHTNING) {
if (!ALIVE) {
return(undefined);
}
var _local5 = _x - (_width / 4);
var _local4 = _x + (_width / 4);
var _local7 = _LIGHTNING._x - 50;
var _local6 = _LIGHTNING._x + 50;
if (((_local7 < _local4) && (_local7 > _local5)) || ((_local6 < _local4) && (_local6 > _local5))) {
if (FRAMESICED > 0) {
_LIGHTNING.DAMAGE = _LIGHTNING.DAMAGE * 3;
}
SPAWNCOUNT++;
var _local2 = attachMovie("sparks", ("sparks" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
_local2._x = 0;
_local2._y = 0;
HEALTHPCT = HEALTHPCT - ((_LIGHTNING.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
}
function underFirewall(_FIREWALL) {
if (!ALIVE) {
return(undefined);
}
var _local6 = _x - (_width / 2);
var _local4 = _x + (_width / 2);
var _local10 = _FIREWALL._x - 100;
var _local8 = _FIREWALL._x + 100;
if (((_local10 < _local4) && (_local10 > _local6)) || ((_local8 < _local4) && (_local8 > _local6))) {
var _local5 = _y - (_height / 2);
var _local3 = _y;
var _local9 = _FIREWALL._y - _FIREWALL._height;
var _local7 = _FIREWALL._y;
if (((_local9 < _local3) && (_local9 > _local5)) || ((_local7 < _local3) && (_local7 > _local5))) {
if (FRAMESICED > 0) {
_FIREWALL.DAMAGE = _FIREWALL.DAMAGE * 3;
}
HEALTHPCT = HEALTHPCT - ((_FIREWALL.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
}
}
function attackHero() {
if ((!ALIVE) || (_global.INTERFACE.MISSIONFAILED)) {
return(undefined);
}
_global.EVTMANAGER.evt(AHEROINTERVAL, attackHero, this);
if ((((((MSTATE == GOTOHOUSE) || (MSTATE == ATTACKHOUSE)) || (MSTATE == TAKEPERSON)) || (MSTATE == CREATINGSPELL)) || (MSTATE == GOOUT)) || (_global.INTERFACE.GAMEPAUSED)) {
return(undefined);
}
if (FRAMESICED > 0) {
return(undefined);
}
MSTATE = CREATINGSPELL;
var _local4 = ATTACKSCOUNT % CREATEUNITFACTOR;
var _local3;
if (_global.CGAME.DIFFICULTY == 1) {
_local3 = 1;
} else if (_global.CGAME.DIFFICULTY == 2) {
_local3 = 2;
} else {
_local3 = 3;
}
if (((ATTACKSCOUNT > 0) && (_local4 == 0)) && (_global.SCENEMANAGER.GROUNDUNITS.length <= _local3)) {
BODY.startSpell("createUnit");
} else {
BODY.startSpell("createProjectile");
}
}
function sendProjectile() {
if (!ALIVE) {
return(undefined);
}
MSTATE = IDLE;
if (FRAMESICED > 0) {
return(undefined);
}
ATTACKSCOUNT++;
movementDecision();
var _local4 = {NAME:PROJTYPE, DAMAGE:DAMAGEHERO};
var _local3 = _global.SCENEMANAGER.findArcherNear(this);
if (_local3 != undefined) {
_global.SCENEMANAGER.addUnitToArcherProjectile(this, _local3, _local4);
} else {
var _local5 = Math.abs(_global.SCENEMANAGER.HERO._x - _x);
if (_local5 > 350) {
return(undefined);
}
_global.SCENEMANAGER.addUnitProjectile(this, _local4);
}
}
function sendUnit() {
if (!ALIVE) {
return(undefined);
}
MSTATE = IDLE;
if (FRAMESICED > 0) {
return(undefined);
}
ATTACKSCOUNT++;
movementDecision();
var _local7 = {NAME:PROJTYPE, DAMAGE:DAMAGEHERO};
var _local3;
switch (GROUNDUNITSQTY) {
case 1 :
_local3 = GROUNDUNIT1;
break;
case 2 :
if (Math.random() >= 0.5) {
_local3 = GROUNDUNIT1;
} else {
_local3 = GROUNDUNIT2;
}
break;
case 3 :
var _local4 = Math.random();
if (_local4 >= 0.666) {
_local3 = GROUNDUNIT1;
} else if (Math.random() >= 0.333) {
_local3 = GROUNDUNIT2;
} else {
_local3 = GROUNDUNIT3;
}
}
_global.SCENEMANAGER.addProjGroundUnit(this, _local3, CREATEUNITBALL);
}
function attackHouse() {
if ((!ALIVE) || (MSTATE == GOOUTDIE)) {
return(undefined);
}
if (((((MSTATE == GOTOHOUSE) || (MSTATE == ATTACKHOUSE)) || (MSTATE == TAKEPERSON)) || (MSTATE == GOOUT)) || (_global.INTERFACE.MISSIONFAILED)) {
return(undefined);
}
if ((_global.INTERFACE.GAMEPAUSED || (FRAMESICED > 0)) || (MSTATE == CREATINGSPELL)) {
_global.EVTMANAGER.evt(AHOUSEINTERVAL, attackHouse, this);
return(undefined);
}
HOUSETOATTACK = _global.SCENEMANAGER.getNearestHouse(this);
if (HOUSETOATTACK != undefined) {
MSTATE = GOTOHOUSE;
} else {
_global.EVTMANAGER.evt(AHOUSEINTERVAL, attackHouse, this);
}
}
function hitHouse() {
if (HOUSETOATTACK.HEALTH > 0) {
_global.JUKEBOX.playSound1("sound_hithouse");
HOUSETOATTACK.damageHouse(DAMAGEHOUSE);
}
}
function doneAttackHouse() {
movementDecision();
_global.EVTMANAGER.evt(AHOUSEINTERVAL, attackHouse, this);
}
function doneTakePerson() {
if (HOUSETOATTACK.PEOPLEIN > 0) {
MSTATE = GOOUT;
HOUSETOATTACK.takePerson();
} else {
movementDecision();
}
}
function poisonUnit(_DAMAGE) {
if (!ALIVE) {
return(undefined);
}
HEALTHPCT = HEALTHPCT - ((_DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
function iceDamage() {
if (!ALIVE) {
return(undefined);
}
HEALTHPCT = HEALTHPCT - ((ICEDAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTHPCT));
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
}
}
Symbol 3053 MovieClip [__Packages.aiHero] Frame 0 (12.31 KiB) ● ●
class aiHero extends MovieClip
{
var ME, EVTMANAGER, CONTROLS, ALIVE, ISHITTED, ONTRANSPORT, APPEARDISAPPEAR, HFACTOR, HEALTHPCT, HEALTHINC, MFACTOR, MANAPCT, MANAINC, JUMPACC, AIRJUMP, SPEED, JUMPSPEED, READY, STARTWALK, WALK, STARTJUMP, JUMP, STARTFLY, FLY, KNEEL, HITTED, DEAD, CSTATE, FRAMECOUNT, CURHEIGHT, ONSPELL, SPAWNCOUNT, DOJUMP, _y, MARKERR, BODY, _x, localToGlobal, MARKERL, SIDE, BODYORIENTATION, _width, attachMovie, getNextHighestDepth, CURSPELLOBJ;
function aiHero () {
super();
ME = this;
_global.HERO = this;
EVTMANAGER = _global.EVTMANAGER;
CONTROLS = _global.CONTROLS;
ALIVE = true;
ISHITTED = false;
ONTRANSPORT = false;
APPEARDISAPPEAR = false;
HFACTOR = _global.CGAME.HFACTOR;
HEALTHPCT = _global.CGAME.HEALTHPCT;
HEALTHINC = _global.CGAME.HEALTHINC;
MFACTOR = _global.CGAME.MFACTOR;
MANAPCT = _global.CGAME.MANAPCT;
MANAINC = _global.CGAME.MANAINC;
JUMPACC = 1;
AIRJUMP = 1;
SPEED = 8;
JUMPSPEED = 0;
var _local4 = 1;
READY = _local4++;
STARTWALK = _local4++;
WALK = _local4++;
STARTJUMP = _local4++;
JUMP = _local4++;
STARTFLY = _local4++;
FLY = _local4++;
KNEEL = _local4++;
HITTED = _local4++;
DEAD = _local4++;
CSTATE = READY;
FRAMECOUNT = 0;
CURHEIGHT = 85;
ONSPELL = false;
Key.addListener(this);
SPAWNCOUNT = 0;
DOJUMP = true;
}
function ready() {
_y = MARKERR._y;
CSTATE = READY;
BODY.ready();
}
function nextState() {
FRAMECOUNT++;
if (!ALIVE) {
return(undefined);
}
changeSide();
if (ONTRANSPORT || (APPEARDISAPPEAR)) {
return(undefined);
}
if (Key.isDown(40) || (Key.isDown(83))) {
if ((CSTATE != STARTJUMP) && (CSTATE != JUMP)) {
if (CSTATE != KNEEL) {
CSTATE = KNEEL;
BODY.kneel();
}
}
} else if (CSTATE == KNEEL) {
CSTATE = READY;
BODY.ready();
}
if ((((ME._xmouse <= (ME._width / 2)) && (ME._xmouse >= (-(ME._width / 2)))) && (ME._ymouse >= (-ME._height))) && (ME._ymouse <= 0)) {
_global.CURSOR.heartOnUnit();
_global.SCENEMANAGER.ARCHEROVER = ME;
} else if (_global.SCENEMANAGER.ARCHEROVER == ME) {
_global.CURSOR.heartOffUnit();
_global.SCENEMANAGER.ARCHEROVER = undefined;
}
switch (CSTATE) {
case READY :
stateReady();
break;
case STARTWALK :
stateStartWalk();
break;
case WALK :
stateWalk();
break;
case STARTJUMP :
stateStartJump();
break;
case JUMP :
stateJump();
}
}
function onKeyUp() {
if ((!Key.isDown(87)) && (!Key.isDown(38))) {
DOJUMP = true;
}
}
function onKeyDown() {
if (_global.INTERFACE.GAMEPAUSED) {
return(undefined);
}
if (CSTATE == HITTED) {
return(undefined);
}
if (CSTATE == DEAD) {
return(undefined);
}
if (ONTRANSPORT || (APPEARDISAPPEAR)) {
return(undefined);
}
var _local3 = Key.getCode();
if (DOJUMP) {
if (Key.isDown(87) || (Key.isDown(38))) {
DOJUMP = false;
if (CSTATE == JUMP) {
if (AIRJUMP > 0) {
AIRJUMP--;
CSTATE = STARTJUMP;
}
} else {
CSTATE = STARTJUMP;
}
}
}
}
function changeSide() {
if (_x > _global.SCENEMANAGER.SCENE._xmouse) {
setLeft();
} else if (_x < _global.SCENEMANAGER.SCENE._xmouse) {
setRight();
}
}
function stateReady() {
var _local2 = 0;
if (Key.isDown(65) || (Key.isDown(37))) {
_local2 = _local2 + (-SPEED);
}
if (Key.isDown(68) || (Key.isDown(39))) {
_local2 = _local2 + SPEED;
}
if (_local2 != 0) {
CSTATE = STARTWALK;
stateStartWalk();
}
}
function stateStartWalk() {
var _local2 = 0;
if (Key.isDown(65) || (Key.isDown(37))) {
_local2 = _local2 + (-SPEED);
}
if (Key.isDown(68) || (Key.isDown(39))) {
_local2 = _local2 + SPEED;
}
if (_local2 != 0) {
CSTATE = WALK;
BODY.walk();
stateWalk();
} else {
CSTATE = READY;
}
}
function stateWalk() {
var _local3 = 0;
var _local4 = 0;
if (Key.isDown(65) || (Key.isDown(37))) {
_local3 = _local3 + (-SPEED);
}
if (Key.isDown(68) || (Key.isDown(39))) {
_local3 = _local3 + SPEED;
}
if (_local3 == 0) {
CSTATE = READY;
BODY.ready();
return(undefined);
}
if (_local3 == 0) {
CSTATE = READY;
BODY.ready();
return(undefined);
}
var _local5 = new flash.geom.Point(0, 0);
localToGlobal(_local5);
if (((_local3 < 0) && (_global.SCENEMANAGER.canSlideRight())) && (_local5.x < 320)) {
_global.SCENEMANAGER.slideRight(-_local3);
} else if (((_local3 > 0) && (_global.SCENEMANAGER.canSlideLeft())) && (_local5.x > 380)) {
_global.SCENEMANAGER.slideLeft(_local3);
}
if (_local3 < 0) {
_local4 = _x - MARKERL._x;
if (_local4 < 100) {
_local3 = 0;
}
}
if (_local3 > 0) {
_local4 = MARKERR._x - _x;
if (_local4 < 100) {
_local3 = 0;
}
}
_x = _x + _local3;
}
function stateStartJump() {
JUMPSPEED = -18;
CSTATE = JUMP;
BODY.jump();
stateJump();
}
function stateJump() {
var _local3 = 0;
var _local4 = 0;
if (Key.isDown(65) || (Key.isDown(37))) {
_local3 = _local3 + (-SPEED);
}
if (Key.isDown(68) || (Key.isDown(39))) {
_local3 = _local3 + SPEED;
}
var _local5 = new flash.geom.Point(0, 0);
localToGlobal(_local5);
if (((_local3 < 0) && (_global.SCENEMANAGER.canSlideRight())) && (_local5.x < 320)) {
_global.SCENEMANAGER.slideRight(-_local3);
} else if (((_local3 > 0) && (_global.SCENEMANAGER.canSlideLeft())) && (_local5.x > 380)) {
_global.SCENEMANAGER.slideLeft(_local3);
}
if (_local3 < 0) {
_local4 = _x - MARKERL._x;
if (_local4 < 100) {
_local3 = 0;
}
}
if (_local3 > 0) {
_local4 = MARKERR._x - _x;
if (_local4 < 100) {
_local3 = 0;
}
}
_x = _x + _local3;
JUMPSPEED = JUMPSPEED + JUMPACC;
if ((_y + JUMPSPEED) > MARKERL._y) {
_y = MARKERL._y;
doneJump();
} else {
_y = _y + JUMPSPEED;
}
}
function doneJump() {
var _local2 = 0;
if (Key.isDown(65) || (Key.isDown(37))) {
_local2 = _local2 + (-SPEED);
}
if (Key.isDown(68) || (Key.isDown(39))) {
_local2 = _local2 + SPEED;
}
if (_local2 != 0) {
CSTATE = STARTWALK;
stateStartWalk();
} else {
CSTATE = READY;
BODY.ready();
}
AIRJUMP = 1;
}
function death() {
BODY.death();
}
function setLeft() {
SIDE = 2;
BODYORIENTATION.gotoAndStop(1);
}
function setRight() {
SIDE = 1;
BODYORIENTATION.gotoAndStop(2);
}
function getStaffXPosition() {
if (SIDE == 1) {
return(_x + 30);
}
return(_x - 30);
}
function getStaffYPosition() {
return(_y - (CURHEIGHT - 5));
}
function underAttack(_PROJ) {
if (!ALIVE) {
return(undefined);
}
if (ONTRANSPORT || (APPEARDISAPPEAR)) {
return(undefined);
}
if (_global.CGAME.NOTDIE) {
return(undefined);
}
var _local8 = _x - 30;
var _local6 = _x + 30;
var _local12 = _PROJ._x - (_PROJ._width / 4);
var _local10 = _PROJ._x + (_PROJ._width / 4);
if (((_local12 < _local6) && (_local12 > _local8)) || ((_local10 < _local6) && (_local10 > _local8))) {
var _local7 = _y - CURHEIGHT;
var _local5 = _y;
var _local11 = _PROJ._y - (_PROJ._height / 4);
var _local9 = _PROJ._y + (_PROJ._height / 4);
if (((_local11 < _local5) && (_local11 > _local7)) || ((_local9 < _local5) && (_local9 > _local7))) {
HEALTHPCT = HEALTHPCT - ((_PROJ.DAMAGE / HFACTOR) * 100);
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
_global.SCENEMANAGER.SPAWNCOUNT++;
var _local4 = _global.SCENEMANAGER.SCENE.attachMovie("flameblast2", ("flameblast2" + String(_global.SCENEMANAGER.SPAWNCOUNT)) + "_mc", _global.SCENEMANAGER.SCENE.getNextHighestDepth());
_local4._x = _PROJ._x;
_local4._y = _PROJ._y;
return(true);
}
}
return(false);
}
function underMeleeAttack(_GROUNDUNIT) {
if (!ALIVE) {
return(undefined);
}
if (ONTRANSPORT || (APPEARDISAPPEAR)) {
return(undefined);
}
if (_global.CGAME.NOTDIE) {
return(undefined);
}
if (ISHITTED) {
return(undefined);
}
var _local12 = _x - (_width / 4);
var _local10 = _x + (_width / 4);
var _local6 = _GROUNDUNIT._x - (_GROUNDUNIT._width / 4);
var _local5 = _GROUNDUNIT._x + (_GROUNDUNIT._width / 4);
if (((_local6 < _local10) && (_local6 > _local12)) || ((_local5 < _local10) && (_local5 > _local12))) {
var _local11 = _y - CURHEIGHT;
var _local9 = _y;
var _local8 = _GROUNDUNIT._y;
var _local7 = _GROUNDUNIT._y + (_GROUNDUNIT._height / 2);
if (((_local8 < _local9) && (_local8 > _local11)) || ((_local7 < _local9) && (_local7 > _local11))) {
HEALTHPCT = HEALTHPCT - ((_GROUNDUNIT.DAMAGEHERO / HFACTOR) * 100);
if (HEALTHPCT <= 0) {
ME.die();
} else {
ME.hitted();
}
SPAWNCOUNT++;
var _local4 = attachMovie("blood", ("blood" + String(SPAWNCOUNT)) + "_mc", getNextHighestDepth());
_local4._x = 0;
_local4._y = -30;
return(true);
}
}
return(false);
}
function addHealth(_HEALTH) {
HEALTHPCT = HEALTHPCT + ((_HEALTH / HFACTOR) * 100);
if (HEALTHPCT > 100) {
HEALTHPCT = 100;
}
}
function addMana(_MANA) {
MANAPCT = MANAPCT + ((_MANA / MFACTOR) * 100);
if (MANAPCT > 100) {
MANAPCT = 100;
}
}
function addHealthPct(_HEALTHPCT) {
HEALTHPCT = HEALTHPCT + _HEALTHPCT;
if (HEALTHPCT > 100) {
HEALTHPCT = 100;
}
}
function addManaPct(_MANAPCT) {
MANAPCT = MANAPCT + _MANAPCT;
if (MANAPCT > 100) {
MANAPCT = 100;
}
}
function die() {
ALIVE = false;
CSTATE = DEAD;
BODY.die();
_y = MARKERR._y;
_global.EVTMANAGER.evt(72, callGameOver, this);
}
function callGameOver() {
_global.INTERFACE.gameOver(2);
}
function startSpell(_SPELLOBJ) {
if (ONSPELL) {
return(undefined);
}
ONSPELL = true;
CURSPELLOBJ = _SPELLOBJ;
BODY.startSpell(_SPELLOBJ);
}
function sendSpell() {
ONSPELL = false;
CURSPELLOBJ.MOUSEX = _global.INTERFACE._xmouse;
CURSPELLOBJ.MOUSEY = _global.INTERFACE._ymouse;
_global.SCENEMANAGER.addHeroProjectile(CURSPELLOBJ);
}
function sendLightning() {
if (CURSPELLOBJ.STRIKES == 1) {
ONSPELL = false;
}
CURSPELLOBJ.MOUSEX = _global.INTERFACE._xmouse;
CURSPELLOBJ.MOUSEY = _global.INTERFACE._ymouse;
_global.BGTIME.lightningOn();
_global.JUKEBOX.playSound1("sound_lightning");
_global.SCENEMANAGER.addHeroLightning(CURSPELLOBJ.DAMAGE);
var _local4;
var _local3 = 1;
while (_local3 < CURSPELLOBJ.STRIKES) {
_local4 = false;
if (_local3 == (CURSPELLOBJ.STRIKES - 1)) {
_local4 = true;
}
_global.EVTMANAGER.evt(24 * _local3, addLightning, this, _local4);
_local3++;
}
if (CURSPELLOBJ.STRIKES == 1) {
_global.EVTMANAGER.evt(24, lightningOff, this);
}
}
function addLightning(_ISLAST) {
if (_ISLAST) {
ONSPELL = false;
_global.EVTMANAGER.evt(24, lightningOff, this);
}
_global.JUKEBOX.playSound1("sound_lightning");
_global.SCENEMANAGER.addHeroLightning(CURSPELLOBJ.DAMAGE);
}
function lightningOff() {
_global.BGTIME.lightningOff();
}
function createFirewall() {
ONSPELL = false;
CURSPELLOBJ.MOUSEX = _global.INTERFACE._xmouse;
CURSPELLOBJ.MOUSEY = _global.INTERFACE._ymouse;
_global.SCENEMANAGER.addFireWall(CURSPELLOBJ);
}
function startTransport(_SPELLOBJ) {
ONSPELL = true;
APPEARDISAPPEAR = true;
CURSPELLOBJ = _SPELLOBJ;
BODY.disappear();
}
function doneDisappear() {
ONTRANSPORT = true;
APPEARDISAPPEAR = false;
BODY.fly();
_global.INTERFACE.setMessage("Arrows or AD to move. Click to appear.");
}
function doneAppear() {
ONSPELL = false;
APPEARDISAPPEAR = false;
ready();
_global.INTERFACE.hideMessage();
}
function endTransport() {
ONTRANSPORT = false;
APPEARDISAPPEAR = true;
BODY.appear();
}
function repairHouse() {
ONSPELL = false;
_global.SCENEMANAGER.HOUSEOVER.addHealth(CURSPELLOBJ.ADDHEALTH);
}
function healUnit() {
ONSPELL = false;
_global.SCENEMANAGER.ARCHEROVER.addHealthPct(CURSPELLOBJ.ADDHEALTH);
}
}
Symbol 3054 MovieClip [__Packages.gameControls] Frame 0 (945 B)
class gameControls
{
var CCHANGED, JUMPKEY, MOVEUP, MOVELEFT, MOVEDOWN, MOVERIGHT;
function gameControls () {
CCHANGED = false;
JUMPKEY = 32;
MOVEUP = 38;
MOVELEFT = 65;
MOVEDOWN = 83;
MOVERIGHT = 68;
}
static function saveControls(_CONTROLS) {
var _local1 = SharedObject.getLocal("qigames_sc_controls");
_local1.data.CONTROLS = _CONTROLS;
_local1.flush();
}
static function setControls() {
var _local3 = SharedObject.getLocal("qigames_sc_controls");
var _local2 = new gameControls();
if (_local3.data.CONTROLS != undefined) {
_local2.CCHANGED = _local3.data.CONTROLS.CCHANGED;
_local2.JUMPKEY = _local3.data.CONTROLS.JUMPKEY;
_local2.MOVEUP = _local3.data.CONTROLS.MOVEUP;
_local2.MOVELEFT = _local3.data.CONTROLS.MOVELEFT;
_local2.MOVEDOWN = _local3.data.CONTROLS.MOVEDOWN;
_local2.MOVERIGHT = _local3.data.CONTROLS.MOVERIGHT;
}
_global.CONTROLS = _local2;
}
}
Symbol 3055 MovieClip [__Packages.aiUnit] Frame 0 (501 B)
class aiUnit extends MovieClip
{
var ME, ALIVE, EVTMANAGER, SCENEMANAGER, LEFT, RIGHT, SIDE, BODYORIENTATION;
function aiUnit () {
super();
ME = this;
ALIVE = true;
EVTMANAGER = _global.EVTMANAGER;
SCENEMANAGER = _global.SCENEMANAGER;
LEFT = 1;
RIGHT = 2;
SIDE = RIGHT;
}
function setRight() {
SIDE = RIGHT;
BODYORIENTATION.gotoAndStop(1);
}
function setLeft() {
SIDE = LEFT;
BODYORIENTATION.gotoAndStop(2);
}
static var R2D = 57.2957795130823;
}
Symbol 3056 MovieClip [__Packages.aiTowerGuard] Frame 0 (4.54 KiB) ●
class aiTowerGuard extends aiUnit
{
var ALIVE, HEALTH, HEALTHPCT, AINTERVAL, TOWER, HFACTOR, PROJTYPE, DAMAGE, LEVELTEXT, HEALTHBAR, ME, UNITCHOSEN, _x, ANG, COM, setRight, BODY, setLeft, _width, _height, _y;
function aiTowerGuard () {
super();
ALIVE = true;
HEALTH = 100;
HEALTHPCT = HEALTH;
_global.EVTMANAGER.evt(2, init, this);
}
function init() {
refreshLevel();
_global.EVTMANAGER.evt(AINTERVAL, shoot, this);
_global.HERO.setDepthAbove(this);
}
function refreshLevel() {
switch (_global.CGAME.TOWERS[TOWER.TOWERIND][2]) {
case 1 :
HFACTOR = 100;
AINTERVAL = 192;
PROJTYPE = "arrow1";
DAMAGE = 10;
LEVELTEXT.text = "Level 1";
break;
case 2 :
HFACTOR = 150;
AINTERVAL = 168;
PROJTYPE = "arrow1";
DAMAGE = 15;
LEVELTEXT.text = "Level 2";
break;
case 3 :
HFACTOR = 200;
AINTERVAL = 144;
PROJTYPE = "arrow1";
DAMAGE = 20;
LEVELTEXT.text = "Level 3";
break;
case 4 :
HFACTOR = 250;
AINTERVAL = 120;
PROJTYPE = "arrow1";
DAMAGE = 25;
LEVELTEXT.text = "Level 4";
}
HEALTH = 100;
HEALTHPCT = HEALTH;
HEALTHBAR.setHealth(Math.round(HEALTH));
}
function nextState() {
if (!_global.CGAME.TOWERS[TOWER.TOWERIND][1]) {
return(undefined);
}
if ((((ME._xmouse <= (ME._width / 2)) && (ME._xmouse >= (-(ME._width / 2)))) && (ME._ymouse >= (-ME._height))) && (ME._ymouse <= 0)) {
_global.CURSOR.heartOnUnit();
_global.SCENEMANAGER.ARCHEROVER = ME;
} else if (_global.SCENEMANAGER.ARCHEROVER == ME) {
_global.CURSOR.heartOffUnit();
_global.SCENEMANAGER.ARCHEROVER = undefined;
}
if (selectUnit()) {
aim(UNITCHOSEN);
}
}
function selectUnit() {
if (UNITCHOSEN != undefined) {
var _local3 = Math.abs(UNITCHOSEN._x - _x);
if (_local3 < 400) {
return(true);
}
}
UNITCHOSEN = _global.SCENEMANAGER.findUnitNear(this);
if (UNITCHOSEN == undefined) {
return(false);
}
return(true);
}
function shoot() {
if ((!ALIVE) || (_global.INTERFACE.MISSIONFAILED)) {
return(undefined);
}
_global.EVTMANAGER.evt(AINTERVAL, shoot, this);
if ((_global.INTERFACE.GAMEPAUSED || (UNITCHOSEN == undefined)) || (!UNITCHOSEN.ALIVE)) {
return(undefined);
}
var _local3 = {NAME:PROJTYPE, DAMAGE:DAMAGE, ANG:ANG};
_global.SCENEMANAGER.addArcherProjectile(this, UNITCHOSEN, _local3);
}
function aim(_TARGETUNIT) {
var _local4 = new flash.geom.Point(0, 0);
_TARGETUNIT.COM.localToGlobal(_local4);
var _local5 = new flash.geom.Point(0, 0);
COM.localToGlobal(_local5);
var _local3 = _local4.x - _local5.x;
var _local2 = _local4.y - _local5.y;
if (_local3 > 0) {
setRight();
if (_local2 < 0) {
ANG = Math.atan2(_local2, _local3) * aiUnit.R2D;
var _local6 = 21 + Math.round((19 * ANG) / -90);
BODY.MC.gotoAndStop(_local6);
} else {
ANG = Math.atan2(_local2, _local3) * aiUnit.R2D;
var _local6 = 20 - Math.round((19 * ANG) / 90);
BODY.MC.gotoAndStop(_local6);
}
} else {
setLeft();
if (_local2 < 0) {
ANG = Math.atan2(_local2, _local3) * aiUnit.R2D;
var _local6 = 40 - Math.round((19 * (ANG + 90)) / -90);
BODY.MC.gotoAndStop(_local6);
} else {
ANG = Math.atan2(_local2, _local3) * aiUnit.R2D;
var _local6 = 1 + Math.round((19 * (ANG - 90)) / 90);
BODY.MC.gotoAndStop(_local6);
}
}
}
function underAttack(_PROJ) {
if (!ALIVE) {
return(undefined);
}
var _local6 = _x - (_width / 2);
var _local4 = _x + (_width / 2);
var _local10 = _PROJ._x - (_PROJ._width / 2);
var _local8 = _PROJ._x + (_PROJ._width / 2);
if (((_local10 < _local4) && (_local10 > _local6)) || ((_local8 < _local4) && (_local8 > _local6))) {
var _local5 = _y - (_height / 2);
var _local3 = _y;
var _local9 = _PROJ._y - (_PROJ._height / 2);
var _local7 = _PROJ._y + (_PROJ._height / 2);
if (((_local9 < _local3) && (_local9 > _local5)) || ((_local7 < _local3) && (_local7 > _local5))) {
HEALTH = HEALTH - ((_PROJ.DAMAGE / HFACTOR) * 100);
HEALTHBAR.setHealth(Math.round(HEALTH));
HEALTHPCT = HEALTH;
if (HEALTH <= 0) {
ME.die();
} else {
ME.hitted();
}
}
return(true);
}
return(false);
}
function addHealthPct(_ADDHEALTHPCT) {
HEALTH = HEALTH + _ADDHEALTHPCT;
if (HEALTH > 100) {
HEALTH = 100;
}
HEALTHPCT = HEALTH;
HEALTHBAR.setHealth(Math.round(HEALTH));
}
}
Symbol 3057 MovieClip [__Packages.gameData] Frame 0 (7.26 KiB) ● ●
class gameData
{
var PLAYERID, PLAYERNAME, LASTMODIFIED, CLEVEL, DIFFICULTY, HFACTOR, HEALTHPCT, HEALTHINC, CONSTLEVEL, STRENGLEVEL, CONSTLIST, STRENGLIST, MFACTOR, MANAPCT, MANAINC, WISDOMLEVEL, CONCENLEVEL, WISDOMLIST, CONCENLIST, MONEY, SPELLS, SPELLSCURLEVELS, NIGHTFRAMES, POPNB, HOUSES, TOWERS, CINTERVAL, MANAPOTIONS, HEALPOTIONS, NOTDIE, POWERFUL;
function gameData (_PLAYERNAME) {
var _local2 = new Date();
PLAYERID = String(_local2.getTime());
PLAYERID = PLAYERID + String(Math.round(Math.random() * 99999));
PLAYERNAME = _PLAYERNAME;
LASTMODIFIED = new Date();
CLEVEL = 1;
DIFFICULTY = 1;
HFACTOR = 200;
HEALTHPCT = 100;
HEALTHINC = 0.03;
CONSTLEVEL = 1;
STRENGLEVEL = 1;
CONSTLIST = [[0, 200], [400, 250], [600, 300], [800, 350], [1000, 400]];
STRENGLIST = [[0, 0.03], [400, 0.04], [600, 0.05], [800, 0.06], [1000, 0.07]];
MFACTOR = 200;
MANAPCT = 100;
MANAINC = 0.03;
WISDOMLEVEL = 1;
CONCENLEVEL = 1;
WISDOMLIST = [[0, 200], [400, 250], [600, 300], [800, 350], [1000, 400]];
CONCENLIST = [[0, 0.03], [400, 0.04], [600, 0.05], [800, 0.06], [1000, 0.07]];
MONEY = 1000;
SPELLS = [];
SPELLS.push(["fireballA", "projectile", true, 0.1, 10, 0, 0, false]);
SPELLS.push(["poisonball1", "projectile", false, 7, 1, 0, 24, false]);
SPELLS.push(["iceballA", "projectile", false, 10, 0.1, 48, 0, false]);
SPELLS.push(["bat1", "projectile", false, 20, 25, 0, 0, true]);
SPELLS.push(["firewall1", "firewall", false, 30, 10, 240]);
SPELLS.push(["lightning1", "lightning", false, 40, 50, 1]);
SPELLS.push(["repair1", "repair", true, 10, 10]);
SPELLS.push(["heal1", "heal", true, 10, 10]);
SPELLS.push(["transport1", "transport", false, 2.5]);
SPELLSCURLEVELS = [0, -1, -1, -1, -1, -1, 0, 0, -1];
NIGHTFRAMES = 2160;
POPNB = 6;
HOUSES = [];
HOUSES.push([true, 100, 3]);
HOUSES.push([true, 100, 3]);
HOUSES.push([false, 100, 0]);
HOUSES.push([false, 100, 0]);
HOUSES.push([false, 100, 0]);
HOUSES.push([false, 100, 0]);
HOUSES.push([false, 100, 0]);
HOUSES.push([false, 100, 0]);
HOUSES.push([false, 100, 0]);
HOUSES.push([false, 100, 0]);
TOWERS = [];
TOWERS.push([false, false, 1]);
TOWERS.push([false, false, 1]);
TOWERS.push([false, false, 1]);
TOWERS.push([false, false, 1]);
TOWERS.push([false, false, 1]);
TOWERS.push([false, false, 1]);
TOWERS.push([false, false, 1]);
TOWERS.push([false, false, 1]);
CINTERVAL = 36;
MANAPOTIONS = 0;
HEALPOTIONS = 0;
NOTDIE = false;
POWERFUL = false;
}
static function saveGame(_GAME) {
_global.CGAME.LASTMODIFIED = new Date();
_global.CGAME.HFACTOR = _global.HERO.HFACTOR;
_global.CGAME.HEALTHPCT = _global.HERO.HEALTHPCT;
_global.CGAME.HEALTHINC = _global.HERO.HEALTHINC;
_global.CGAME.MFACTOR = _global.HERO.MFACTOR;
_global.CGAME.MANAPCT = _global.HERO.MANAPCT;
_global.CGAME.MANAINC = _global.HERO.MANAINC;
_global.CGAME.SPELLS = _global.SPELLMANAGER.SPELLS;
copyGame(_global.CGAME, _global.TEMPGAME);
saveGames(_global.GAMES);
}
static function saveGames(_GAMES) {
var _local1 = SharedObject.getLocal(GAMEID);
_local1.data.GAMES = _GAMES;
_local1.flush();
}
static function newGame(_NAME) {
var _local1 = SharedObject.getLocal(GAMEID);
var _local3 = _local1.data.GAMES;
if (_local3 == undefined) {
_local1.data.GAMES = new Array();
}
var _local2 = new gameData(_name);
_local1.data.GAMES.push(_local2);
_local1.flush();
}
static function deleteGame(_INDEX) {
var _local1 = SharedObject.getLocal(GAMEID);
var _local2 = _local1.data.GAMES;
if (_INDEX < 0) {
return(undefined);
}
if (_INDEX > (_local2.length - 1)) {
return(undefined);
}
_local2.splice(_INDEX, 1);
_local1.flush();
}
static function getGames() {
var _local1 = SharedObject.getLocal(GAMEID);
var _local2 = _local1.data.GAMES;
if (_local2 == undefined) {
_local1.data.GAMES = [];
_local1.flush();
}
return(_local1.data.GAMES);
}
static function copyGame(_GAMETOCOPY, _GAMETOERASE) {
_GAMETOERASE.PLAYERID = _GAMETOCOPY.PLAYERID;
_GAMETOERASE.PLAYERNAME = _GAMETOCOPY.PLAYERNAME;
_GAMETOERASE.DIFFICULTY = _GAMETOCOPY.DIFFICULTY;
_GAMETOERASE.LASTMODIFIED = _GAMETOCOPY.LASTMODIFIED;
_GAMETOERASE.HFACTOR = _GAMETOCOPY.HFACTOR;
_GAMETOERASE.HEALTHPCT = _GAMETOCOPY.HEALTHPCT;
_GAMETOERASE.HEALTHINC = _GAMETOCOPY.HEALTHINC;
_GAMETOERASE.HLASTFRAMEINC = _GAMETOCOPY.HLASTFRAMEINC;
_GAMETOERASE.HFRAMEINC = _GAMETOCOPY.HFRAMEINC;
_GAMETOERASE.MFACTOR = _GAMETOCOPY.MFACTOR;
_GAMETOERASE.MANAPCT = _GAMETOCOPY.MANAPCT;
_GAMETOERASE.MANAINC = _GAMETOCOPY.MANAINC;
_GAMETOERASE.MLASTFRAMEINC = _GAMETOCOPY.MLASTFRAMEINC;
_GAMETOERASE.MFRAMEINC = _GAMETOCOPY.MFRAMEINC;
_GAMETOERASE.POPNB = _GAMETOCOPY.POPNB;
_GAMETOERASE.NIGHTFRAMES = _GAMETOCOPY.NIGHTFRAMES;
_GAMETOERASE.MONEY = _GAMETOCOPY.MONEY;
_GAMETOERASE.CINTERVAL = _GAMETOCOPY.CINTERVAL;
_GAMETOERASE.CONSTLEVEL = _GAMETOCOPY.CONSTLEVEL;
_GAMETOERASE.STRENGLEVEL = _GAMETOCOPY.STRENGLEVEL;
_GAMETOERASE.WISDOMLEVEL = _GAMETOCOPY.WISDOMLEVEL;
_GAMETOERASE.CONCENLEVEL = _GAMETOCOPY.CONCENLEVEL;
_GAMETOERASE.MANAPOTIONS = _GAMETOCOPY.MANAPOTIONS;
_GAMETOERASE.HEALPOTIONS = _GAMETOCOPY.HEALPOTIONS;
_GAMETOERASE.NOTDIE = _GAMETOCOPY.NOTDIE;
_GAMETOERASE.POWERFUL = _GAMETOCOPY.POWERFUL;
_GAMETOERASE.SPELLS = [];
var _local2 = 0;
while (_local2 < 4) {
_GAMETOERASE.SPELLS.push([_GAMETOCOPY.SPELLS[_local2][0], _GAMETOCOPY.SPELLS[_local2][1], _GAMETOCOPY.SPELLS[_local2][2], _GAMETOCOPY.SPELLS[_local2][3], _GAMETOCOPY.SPELLS[_local2][4], _GAMETOCOPY.SPELLS[_local2][5], _GAMETOCOPY.SPELLS[_local2][6], _GAMETOCOPY.SPELLS[_local2][7]]);
_local2++;
}
_GAMETOERASE.SPELLS.push([_GAMETOCOPY.SPELLS[4][0], _GAMETOCOPY.SPELLS[4][1], _GAMETOCOPY.SPELLS[4][2], _GAMETOCOPY.SPELLS[4][3], _GAMETOCOPY.SPELLS[4][4], _GAMETOCOPY.SPELLS[4][5]]);
_GAMETOERASE.SPELLS.push([_GAMETOCOPY.SPELLS[5][0], _GAMETOCOPY.SPELLS[5][1], _GAMETOCOPY.SPELLS[5][2], _GAMETOCOPY.SPELLS[5][3], _GAMETOCOPY.SPELLS[5][4], _GAMETOCOPY.SPELLS[5][5]]);
_GAMETOERASE.SPELLS.push([_GAMETOCOPY.SPELLS[6][0], _GAMETOCOPY.SPELLS[6][1], _GAMETOCOPY.SPELLS[6][2], _GAMETOCOPY.SPELLS[6][3], _GAMETOCOPY.SPELLS[6][4]]);
_GAMETOERASE.SPELLS.push([_GAMETOCOPY.SPELLS[7][0], _GAMETOCOPY.SPELLS[7][1], _GAMETOCOPY.SPELLS[7][2], _GAMETOCOPY.SPELLS[7][3], _GAMETOCOPY.SPELLS[7][4]]);
_GAMETOERASE.SPELLS.push([_GAMETOCOPY.SPELLS[8][0], _GAMETOCOPY.SPELLS[8][1], _GAMETOCOPY.SPELLS[8][2], _GAMETOCOPY.SPELLS[8][3]]);
_GAMETOERASE.HOUSES = [];
var _local4 = 0;
while (_local4 < _GAMETOCOPY.HOUSES.length) {
_GAMETOERASE.HOUSES.push([_GAMETOCOPY.HOUSES[_local4][0], _GAMETOCOPY.HOUSES[_local4][1], _GAMETOCOPY.HOUSES[_local4][2]]);
_local4++;
}
_GAMETOERASE.TOWERS = [];
_local4 = 0;
while (_local4 < _GAMETOCOPY.TOWERS.length) {
_GAMETOERASE.TOWERS.push([_GAMETOCOPY.TOWERS[_local4][0], _GAMETOCOPY.TOWERS[_local4][1], _GAMETOCOPY.TOWERS[_local4][2]]);
_local4++;
}
_GAMETOERASE.SPELLSCURLEVELS = [];
_local4 = 0;
while (_local4 < _GAMETOCOPY.SPELLSCURLEVELS.length) {
_GAMETOERASE.SPELLSCURLEVELS.push(_GAMETOCOPY.SPELLSCURLEVELS[_local4]);
_local4++;
}
}
static var GAMEID = "qigames_spellcaster";
}
Symbol 3058 MovieClip [__Packages.SceneManager] Frame 0 (21.41 KiB) ● ● ●
class SceneManager
{
var SCENE, HERO, UNITS, GROUNDUNITS, SPAWNCOUNT, CREATEDUNITS, HEROPROJECTILES, UNITSPROJECTILES, GROUNDUNITSPROJ, HEROLIGHTNINGS, HEROFIREWALLS, ARCHERS, COMPLETEDNIGHT, HOUSESMC, c, i, TLIST, STARTNIGHTPOP, TOWERSMC;
function SceneManager (_SCENE) {
SCENE = _SCENE;
HERO = SCENE.attachMovie("hero", "hero_mc", SCENE.getNextHighestDepth());
HERO._x = SCENE.PSTART._x;
HERO._y = SCENE.PSTART._y;
HERO.SIDE = 1;
HERO.MARKERL = SCENE.MARKERL;
HERO.MARKERR = SCENE.MARKERR;
UNITS = [];
GROUNDUNITS = [];
SPAWNCOUNT = 0;
CREATEDUNITS = 0;
_global.SPELLMANAGER = new spellManager();
HEROPROJECTILES = [];
UNITSPROJECTILES = [];
GROUNDUNITSPROJ = [];
HEROLIGHTNINGS = [];
HEROFIREWALLS = [];
ARCHERS = [];
init();
}
function init() {
Key.addListener(this);
COMPLETEDNIGHT = false;
if (_global.CGAME.DIFFICULTY == 1) {
_global.CGAME.CINTERVAL = 96;
} else if (_global.CGAME.DIFFICULTY == 2) {
_global.CGAME.CINTERVAL = 72;
} else {
_global.CGAME.CINTERVAL = 48;
}
_global.EVTMANAGER.evt(200, cleanUp, this);
}
function nextState() {
var _local3;
HERO.nextState();
var _local8 = 0;
while (_local8 < HOUSESMC.length) {
HOUSESMC[_local8].nextState();
_local8++;
}
if (_global.HERO.ONTRANSPORT) {
if (!_global.SPELLMANAGER.decreaseMana()) {
HERO.endTransport();
} else if (Key.isDown(68) || (Key.isDown(39))) {
if (canSlideLeft()) {
if ((HERO._x + 50) > HERO.MARKERR._x) {
HERO._x = HERO.MARKERR._x;
} else {
HERO._x = HERO._x + 50;
}
slideLeft(50);
_global.CURSOR.transportLeft();
}
} else if (Key.isDown(65) || (Key.isDown(37))) {
if (canSlideRight()) {
if ((HERO._x - 50) < HERO.MARKERL._x) {
HERO._x = HERO.MARKERL._x;
} else {
HERO._x = HERO._x - 50;
}
slideRight(50);
_global.CURSOR.transportRight();
}
}
}
_local3 = 0;
while (_local3 < ARCHERS.length) {
ARCHERS[_local3].nextState();
_local3++;
}
_local3 = 0;
while (_local3 < UNITS.length) {
UNITS[_local3].nextState();
_local3++;
}
var _local12 = [];
_local3 = 0;
while (_local3 < HEROPROJECTILES.length) {
HEROPROJECTILES[_local3]._x = HEROPROJECTILES[_local3]._x + HEROPROJECTILES[_local3].DIR.x;
HEROPROJECTILES[_local3]._y = HEROPROJECTILES[_local3]._y + HEROPROJECTILES[_local3].DIR.y;
if ((((HEROPROJECTILES[_local3]._x < 0) || (HEROPROJECTILES[_local3]._x > 4600)) || (HEROPROJECTILES[_local3]._y < 0)) || (HEROPROJECTILES[_local3]._y > 360)) {
var _local11 = new flash.geom.Point(0, 0);
HEROPROJECTILES[_local3].localToGlobal(_local11);
if (((_local11.y > 360) && (_local11.x > 0)) && (_local11.x < 700)) {
var _local7;
if (HEROPROJECTILES[_local3].ICEFRAMES > 0) {
_local7 = "coldblast";
} else if (HEROPROJECTILES[_local3].DAMAGEHEALTH) {
_local7 = "";
} else if (HEROPROJECTILES[_local3].POISONFRAMES > 0) {
_local7 = "";
} else {
_local7 = "flameblast";
}
if (_local7 != "") {
SPAWNCOUNT++;
var _local6 = SCENE.attachMovie(_local7, (_local7 + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local6._x = HEROPROJECTILES[_local3]._x;
_local6._y = HEROPROJECTILES[_local3]._y;
}
}
HEROPROJECTILES[_local3].removeMovieClip();
} else {
var _local10 = false;
var _local4 = 0;
while (_local4 < UNITS.length) {
if (UNITS[_local4].underAttack(HEROPROJECTILES[_local3])) {
_local10 = true;
HEROPROJECTILES[_local3].removeMovieClip();
break;
}
_local4++;
}
if (!_local10) {
_local12.push(HEROPROJECTILES[_local3]);
}
}
_local3++;
}
HEROPROJECTILES = _local12;
var _local15 = [];
_local3 = 0;
while (_local3 < UNITSPROJECTILES.length) {
UNITSPROJECTILES[_local3]._x = UNITSPROJECTILES[_local3]._x + UNITSPROJECTILES[_local3].DIR.x;
UNITSPROJECTILES[_local3]._y = UNITSPROJECTILES[_local3]._y + UNITSPROJECTILES[_local3].DIR.y;
if ((((UNITSPROJECTILES[_local3]._x < 0) || (UNITSPROJECTILES[_local3]._x > 4600)) || (UNITSPROJECTILES[_local3]._y < 0)) || (UNITSPROJECTILES[_local3]._y > 360)) {
var _local11 = new flash.geom.Point(0, 0);
UNITSPROJECTILES[_local3].localToGlobal(_local11);
if (((_local11.y > 360) && (_local11.x > 0)) && (_local11.x < 700)) {
SPAWNCOUNT++;
var _local6 = SCENE.attachMovie("flameblast2", ("flameblast2" + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local6._x = UNITSPROJECTILES[_local3]._x;
_local6._y = UNITSPROJECTILES[_local3]._y;
}
UNITSPROJECTILES[_local3].removeMovieClip();
} else if (HERO.underAttack(UNITSPROJECTILES[_local3])) {
UNITSPROJECTILES[_local3].removeMovieClip();
} else {
var _local9 = false;
var _local5 = 0;
while (_local5 < ARCHERS.length) {
if (ARCHERS[_local5].underAttack(UNITSPROJECTILES[_local3])) {
_local9 = true;
SPAWNCOUNT++;
var _local6 = SCENE.attachMovie("flameblast2", ("flameblast2" + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local6._x = UNITSPROJECTILES[_local3]._x;
_local6._y = UNITSPROJECTILES[_local3]._y;
UNITSPROJECTILES[_local3].removeMovieClip();
break;
}
_local5++;
}
if (!_local9) {
_local15.push(UNITSPROJECTILES[_local3]);
}
}
_local3++;
}
UNITSPROJECTILES = _local15;
var _local16 = [];
_local3 = 0;
while (_local3 < HEROLIGHTNINGS.length) {
HEROLIGHTNINGS[_local3].COUNTFRAMES--;
if (HEROLIGHTNINGS[_local3].COUNTFRAMES > 0) {
var _local4 = 0;
while (_local4 < UNITS.length) {
UNITS[_local4].underLightningAttack(HEROLIGHTNINGS[_local3]);
_local4++;
}
_local16.push(HEROLIGHTNINGS[_local3]);
}
_local3++;
}
HEROLIGHTNINGS = _local16;
var _local13 = [];
_local3 = 0;
while (_local3 < HEROFIREWALLS.length) {
HEROFIREWALLS[_local3].COUNTFRAMES--;
if (HEROFIREWALLS[_local3].COUNTFRAMES > 0) {
var _local4 = 0;
while (_local4 < UNITS.length) {
UNITS[_local4].underFirewall(HEROFIREWALLS[_local3]);
_local4++;
}
_local13.push(HEROFIREWALLS[_local3]);
} else {
HEROFIREWALLS[_local3].removeMovieClip();
}
_local3++;
}
HEROFIREWALLS = _local13;
var _local14 = [];
_local3 = 0;
while (_local3 < GROUNDUNITSPROJ.length) {
GROUNDUNITSPROJ[_local3]._y = GROUNDUNITSPROJ[_local3]._y + 10;
var _local11 = new flash.geom.Point(0, 0);
GROUNDUNITSPROJ[_local3].localToGlobal(_local11);
if (COMPLETEDNIGHT) {
GROUNDUNITSPROJ[_local3].removeMovieClip();
} else if (_local11.y > 360) {
createGroundEffect(GROUNDUNITSPROJ[_local3]);
GROUNDUNITSPROJ[_local3].removeMovieClip();
} else {
_local14.push(GROUNDUNITSPROJ[_local3]);
}
_local3++;
}
GROUNDUNITSPROJ = _local14;
}
function setUnitDifficulty(_UNIT) {
switch (_global.CGAME.DIFFICULTY) {
case 1 :
_UNIT.HFACTOR = Math.round(_UNIT.HFACTOR * 0.7);
_UNIT.DAMAGEHERO = Math.round(_UNIT.DAMAGEHERO * 0.7);
_UNIT.STARTJUMPSPEED = Math.round(_UNIT.STARTJUMPSPEED * 0.7);
_UNIT.SPEED = Math.round(_UNIT.SPEED * 0.7);
_UNIT.AHOUSEINTERVAL = Math.round(_UNIT.AHOUSEINTERVAL * 1.75);
_UNIT.AHEROINTERVAL = Math.round(_UNIT.AHEROINTERVAL * 1.75);
_UNIT.DAMAGEHOUSE = Math.round(_UNIT.DAMAGEHOUSE * 0.7);
_UNIT.CREATEUNITFACTOR = Math.round(_UNIT.CREATEUNITFACTOR * 1.5);
break;
case 2 :
_UNIT.HFACTOR = Math.round(_UNIT.HFACTOR * 0.7);
_UNIT.DAMAGEHERO = Math.round(_UNIT.DAMAGEHERO * 0.7);
_UNIT.STARTJUMPSPEED = Math.round(_UNIT.STARTJUMPSPEED * 0.7);
_UNIT.SPEED = Math.round(_UNIT.SPEED * 0.7);
_UNIT.AHOUSEINTERVAL = Math.round(_UNIT.AHOUSEINTERVAL * 1.5);
_UNIT.AHEROINTERVAL = Math.round(_UNIT.AHEROINTERVAL * 1.5);
_UNIT.DAMAGEHOUSE = Math.round(_UNIT.DAMAGEHOUSE * 0.9);
_UNIT.CREATEUNITFACTOR = Math.round(_UNIT.CREATEUNITFACTOR * 1.2);
break;
case 3 :
_UNIT.HFACTOR = Math.round(_UNIT.HFACTOR * 0.7);
}
}
function testMeleeHit(_HITX, _HITY, _DAMAGE, _NFRAMES) {
c = UNITS.length;
i = 0;
while (i < c) {
UNITS[i].testMeleeHit(_HITX, _HITY, _DAMAGE, _NFRAMES);
i++;
}
}
function underAttack(_PROJECTILE) {
}
function cleanUp() {
TLIST = [];
c = UNITS.length;
i = 0;
while (i < c) {
if (UNITS[i].ALIVE) {
TLIST.push(UNITS[i]);
} else if ((_global.INTERFACE.FRAMECOUNT - UNITS[i].FRAMECOUNT) > 100) {
UNITS[i].removeMovieClip();
}
i++;
}
UNITS = TLIST;
var _local3 = [];
c = ARCHERS.length;
i = 0;
while (i < c) {
if (ARCHERS[i].ALIVE) {
_local3.push(ARCHERS[i]);
} else if ((_global.INTERFACE.FRAMECOUNT - ARCHERS[i].FRAMECOUNT) > 20) {
ARCHERS[i].removeMovieClip();
}
i++;
}
ARCHERS = _local3;
_local3 = [];
c = GROUNDUNITS.length;
i = 0;
while (i < c) {
if (GROUNDUNITS[i].ALIVE) {
_local3.push(GROUNDUNITS[i]);
}
i++;
}
GROUNDUNITS = _local3;
_global.EVTMANAGER.evt(200, cleanUp, this);
}
function registerUnit(_UNIT) {
UNITS.push(_UNIT);
}
function registerElement(_E) {
}
function canSlideLeft() {
if (SCENE._x < -3890) {
return(false);
}
return(true);
}
function slideLeft(_MDX) {
if (_MDX == undefined) {
_MDX = HERO.SPEED;
}
if ((SCENE._x - _MDX) < -3890) {
SCENE._x = -3890;
} else {
SCENE._x = SCENE._x - _MDX;
}
}
function canSlideRight() {
if (SCENE._x > -10) {
return(false);
}
return(true);
}
function slideRight(_MDX) {
if (_MDX == undefined) {
_MDX = HERO.SPEED;
}
if ((SCENE._x + _MDX) > -10) {
SCENE._x = -10;
} else {
SCENE._x = SCENE._x + _MDX;
}
}
function addHeroProjectile(_PROJOBJ) {
var _local2;
var _local4 = new flash.geom.Point(0, 0);
var _local8 = HERO.getStaffXPosition();
var _local7 = HERO.getStaffYPosition();
var _local13 = _local8 - HERO._x;
var _local12 = _local7 - HERO._y;
HERO.localToGlobal(_local4);
var _local6 = _PROJOBJ.MOUSEX - (_local4.x + _local13);
var _local5 = _PROJOBJ.MOUSEY - (_local4.y + _local12);
var _local9 = new flash.geom.Point(_local6, _local5);
_local9.normalize(25);
SPAWNCOUNT++;
_local2 = SCENE.attachMovie(_PROJOBJ.NAME, (_PROJOBJ.NAME + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local2._x = _local8;
_local2._y = _local7;
_local2.DAMAGE = _PROJOBJ.DAMAGE;
_local2.ICEFRAMES = _PROJOBJ.ICEFRAMES;
_local2.POISONFRAMES = _PROJOBJ.POISONFRAMES;
_local2.DAMAGEHEALTH = _PROJOBJ.DAMAGEHEALTH;
_local2.DIR = _local9;
HEROPROJECTILES.push(_local2);
if (_PROJOBJ.NAME == "bat1") {
var _local11 = 57.2957795130823;
var _local10 = Math.atan2(_local5, _local6) * _local11;
_local2._rotation = _local10;
}
}
function addHeroLightning(_DAMAGE) {
var _local2;
SPAWNCOUNT++;
_local2 = SCENE.attachMovie("lightning1", ("lightning1" + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local2._x = SCENE._xmouse;
_local2._y = 367;
_local2.DAMAGE = _DAMAGE;
_local2.COUNTFRAMES = 9;
HEROLIGHTNINGS.push(_local2);
}
function addFireWall(_FIREWALL) {
var _local2;
SPAWNCOUNT++;
_local2 = SCENE.attachMovie("firewall1", ("firewall1" + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local2._x = SCENE._xmouse;
_local2._y = 367;
_local2.DAMAGE = _FIREWALL.DAMAGE;
_local2.COUNTFRAMES = _FIREWALL.COUNTFRAMES;
HEROFIREWALLS.push(_local2);
}
function addUnitProjectile(_UNIT, _PROJOBJ) {
var _local4;
if (_UNIT.FIREDX == undefined) {
_UNIT.FIREDX = 0;
}
if (_UNIT.FIREDY == undefined) {
_UNIT.FIREDY = 0;
}
var _local10 = HERO._x;
var _local9 = (HERO._y - HERO.CURHEIGHT) + 10;
var _local7 = _local10 - (_UNIT._x + _UNIT.FIREDX);
var _local6 = _local9 - (_UNIT._y + _UNIT.FIREDY);
var _local5 = new flash.geom.Point(_local7, _local6);
if (_global.CGAME.DIFFICULTY == 1) {
_local5.normalize(10);
} else if (_global.CGAME.DIFFICULTY == 2) {
_local5.normalize(15);
} else {
_local5.normalize(20);
}
SPAWNCOUNT++;
_local4 = SCENE.attachMovie(_PROJOBJ.NAME, (_PROJOBJ.NAME + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local4._x = _UNIT._x + _UNIT.FIREDX;
_local4._y = _UNIT._y + _UNIT.FIREDY;
_local4.DAMAGE = _PROJOBJ.DAMAGE;
_local4.DIR = _local5;
UNITSPROJECTILES.push(_local4);
}
function addUnitToArcherProjectile(_UNIT, _ARCHER, _PROJOBJ) {
var _local3;
if (_UNIT.FIREDX == undefined) {
_UNIT.FIREDX = 0;
}
if (_UNIT.FIREDY == undefined) {
_UNIT.FIREDY = 0;
}
var _local9 = _ARCHER._x;
var _local8 = _ARCHER._y - 43;
var _local6 = _local9 - (_UNIT._x + _UNIT.FIREDX);
var _local5 = _local8 - (_UNIT._y + _UNIT.FIREDY);
var _local4 = new flash.geom.Point(_local6, _local5);
_local4.normalize(15);
SPAWNCOUNT++;
_local3 = SCENE.attachMovie(_PROJOBJ.NAME, (_PROJOBJ.NAME + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local3._x = _UNIT._x + _UNIT.FIREDX;
_local3._y = _UNIT._y + _UNIT.FIREDY;
_local3.DAMAGE = _PROJOBJ.DAMAGE;
_local3.DIR = _local4;
UNITSPROJECTILES.push(_local3);
}
function addArcherProjectile(_ARCHERUNIT, _TARGETUNIT, _PROJOBJ) {
var _local2;
var _local9 = _TARGETUNIT._x;
var _local8 = _TARGETUNIT._y;
var _local7 = _local9 - _ARCHERUNIT._x;
var _local6 = _local8 - (_ARCHERUNIT._y - 43);
var _local4 = new flash.geom.Point(_local7, _local6);
_local4.normalize(20);
SPAWNCOUNT++;
_local2 = SCENE.attachMovie(_PROJOBJ.NAME, (_PROJOBJ.NAME + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local2._x = _ARCHERUNIT._x;
_local2._y = _ARCHERUNIT._y - 58;
_local2.DAMAGE = _PROJOBJ.DAMAGE;
_local2.DIR = _local4;
_local2.ARROW = true;
_local2._rotation = _PROJOBJ.ANG;
HEROPROJECTILES.push(_local2);
}
function addProjGroundUnit(_UNIT, _GROUNDUNITTYPE, _PROJTYPE) {
var _local2;
SPAWNCOUNT++;
_local2 = SCENE.attachMovie(_PROJTYPE, (_PROJTYPE + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local2._x = _UNIT._x;
_local2._y = _UNIT._y;
_local2.GROUNDUNITTYPE = _GROUNDUNITTYPE;
GROUNDUNITSPROJ.push(_local2);
}
function initNight() {
COMPLETEDNIGHT = false;
CREATEDUNITS = 0;
createUnit();
}
function completedNight() {
var _local3;
var _local5 = 6;
var _local4 = 0;
if (_global.CGAME.POPNB < 15) {
_local4 = 3;
} else if (_global.CGAME.POPNB < 30) {
_local4 = 4;
} else if (_global.CGAME.POPNB < 45) {
_local4 = 5;
} else if (_global.CGAME.POPNB < 60) {
_local4 = 6;
}
var _local7 = _local4;
var _local8 = STARTNIGHTPOP - _global.CGAME.POPNB;
var _local6 = false;
_global.CGAME.POPNB = _global.CGAME.POPNB + _local4;
_global.INTERFACE.refreshPeople();
if (_global.CGAME.POPNB >= 60) {
_global.JUKEBOX.begin(1);
_global.JUKEBOX.playSound2("sound_victory");
_global.INTERFACE.gameWin();
return(undefined);
}
while (_local4 > 0) {
_local3 = 0;
while (_local3 < _global.CGAME.HOUSES.length) {
if (_global.CGAME.HOUSES[_local3][0] && (_global.CGAME.HOUSES[_local3][2] < _local5)) {
if (_local4 > (_local5 - _global.CGAME.HOUSES[_local3][2])) {
_local4 = _local4 - (_local5 - _global.CGAME.HOUSES[_local3][2]);
_global.CGAME.HOUSES[_local3][2] = _local5;
} else {
_global.CGAME.HOUSES[_local3][2] = _global.CGAME.HOUSES[_local3][2] + _local4;
_local4 = 0;
}
HOUSESMC[_local3].refreshHouse();
if (_local4 <= 0) {
break;
}
}
_local3++;
}
if (_local4 > 0) {
_local3 = 0;
while (_local3 < _global.CGAME.HOUSES.length) {
if (!_global.CGAME.HOUSES[_local3][0]) {
_global.CGAME.HOUSES[_local3][0] = true;
if (_local4 > _local5) {
_global.CGAME.HOUSES[_local3][2] = _local5;
HOUSESMC[_local3].newHouse(_local5);
TOWERSMC[_local3 - 2].newTower();
_local6 = true;
_local4 = _local4 - _local5;
} else {
_global.CGAME.HOUSES[_local3][2] = _local4;
HOUSESMC[_local3].newHouse(_local4);
TOWERSMC[_local3 - 2].newTower();
_local6 = true;
_local4 = 0;
break;
}
} else if (_local3 == (_global.CGAME.HOUSES.length - 1)) {
_global.INTERFACE.gameWin();
_global.JUKEBOX.playSound2("sound_victory");
return(undefined);
}
_local3++;
}
}
}
_global.BGTIME.goDay();
_global.CGAME.MONEY = _global.CGAME.MONEY + (_global.CGAME.POPNB * 150);
_global.INTERFACE.refreshMoney();
_global.HERO.HEALTHPCT = 100;
_global.HERO.MANAPCT = 100;
_global.JUKEBOX.playSound2("sound_victory");
_global.INTERFACE.showNightOverMsg(STARTNIGHTPOP, _global.CGAME.POPNB, _global.CGAME.POPNB * 100, _local7, _local8, _local6);
gameData.saveGame(_global.CGAME);
}
function createUnit() {
if (_global.GAMEPERIOD == 1) {
return(undefined);
}
_global.EVTMANAGER.evt(_global.CGAME.CINTERVAL, createUnit, this);
if (_global.INTERFACE.MISSIONFAILED || (_global.INTERFACE.GAMEPAUSED)) {
return(undefined);
}
var _local7 = 2 + Math.round((6 * _global.CGAME.POPNB) / 60);
var _local4 = 0;
var _local3 = 0;
while (_local3 < UNITS.length) {
if (UNITS[_local3].ALIVE) {
_local4++;
}
_local3++;
}
if (_local7 > _local4) {
var _local5;
var _local9 = CREATEDUNITS % 7;
var _local8 = CREATEDUNITS % 3;
_local5 = "nybras1";
if ((CREATEDUNITS > 0) && (_local9 == 0)) {
_local5 = "nybras3";
} else if ((CREATEDUNITS > 0) && (_local8 == 0)) {
_local5 = "nybras2";
}
var _local6;
SPAWNCOUNT++;
_local6 = SCENE.attachMovie(_local5, (_local5 + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
if (Math.random() >= 0.5) {
_local6._x = -50;
} else {
_local6._x = 4450;
}
_local6._y = 70;
registerUnit(_local6);
CREATEDUNITS++;
}
}
function getNearestHouse(_UNIT) {
var _local4;
var _local3 = 0;
while (_local3 < _global.CGAME.HOUSES.length) {
if (_global.CGAME.HOUSES[_local3][0] && ((_global.CGAME.HOUSES[_local3][1] > 0) || (_global.CGAME.HOUSES[_local3][2] > 0))) {
var _local6 = Math.abs(HOUSESMC[_local3]._x - _UNIT._x);
if (_local6 < 300) {
if (((HOUSESMC[_local3]._x + HOUSESMC[_local3]._width) > _UNIT._x) && (_UNIT.SIDE == 1)) {
if ((_local4 == undefined) || (_local4._x > HOUSESMC[_local3]._x)) {
_local4 = HOUSESMC[_local3];
}
} else if ((HOUSESMC[_local3]._x < _UNIT._x) && (_UNIT.SIDE == 2)) {
if ((_local4 == undefined) || (_local4._x < HOUSESMC[_local3]._x)) {
_local4 = HOUSESMC[_local3];
}
}
}
}
_local3++;
}
return(_local4);
}
function addArcher(_TOWER) {
var _local2;
SPAWNCOUNT++;
_local2 = SCENE.attachMovie("towerguard", ("towerguard" + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local2._x = _TOWER._x + 93;
_local2._y = _TOWER._y;
_local2.TOWER = _TOWER;
ARCHERS.push(_local2);
return(_local2);
}
function findUnitNear(_ARCHERUNIT) {
i = 0;
while (i < UNITS.length) {
var _local2 = Math.abs(UNITS[i]._x - _ARCHERUNIT._x);
if ((_local2 < 400) && (UNITS[i].ALIVE)) {
return(UNITS[i]);
}
i++;
}
return(undefined);
}
function findArcherNear(_UNIT) {
i = 0;
while (i < ARCHERS.length) {
var _local2 = Math.abs(ARCHERS[i]._x - _UNIT._x);
if ((_local2 < 400) && (ARCHERS[i].ALIVE)) {
return(ARCHERS[i]);
}
i++;
}
return(undefined);
}
function findNearestArcher(_UNIT) {
var _local3 = 999999 /* 0x0F423F */;
var _local4;
i = 0;
while (i < ARCHERS.length) {
var _local2 = Math.abs(ARCHERS[i]._x - _UNIT._x);
if ((_local2 < _local3) && (ARCHERS[i].ALIVE)) {
_local3 = _local2;
_local4 = ARCHERS[i];
}
i++;
}
return(_local4);
}
function refreshArcher(_TOWERIND) {
TOWERSMC[_TOWERIND].refreshArcher();
}
function createGroundEffect(_PROJ) {
var _local2;
SPAWNCOUNT++;
_local2 = SCENE.attachMovie("groundeffect", ("groundeffect" + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local2._x = _PROJ._x;
_local2._y = _PROJ._y;
_local2.GROUNDUNITTYPE = _PROJ.GROUNDUNITTYPE;
}
function addGroundUnit(_GROUNDEFFECT, _GROUNDUNITTYPE) {
var _local2;
SPAWNCOUNT++;
_local2 = SCENE.attachMovie(_GROUNDUNITTYPE, (_GROUNDUNITTYPE + String(SPAWNCOUNT)) + "_mc", SCENE.getNextHighestDepth());
_local2._x = _GROUNDEFFECT._x;
_local2._y = _GROUNDEFFECT._y;
_GROUNDEFFECT.removeMovieClip();
UNITS.push(_local2);
GROUNDUNITS.push(_local2);
}
function unitDead() {
_global.EVTMANAGER.evt(48, verifyAllDead, this);
}
function verifyAllDead() {
var _local4 = 0;
var _local3 = 0;
while (_local3 < UNITS.length) {
if (UNITS[_local3].ALIVE) {
_local4++;
}
_local3++;
}
if (((_global.GAMEPERIOD == 1) && (_local4 == 0)) && (!COMPLETEDNIGHT)) {
COMPLETEDNIGHT = true;
_global.EVTMANAGER.evt(48, completedNight, this);
}
}
}
Symbol 3059 MovieClip [__Packages.spellManager] Frame 0 (4.09 KiB) ●
class spellManager
{
var SPELLS, CURSPELLIND, CHARGEPCT, SPELLSCOSTS;
function spellManager () {
SPELLS = _global.CGAME.SPELLS;
CURSPELLIND = 0;
CHARGEPCT = [[100, 12], [100, 24], [100, 24], [100, 24], [100, 240], [100, 360], [100, 24], [100, 24], [100, 1]];
SPELLSCOSTS = [];
SPELLSCOSTS.push([[0, 10], [400, 15], [800, 25], [1000, 30], [1500, 35]]);
SPELLSCOSTS.push([[400, 1.5], [600, 2], [1000, 2.5], [1500, 3], [2000, 3.5]]);
SPELLSCOSTS.push([[400, 0.1], [600, 0.12], [1000, 0.14], [1500, 0.2], [2000, 0.3]]);
SPELLSCOSTS.push([[600, 20], [800, 25], [1000, 30], [1200, 35], [1700, 40]]);
SPELLSCOSTS.push([[800, 10], [1000, 12], [1200, 15], [1700, 20], [2200, 25]]);
SPELLSCOSTS.push([[3000, 1], [4000, 2], [5000, 3], [6000, 4], [7000, 5]]);
SPELLSCOSTS.push([[0, 10], [400, 15], [800, 20], [1000, 25], [2000, 30]]);
SPELLSCOSTS.push([[0, 10], [400, 15], [800, 20], [1000, 25], [2000, 30]]);
SPELLSCOSTS.push([[1500, 2.5], [2000, 2], [2500, 1.5], [3000, 1], [4000, 0.5]]);
}
function nextState() {
var _local3 = 0;
while (_local3 < CHARGEPCT.length) {
if (CHARGEPCT[_local3][0] < 100) {
CHARGEPCT[_local3][0] = CHARGEPCT[_local3][0] + (100 / CHARGEPCT[_local3][1]);
if (CHARGEPCT[_local3][0] > 100) {
CHARGEPCT[_local3][0] = 100;
}
_global.SPELLSELECTION.rechargePct(_local3, Math.round(CHARGEPCT[_local3][0]));
}
_local3++;
}
}
function setSpell(_CURSPELLIND) {
CURSPELLIND = _CURSPELLIND;
}
function callSpell() {
var _local3 = true;
if (_global.HERO.ONSPELL) {
_global.JUKEBOX.playSound1("sound_failed_spell");
return(undefined);
}
if (CHARGEPCT[CURSPELLIND][0] < 100) {
_global.JUKEBOX.playSound1("sound_failed_spell");
return(undefined);
}
if (SPELLS[CURSPELLIND][1] == "repair") {
if (_global.SCENEMANAGER.HOUSEOVER != undefined) {
if (_global.SCENEMANAGER.HOUSEOVER.HEALTH < 100) {
if (decreaseMana()) {
_local3 = false;
var _local4 = {NAME:SPELLS[CURSPELLIND][0], ADDHEALTH:SPELLS[CURSPELLIND][4]};
_global.HERO.startSpell(_local4);
CHARGEPCT[CURSPELLIND][0] = 0;
}
}
}
} else if (SPELLS[CURSPELLIND][1] == "heal") {
if (_global.SCENEMANAGER.ARCHEROVER != undefined) {
if (_global.SCENEMANAGER.ARCHEROVER.HEALTHPCT < 100) {
if (decreaseMana()) {
_local3 = false;
var _local4 = {NAME:SPELLS[CURSPELLIND][0], ADDHEALTH:SPELLS[CURSPELLIND][4]};
_global.HERO.startSpell(_local4);
CHARGEPCT[CURSPELLIND][0] = 0;
}
}
}
} else if (decreaseMana()) {
_local3 = false;
if (SPELLS[CURSPELLIND][1] == "projectile") {
var _local4 = {NAME:SPELLS[CURSPELLIND][0], DAMAGE:SPELLS[CURSPELLIND][4], ICEFRAMES:SPELLS[CURSPELLIND][5], POISONFRAMES:SPELLS[CURSPELLIND][6], DAMAGEHEALTH:SPELLS[CURSPELLIND][7]};
_global.HERO.startSpell(_local4);
} else if (SPELLS[CURSPELLIND][1] == "lightning") {
var _local4 = {NAME:SPELLS[CURSPELLIND][0], DAMAGE:SPELLS[CURSPELLIND][4], STRIKES:SPELLS[CURSPELLIND][5]};
_global.HERO.startSpell(_local4);
} else if (SPELLS[CURSPELLIND][1] == "firewall") {
var _local4 = {NAME:SPELLS[CURSPELLIND][0], DAMAGE:SPELLS[CURSPELLIND][4], COUNTFRAMES:SPELLS[CURSPELLIND][5]};
_global.HERO.startSpell(_local4);
} else if (SPELLS[CURSPELLIND][1] == "transport") {
var _local4 = {NAME:SPELLS[CURSPELLIND][0], MANAPERFRAME:SPELLS[CURSPELLIND][3]};
_global.HERO.startTransport(_local4);
}
CHARGEPCT[CURSPELLIND][0] = 0;
}
if (_local3) {
_global.JUKEBOX.playSound1("sound_failed_spell");
}
}
function setCursor() {
switch (CURSPELLIND) {
case 0 :
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
_global.CURSOR.attackMode();
break;
case 6 :
_global.CURSOR.repairMode();
break;
case 7 :
_global.CURSOR.healMode();
break;
case 8 :
_global.CURSOR.transportMode();
}
}
function decreaseMana() {
if (_global.CGAME.POWERFUL) {
return(true);
}
return(_global.INTERFACE.decreaseMana(SPELLS[CURSPELLIND][3]));
}
}
Symbol 3060 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0 (465 B)
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 3061 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0 (1.25 KiB) ●
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 3062 MovieClip [__Packages.mx.transitions.Tween] Frame 0 (3.83 KiB) ●
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 3063 MovieClip [__Packages.mx.transitions.easing.None] Frame 0 (397 B)
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 3064 MovieClip [__Packages.aiHouse] Frame 0 (2.54 KiB) ●
class aiHouse extends MovieClip
{
var PROTECTED, PEOPLEIN, PEOPLETEXT, HEALTH, HOUSEMC, HOUSEIND, ME, _visible, _x, HEALTHBAR;
function aiHouse () {
super();
PROTECTED = true;
}
function init() {
PEOPLETEXT.text = String(PEOPLEIN);
PROTECTED = true;
if (HEALTH <= 0) {
PROTECTED = false;
HOUSEMC.roofDamage(Math.round(100 - HEALTH));
_global.RADAR.unprotected(HOUSEIND);
}
}
function nextState() {
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
return(undefined);
}
if ((((ME._xmouse <= ME._width) && (ME._xmouse >= 0)) && (ME._ymouse <= ME._height)) && (ME._ymouse >= 0)) {
_global.CURSOR.hammerOnHouse();
_global.SCENEMANAGER.HOUSEOVER = ME;
} else if (_global.SCENEMANAGER.HOUSEOVER == ME) {
_global.CURSOR.hammerOffHouse();
_global.SCENEMANAGER.HOUSEOVER = undefined;
}
}
function newHouse(_PEOPLE) {
_visible = true;
HEALTH = 100;
PEOPLEIN = _PEOPLE;
PEOPLETEXT.text = String(PEOPLEIN);
PROTECTED = true;
_global.RADAR.refreshHouses();
var _local3 = HOUSEIND % 2;
if (_local3 == 1) {
_global.SCENEMANAGER.XMIN = _x - 150;
} else {
_global.SCENEMANAGER.XMAX = _x + 360;
}
HOUSEMC.roofDamage(Math.round(100 - HEALTH));
}
function refreshHouse() {
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
PEOPLETEXT.text = String(PEOPLEIN);
HEALTHBAR.setHealth(HEALTH);
HOUSEMC.roofDamage(Math.round(100 - HEALTH));
}
function damageHouse(_DAMAGE) {
HEALTH = HEALTH - _DAMAGE;
if (HEALTH < 0) {
HEALTH = 0;
}
HEALTHBAR.setHealth(HEALTH);
_global.CGAME.HOUSES[HOUSEIND][1] = HEALTH;
_global.RADAR.underAttack(HOUSEIND);
if (HEALTH <= 0) {
HEALTH = 0;
_global.CGAME.HOUSES[HOUSEIND][1] = 0;
PROTECTED = false;
_global.RADAR.unprotected(HOUSEIND);
}
HOUSEMC.roofDamage(Math.round(100 - HEALTH));
}
function addHealth(_HEALTH) {
HEALTH = HEALTH + _HEALTH;
if (HEALTH > 100) {
HEALTH = 100;
}
HEALTHBAR.setHealth(HEALTH);
_global.CGAME.HOUSES[HOUSEIND][1] = HEALTH;
if (HEALTH > 0) {
PROTECTED = true;
_global.RADAR.protected(HOUSEIND);
}
HOUSEMC.roofDamage(Math.round(100 - HEALTH));
}
function takePerson() {
_global.CGAME.HOUSES[HOUSEIND][2]--;
_global.CGAME.POPNB--;
_global.INTERFACE.refreshPeople();
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
PEOPLETEXT.text = String(PEOPLEIN);
if (_global.CGAME.POPNB <= 0) {
_global.INTERFACE.gameOver(1);
}
}
}
Symbol 3065 MovieClip [__Packages.aiTower] Frame 0 (794 B)
class aiTower extends MovieClip
{
var TOWERIND, ARCHER, _visible;
function aiTower () {
super();
}
function init() {
if (_global.CGAME.TOWERS[TOWERIND][1]) {
ARCHER = _global.SCENEMANAGER.addArcher(this);
}
}
function newTower() {
_visible = true;
_global.CGAME.TOWERS[TOWERIND][0] = true;
}
function archerKilled() {
_global.CGAME.TOWERS[TOWERIND][1] = false;
_global.CGAME.TOWERS[TOWERIND][2] = 1;
}
function addArcher() {
_global.CGAME.TOWERS[TOWERIND][1] = true;
_global.CGAME.TOWERS[TOWERIND][2] = 1;
ARCHER = _global.SCENEMANAGER.addArcher(this);
}
function refreshArcher() {
if ((ARCHER == undefined) || (!ARCHER.ALIVE)) {
ARCHER = _global.SCENEMANAGER.addArcher(this);
} else {
ARCHER.refreshLevel();
}
}
}
Symbol 2 MovieClip [__Packages.mx.core.UIObject] Frame 0 (12.01 KiB) ● ●
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 _local2 = __width;
var _local3 = __height;
__width = w;
__height = h;
size();
if (noEvent != true) {
dispatchEvent({type:"resize", oldWidth:_local2, oldHeight:_local3});
}
}
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 = 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.126";
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 3 MovieClip [__Packages.mx.core.UIComponent] Frame 0 (3.24 KiB) ●
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.126";
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 4 MovieClip [__Packages.mx.controls.TextInput] Frame 0 (6.02 KiB) ● ●
class mx.controls.TextInput extends mx.core.UIComponent
{
var owner, enterListener, label, tabChildren, tabEnabled, focusTextField, _color, _parent, border_mc, createClassObject, dispatchValueChangedEvent, __get__width, __get__height, tfx, tfy, tfw, tfh, getStyle, bind, updateModel, _getTextFormat, enabled;
function TextInput () {
super();
}
function addEventListener(event, handler) {
if (event == "enter") {
addEnterEvents();
}
super.addEventListener(event, handler);
}
function enterOnKeyDown() {
if (Key.getAscii() == 13) {
owner.dispatchEvent({type:"enter"});
}
}
function addEnterEvents() {
if (enterListener == undefined) {
enterListener = new Object();
enterListener.owner = this;
enterListener.onKeyDown = enterOnKeyDown;
}
}
function init(Void) {
super.init();
label.styleName = this;
tabChildren = true;
tabEnabled = false;
focusTextField = label;
_color = mx.core.UIObject.textColorList;
label.onSetFocus = function () {
this._parent.onSetFocus();
};
label.onKillFocus = function (n) {
this._parent.onKillFocus(n);
};
label.drawFocus = function (b) {
this._parent.drawFocus(b);
};
label.onChanged = onLabelChanged;
}
function setFocus() {
Selection.setFocus(label);
}
function onLabelChanged(Void) {
_parent.dispatchEvent({type:"change"});
_parent.dispatchValueChangedEvent(text);
}
function createChildren(Void) {
super.createChildren();
if (border_mc == undefined) {
createClassObject(_global.styles.rectBorderClass, "border_mc", 0, {styleName:this});
}
border_mc.swapDepths(label);
label.autoSize = "none";
}
function get html() {
return(getHtml());
}
function set html(value) {
setHtml(value);
//return(html);
}
function getHtml() {
return(label.html);
}
function setHtml(value) {
if (value != label.html) {
label.html = value;
}
}
function get text() {
return(getText());
}
function set text(t) {
setText(t);
//return(text);
}
function getText() {
if (initializing) {
return(initText);
}
if (label.html == true) {
return(label.htmlText);
}
return(label.text);
}
function setText(t) {
if (initializing) {
initText = t;
} else {
var _local2 = label;
if (_local2.html == true) {
_local2.htmlText = t;
} else {
_local2.text = t;
}
}
dispatchValueChangedEvent(t);
}
function size(Void) {
border_mc.setSize(__get__width(), __get__height());
var _local2 = border_mc.__get__borderMetrics();
var _local6 = _local2.left + _local2.right;
var _local3 = _local2.top + _local2.bottom;
var _local5 = _local2.left;
var _local4 = _local2.top;
tfx = _local5;
tfy = _local4;
tfw = __get__width() - _local6;
tfh = __get__height() - _local3;
label.move(tfx, tfy);
label.setSize(tfw, tfh + 1);
}
function setEnabled(enable) {
label.type = (((__editable == true) || (enable == false)) ? "input" : "dynamic");
label.selectable = enable;
var _local2 = getStyle((enable ? "color" : "disabledColor"));
if (_local2 == undefined) {
_local2 = (enable ? 0 : 8947848);
}
setColor(_local2);
}
function setColor(col) {
label.textColor = col;
}
function onKillFocus(newFocus) {
if (enterListener != undefined) {
Key.removeListener(enterListener);
}
if (bind != undefined) {
updateModel(text);
}
super.onKillFocus(newFocus);
}
function onSetFocus(oldFocus) {
var f = Selection.getFocus();
var o = eval (f);
if (o != label) {
Selection.setFocus(label);
return(undefined);
}
if (enterListener != undefined) {
Key.addListener(enterListener);
}
super.onSetFocus(oldFocus);
}
function draw(Void) {
var _local2 = label;
var _local4 = getText();
if (initializing) {
initializing = false;
delete initText;
}
var _local3 = _getTextFormat();
_local2.embedFonts = _local3.embedFonts == true;
if (_local3 != undefined) {
_local2.setTextFormat(_local3);
_local2.setNewTextFormat(_local3);
}
_local2.multiline = false;
_local2.wordWrap = false;
if (_local2.html == true) {
_local2.setTextFormat(_local3);
_local2.htmlText = _local4;
} else {
_local2.text = _local4;
}
_local2.type = (((__editable == true) || (enabled == false)) ? "input" : "dynamic");
size();
}
function setEditable(s) {
__editable = s;
label.type = (s ? "input" : "dynamic");
}
function get maxChars() {
return(label.maxChars);
}
function set maxChars(w) {
label.maxChars = w;
//return(maxChars);
}
function get length() {
return(label.length);
}
function get restrict() {
return(label.restrict);
}
function set restrict(w) {
label.restrict = ((w == "") ? null : (w));
//return(restrict);
}
function get hPosition() {
return(label.hscroll);
}
function set hPosition(w) {
label.hscroll = w;
//return(hPosition);
}
function get maxHPosition() {
return(label.maxhscroll);
}
function get editable() {
return(__editable);
}
function set editable(w) {
setEditable(w);
//return(editable);
}
function get password() {
return(label.password);
}
function set password(w) {
label.password = w;
//return(password);
}
function get tabIndex() {
return(label.tabIndex);
}
function set tabIndex(w) {
label.tabIndex = w;
//return(tabIndex);
}
function set _accProps(val) {
label._accProps = val;
//return(_accProps);
}
function get _accProps() {
return(label._accProps);
}
static var symbolName = "TextInput";
static var symbolOwner = mx.controls.TextInput;
static var version = "2.0.2.126";
var className = "TextInput";
var initializing = true;
var clipParameters = {text:1, editable:1, password:1, maxChars:1, restrict:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.TextInput.prototype.clipParameters, mx.core.UIComponent.prototype.clipParameters);
var _maxWidth = mx.core.UIComponent.kStretch;
var __editable = true;
var initText = "";
}
Symbol 23 MovieClip [__Packages.mx.skins.SkinElement] Frame 0 (505 B)
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 24 MovieClip [__Packages.mx.styles.CSSTextStyles] Frame 0 (2.55 KiB) ●
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 25 MovieClip [__Packages.mx.styles.StyleManager] Frame 0 (2 KiB) ●
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 26 MovieClip [__Packages.mx.styles.CSSStyleDeclaration] Frame 0 (1.04 KiB) ●
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 27 MovieClip [__Packages.mx.skins.Border] Frame 0 (306 B)
class mx.skins.Border extends mx.core.UIObject
{
function Border () {
super();
}
function init(Void) {
super.init();
}
static var symbolName = "Border";
static var symbolOwner = mx.skins.Border;
var className = "Border";
var tagBorder = 0;
var idNames = new Array("border_mc");
}
Symbol 28 MovieClip [__Packages.mx.skins.RectBorder] Frame 0 (1.28 KiB) ●
class mx.skins.RectBorder extends mx.skins.Border
{
var __width, __height, offset, __borderMetrics;
function RectBorder () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function init(Void) {
super.init();
}
function draw(Void) {
size();
}
function getBorderMetrics(Void) {
var _local2 = offset;
if (__borderMetrics == undefined) {
__borderMetrics = {left:_local2, top:_local2, right:_local2, bottom:_local2};
} else {
__borderMetrics.left = _local2;
__borderMetrics.top = _local2;
__borderMetrics.right = _local2;
__borderMetrics.bottom = _local2;
}
return(__borderMetrics);
}
function get borderMetrics() {
return(getBorderMetrics());
}
function drawBorder(Void) {
}
function size(Void) {
drawBorder();
}
function setColor(Void) {
drawBorder();
}
static var symbolName = "RectBorder";
static var symbolOwner = mx.skins.RectBorder;
static var version = "2.0.2.126";
var className = "RectBorder";
var borderStyleName = "borderStyle";
var borderColorName = "borderColor";
var shadowColorName = "shadowColor";
var highlightColorName = "highlightColor";
var buttonColorName = "buttonColor";
var backgroundColorName = "backgroundColor";
}
Symbol 29 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0 (2.17 KiB) ●
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 30 MovieClip [__Packages.mx.events.UIEventDispatcher] Frame 0 (3.15 KiB) ●
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 31 MovieClip [__Packages.mx.skins.ColoredSkinElement] Frame 0 (703 B)
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 32 MovieClip [__Packages.mx.core.ext.UIObjectExtensions] Frame 0 (5.59 KiB) ● ●
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 33 MovieClip [__Packages.mx.skins.halo.RectBorder] Frame 0 (5.74 KiB) ● ●
class mx.skins.halo.RectBorder extends mx.skins.RectBorder
{
var offset, getStyle, borderStyleName, __borderMetrics, className, borderColorName, backgroundColorName, shadowColorName, highlightColorName, buttonColorName, __get__width, __get__height, clear, _color, drawRoundRect, beginFill, drawRect, endFill;
function RectBorder () {
super();
}
function init(Void) {
borderWidths.default = 3;
super.init();
}
function getBorderMetrics(Void) {
if (offset == undefined) {
var _local3 = getStyle(borderStyleName);
offset = borderWidths[_local3];
}
if ((getStyle(borderStyleName) == "default") || (getStyle(borderStyleName) == "alert")) {
__borderMetrics = {left:3, top:1, right:3, bottom:3};
return(__borderMetrics);
}
return(super.getBorderMetrics());
}
function drawBorder(Void) {
var _local6 = _global.styles[className];
if (_local6 == undefined) {
_local6 = _global.styles.RectBorder;
}
var _local5 = getStyle(borderStyleName);
var _local7 = getStyle(borderColorName);
if (_local7 == undefined) {
_local7 = _local6[borderColorName];
}
var _local8 = getStyle(backgroundColorName);
if (_local8 == undefined) {
_local8 = _local6[backgroundColorName];
}
var _local16 = getStyle("backgroundImage");
if (_local5 != "none") {
var _local14 = getStyle(shadowColorName);
if (_local14 == undefined) {
_local14 = _local6[shadowColorName];
}
var _local13 = getStyle(highlightColorName);
if (_local13 == undefined) {
_local13 = _local6[highlightColorName];
}
var _local12 = getStyle(buttonColorName);
if (_local12 == undefined) {
_local12 = _local6[buttonColorName];
}
var _local11 = getStyle(borderCapColorName);
if (_local11 == undefined) {
_local11 = _local6[borderCapColorName];
}
var _local10 = getStyle(shadowCapColorName);
if (_local10 == undefined) {
_local10 = _local6[shadowCapColorName];
}
}
offset = borderWidths[_local5];
var _local9 = offset;
var _local3 = __get__width();
var _local4 = __get__height();
clear();
_color = undefined;
if (_local5 == "none") {
} else if (_local5 == "inset") {
_color = colorList;
draw3dBorder(_local11, _local12, _local7, _local13, _local14, _local10);
} else if (_local5 == "outset") {
_color = colorList;
draw3dBorder(_local11, _local7, _local12, _local14, _local13, _local10);
} else if (_local5 == "alert") {
var _local15 = getStyle("themeColor");
drawRoundRect(0, 5, _local3, _local4 - 5, 5, 6184542, 10);
drawRoundRect(1, 4, _local3 - 2, _local4 - 5, 4, [6184542, 6184542], 10, 0, "radial");
drawRoundRect(2, 0, _local3 - 4, _local4 - 2, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(2, 0, _local3 - 4, _local4 - 2, 3, _local15, 50);
drawRoundRect(3, 1, _local3 - 6, _local4 - 4, 2, 16777215, 100);
} else if (_local5 == "default") {
drawRoundRect(0, 5, _local3, _local4 - 5, {tl:5, tr:5, br:0, bl:0}, 6184542, 10);
drawRoundRect(1, 4, _local3 - 2, _local4 - 5, {tl:4, tr:4, br:0, bl:0}, [6184542, 6184542], 10, 0, "radial");
drawRoundRect(2, 0, _local3 - 4, _local4 - 2, {tl:3, tr:3, br:0, bl:0}, [12897484, 11844796], 100, 0, "radial");
drawRoundRect(3, 1, _local3 - 6, _local4 - 4, {tl:2, tr:2, br:0, bl:0}, 16777215, 100);
} else if (_local5 == "dropDown") {
drawRoundRect(0, 0, _local3 + 1, _local4, {tl:4, tr:0, br:0, bl:4}, [13290186, 7895160], 100, -10, "linear");
drawRoundRect(1, 1, _local3 - 1, _local4 - 2, {tl:3, tr:0, br:0, bl:3}, 16777215, 100);
} else if (_local5 == "menuBorder") {
var _local15 = getStyle("themeColor");
drawRoundRect(4, 4, _local3 - 2, _local4 - 3, 0, [6184542, 6184542], 10, 0, "radial");
drawRoundRect(4, 4, _local3 - 1, _local4 - 2, 0, 6184542, 10);
drawRoundRect(0, 0, _local3 + 1, _local4, 0, [0, 14342874], 100, 250, "linear");
drawRoundRect(0, 0, _local3 + 1, _local4, 0, _local15, 50);
drawRoundRect(2, 2, _local3 - 3, _local4 - 4, 0, 16777215, 100);
} else if (_local5 == "comboNonEdit") {
} else {
beginFill(_local7);
drawRect(0, 0, _local3, _local4);
drawRect(1, 1, _local3 - 1, _local4 - 1);
endFill();
_color = borderColorName;
}
if (_local8 != undefined) {
beginFill(_local8);
drawRect(_local9, _local9, __get__width() - _local9, __get__height() - _local9);
endFill();
}
}
function draw3dBorder(c1, c2, c3, c4, c5, c6) {
var _local3 = __get__width();
var _local2 = __get__height();
beginFill(c1);
drawRect(0, 0, _local3, _local2);
drawRect(1, 0, _local3 - 1, _local2);
endFill();
beginFill(c2);
drawRect(1, 0, _local3 - 1, 1);
endFill();
beginFill(c3);
drawRect(1, _local2 - 1, _local3 - 1, _local2);
endFill();
beginFill(c4);
drawRect(1, 1, _local3 - 1, 2);
endFill();
beginFill(c5);
drawRect(1, _local2 - 2, _local3 - 1, _local2 - 1);
endFill();
beginFill(c6);
drawRect(1, 2, _local3 - 1, _local2 - 2);
drawRect(2, 2, _local3 - 2, _local2 - 2);
endFill();
}
static function classConstruct() {
mx.core.ext.UIObjectExtensions.Extensions();
_global.styles.rectBorderClass = mx.skins.halo.RectBorder;
_global.skinRegistry.RectBorder = true;
return(true);
}
static var symbolName = "RectBorder";
static var symbolOwner = mx.skins.halo.RectBorder;
static var version = "2.0.2.126";
var borderCapColorName = "borderCapColor";
var shadowCapColorName = "shadowCapColor";
var colorList = {highlightColor:0, borderColor:0, buttonColor:0, shadowColor:0, borderCapColor:0, shadowCapColor:0};
var borderWidths = {none:0, solid:1, inset:2, outset:2, alert:3, dropDown:2, menuBorder:2, comboNonEdit:2};
static var classConstructed = classConstruct();
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
}
Symbol 34 MovieClip [__Packages.mx.skins.halo.Defaults] Frame 0 (7.87 KiB) ● ●
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 35 MovieClip [__Packages.mx.controls.SimpleButton] Frame 0 (11.16 KiB) ● ●
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.126";
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 36 MovieClip [__Packages.mx.managers.DepthManager] Frame 0 (10.9 KiB) ● ●
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 _local6 = "down";
if (depthFlag == kBottom) {
_local6 = "up";
}
var _local5;
if (_local3[_local2] != undefined) {
_local5 = _local2;
_local2 = findNextAvailableDepth(_local2, _local3, _local6);
}
var _local4 = createClassObject(className, "depthChild" + (_childCounter++), _local2, initObj);
if (_local5 != undefined) {
_local3[_local2] = _local4;
shuffleDepths(_local4, _local5, _local3, _local6);
}
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 _local6 = "down";
if (depthFlag == kBottom) {
_local6 = "up";
}
var _local5;
if (_local3[_local2] != undefined) {
_local5 = _local2;
_local2 = findNextAvailableDepth(_local2, _local3, _local6);
}
var _local4 = createObject(linkageName, "depthChild" + (_childCounter++), _local2, initObj);
if (_local5 != undefined) {
_local3[_local2] = _local4;
shuffleDepths(_local4, _local5, _local3, _local6);
}
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(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 _local2 = targetDepth;
var _local1 = targetDepth;
if (direction == "down") {
while (depthTable[_local1] != undefined) {
_local1--;
}
return(_local1);
}
while (depthTable[_local2] != undefined) {
_local2++;
}
return(_local2);
}
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 37 MovieClip [__Packages.mx.managers.SystemManager] Frame 0 (2.22 KiB) ●
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 38 MovieClip [__Packages.mx.managers.FocusManager] Frame 0 (17.05 KiB) ● ● ●
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 = _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.126";
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 39 MovieClip [__Packages.mx.skins.halo.FocusRect] Frame 0 (3.55 KiB) ●
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 40 MovieClip [__Packages.mx.managers.OverlappedWindows] Frame 0 (4.92 KiB) ●
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 41 MovieClip [__Packages.mx.styles.CSSSetStyle] Frame 0 (7.95 KiB) ● ●
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 42 MovieClip [__Packages.mx.core.ext.UIComponentExtensions] Frame 0 (1.17 KiB) ●
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;
}
Symbol 43 MovieClip [__Packages.mx.core.View] Frame 0 (2.99 KiB) ●
class mx.core.View extends mx.core.UIComponent
{
var tabChildren, tabEnabled, boundingBox_mc, border_mc, __get__width, __get__height, __tabIndex, depth, createObject, createClassObject, loadExternal, destroyObject, createClassChildAtDepth, doLater;
function View () {
super();
}
function init() {
super.init();
tabChildren = true;
tabEnabled = false;
boundingBox_mc._visible = false;
boundingBox_mc._width = (boundingBox_mc._height = 0);
}
function size() {
border_mc.move(0, 0);
border_mc.setSize(__get__width(), __get__height());
doLayout();
}
function draw() {
size();
}
function get numChildren() {
var _local3 = childNameBase;
var _local2 = 0;
while (true) {
if (this[_local3 + _local2] == undefined) {
return(_local2);
}
_local2++;
}
}
function get tabIndex() {
return((tabEnabled ? (__tabIndex) : undefined));
}
function addLayoutObject(object) {
}
function createChild(className, instanceName, initProps) {
if (depth == undefined) {
depth = 1;
}
var _local2;
if (typeof(className) == "string") {
_local2 = createObject(className, instanceName, depth++, initProps);
} else {
_local2 = createClassObject(className, instanceName, depth++, initProps);
}
if (_local2 == undefined) {
_local2 = loadExternal(className, _loadExternalClass, instanceName, depth++, initProps);
} else {
this[childNameBase + numChildren] = _local2;
_local2._complete = true;
childLoaded(_local2);
}
addLayoutObject(_local2);
return(_local2);
}
function getChildAt(childIndex) {
return(this[childNameBase + childIndex]);
}
function destroyChildAt(childIndex) {
if (!((childIndex >= 0) && (childIndex < numChildren))) {
return(undefined);
}
var _local4 = childNameBase + childIndex;
var _local6 = numChildren;
var _local3;
for (_local3 in this) {
if (_local3 == _local4) {
_local4 = "";
destroyObject(_local3);
break;
}
}
var _local2 = Number(childIndex);
while (_local2 < (_local6 - 1)) {
this[childNameBase + _local2] = this[childNameBase + (_local2 + 1)];
_local2++;
}
delete this[childNameBase + (_local6 - 1)];
depth--;
}
function initLayout() {
if (!hasBeenLayedOut) {
doLayout();
}
}
function doLayout() {
hasBeenLayedOut = true;
}
function createChildren() {
if (border_mc == undefined) {
border_mc = createClassChildAtDepth(_global.styles.rectBorderClass, mx.managers.DepthManager.kBottom, {styleName:this});
}
doLater(this, "initLayout");
}
function convertToUIObject(obj) {
}
function childLoaded(obj) {
convertToUIObject(obj);
}
static function extension() {
mx.core.ExternalContent.enableExternalContent();
}
static var symbolName = "View";
static var symbolOwner = mx.core.View;
static var version = "2.0.2.126";
var className = "View";
static var childNameBase = "_child";
var hasBeenLayedOut = false;
var _loadExternalClass = "UIComponent";
}
Symbol 44 MovieClip [__Packages.mx.controls.Loader] Frame 0 (5.59 KiB) ● ●
class mx.controls.Loader extends mx.core.View
{
var _origWidth, _origHeight, __width, livePreview, __height, createTextField, contentHolder, childrenCreated, destroyChildAt, createChild, border_mc;
function Loader () {
super();
}
function init() {
super.init();
}
function setSize(w, h, noEvent) {
_origWidth = w;
_origHeight = h;
super.setSize(w, h, noEvent);
if (_global.isLivePreview) {
livePreview._width = __width - 1;
livePreview._height = __height - 1;
}
}
function draw() {
size();
}
function size() {
super.size();
if (__scaleContent) {
doScaleContent();
} else {
doScaleLoader();
}
}
function createChildren() {
super.createChildren();
if (_global.isLivePreview) {
createTextField("livePreview", -1000, 0, 0, 99, 99);
livePreview.text = "mx.controls.Loader";
livePreview.border = true;
}
if (__autoLoad) {
load();
}
}
function getAutoLoad() {
return(__autoLoad);
}
function get autoLoad() {
return(getAutoLoad());
}
function setAutoLoad(b) {
if (__autoLoad != b) {
__autoLoad = b;
if (__autoLoad && (!this[mx.core.View.childNameBase + 0]._complete)) {
load();
}
}
}
function set autoLoad(b) {
setAutoLoad(b);
//return(autoLoad);
}
function getBytesLoaded() {
return(__bytesLoaded);
}
function get bytesLoaded() {
return(getBytesLoaded());
}
function getBytesTotal() {
return(__bytesTotal);
}
function get bytesTotal() {
return(getBytesTotal());
}
function getContent() {
return(contentHolder);
}
function get content() {
return(getContent());
}
function getContentPath() {
return(__contentPath);
}
function get contentPath() {
return(getContentPath());
}
function setContentPath(url) {
if (__contentPath != url) {
__contentPath = url;
if (childrenCreated) {
if (__autoLoad) {
load();
}
}
}
}
function set contentPath(c) {
setContentPath(c);
//return(contentPath);
}
function getPercentLoaded() {
var _local2 = 100 * (__bytesLoaded / __bytesTotal);
if (isNaN(_local2)) {
_local2 = 0;
}
return(_local2);
}
function get percentLoaded() {
return(getPercentLoaded());
}
function get scaleContent() {
return(getScaleContent());
}
function getScaleContent() {
return(__scaleContent);
}
function setScaleContent(b) {
if (__scaleContent != b) {
__scaleContent = b;
if (__scaleContent) {
doScaleContent();
} else {
doScaleLoader();
}
}
}
function set scaleContent(b) {
setScaleContent(b);
//return(scaleContent);
}
function load(url) {
if (url != undefined) {
__contentPath = url;
}
if (this[mx.core.View.childNameBase + 0] != undefined) {
if (this[mx.core.View.childNameBase + 0]._complete) {
setSize(_origWidth, _origHeight);
}
destroyChildAt(0);
}
if ((__contentPath == undefined) || (__contentPath == "")) {
return(undefined);
}
createChild(__contentPath, "contentHolder");
}
function childLoaded(obj) {
super.childLoaded(obj);
obj._rotation = 0;
_origWidth = __width;
_origHeight = __height;
if (__scaleContent) {
doScaleContent();
} else {
doScaleLoader();
}
}
function dispatchEvent(obj) {
if ((obj.type == "progress") || (obj.type == "complete")) {
obj.target = this;
__bytesTotal = obj.total;
__bytesLoaded = obj.current;
}
super.dispatchEvent(obj);
}
function doScaleContent() {
if (!this[mx.core.View.childNameBase + 0]._complete) {
return(undefined);
}
unScaleContent();
var _local2 = border_mc.__get__borderMetrics();
var _local7 = (_origWidth - _local2.left) - _local2.right;
var _local6 = (_origHeight - _local2.top) - _local2.bottom;
var _local9 = _local2.left;
var _local8 = _local2.top;
var _local5 = _local7 / contentHolder._width;
var _local3 = _local6 / contentHolder._height;
var _local4;
if (_local5 > _local3) {
_local9 = _local2.left + Math.floor((_local7 - (contentHolder._width * _local3)) / 2);
_local4 = _local3;
} else {
_local8 = _local2.top + Math.floor((_local6 - (contentHolder._height * _local5)) / 2);
_local4 = _local5;
}
_local4 = _local4 * 100;
contentHolder._xscale = (contentHolder._yscale = _local4);
contentHolder._x = _local9;
contentHolder._y = _local8;
if ((__width != _origWidth) || (__height != _origHeight)) {
setSize(_origWidth, _origHeight);
}
}
function doScaleLoader() {
if (!this[mx.core.View.childNameBase + 0]._complete) {
return(undefined);
}
unScaleContent();
var _local2 = border_mc.__get__borderMetrics();
var _local4 = (contentHolder._width + _local2.left) + _local2.right;
var _local3 = (contentHolder._height + _local2.top) + _local2.bottom;
if ((__width != _local4) || (__height != _local3)) {
setSize(_local4, _local3);
}
contentHolder._x = _local2.left;
contentHolder._y = _local2.top;
}
function unScaleContent() {
contentHolder._xscale = (contentHolder._yscale = 100);
contentHolder._x = (contentHolder._y = 0);
}
static var symbolName = "Loader";
static var symbolOwner = mx.controls.Loader;
static var version = "2.0.2.126";
var className = "Loader";
var clipParameters = {autoLoad:1, scaleContent:1, contentPath:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.Loader.prototype.clipParameters, mx.core.View.prototype.clipParameters);
var __autoLoad = true;
var __bytesLoaded = undefined;
var __bytesTotal = undefined;
var __contentPath = undefined;
var __scaleContent = true;
}
Symbol 47 MovieClip [__Packages.mx.core.ExternalContent] Frame 0 (4.11 KiB) ●
class mx.core.ExternalContent
{
var createObject, numChildren, prepList, doLater, loadList, dispatchEvent, loadedList, childLoaded;
function ExternalContent () {
}
function loadExternal(url, placeholderClassName, instanceName, depth, initProps) {
var _local2;
_local2 = createObject(placeholderClassName, instanceName, depth, initProps);
this[mx.core.View.childNameBase + numChildren] = _local2;
if (prepList == undefined) {
prepList = new Object();
}
prepList[instanceName] = {obj:_local2, url:url, complete:false, initProps:initProps};
prepareToLoadMovie(_local2);
return(_local2);
}
function prepareToLoadMovie(obj) {
obj.unloadMovie();
doLater(this, "waitForUnload");
}
function waitForUnload() {
var _local3;
for (_local3 in prepList) {
var _local2 = prepList[_local3];
if (_local2.obj.getBytesTotal() == 0) {
if (loadList == undefined) {
loadList = new Object();
}
loadList[_local3] = _local2;
_local2.obj.loadMovie(_local2.url);
delete prepList[_local3];
doLater(this, "checkLoadProgress");
} else {
doLater(this, "waitForUnload");
}
}
}
function checkLoadProgress() {
var _local8 = false;
var _local3;
for (_local3 in loadList) {
var _local2 = loadList[_local3];
_local2.loaded = _local2.obj.getBytesLoaded();
_local2.total = _local2.obj.getBytesTotal();
if (_local2.total > 0) {
_local2.obj._visible = false;
dispatchEvent({type:"progress", target:_local2.obj, current:_local2.loaded, total:_local2.total});
if (_local2.loaded == _local2.total) {
if (loadedList == undefined) {
loadedList = new Object();
}
loadedList[_local3] = _local2;
delete loadList[_local3];
doLater(this, "contentLoaded");
}
} else if (_local2.total == -1) {
if (_local2.failedOnce != undefined) {
_local2.failedOnce++;
if (_local2.failedOnce > 3) {
dispatchEvent({type:"complete", target:_local2.obj, current:_local2.loaded, total:_local2.total});
delete loadList[_local3];
}
} else {
_local2.failedOnce = 0;
}
}
_local8 = true;
}
if (_local8) {
doLater(this, "checkLoadProgress");
}
}
function contentLoaded() {
var _local4;
for (_local4 in loadedList) {
var _local2 = loadedList[_local4];
_local2.obj._visible = true;
_local2.obj._complete = true;
var _local3;
for (_local3 in _local2.initProps) {
_local2.obj[_local3] = _local2.initProps[_local3];
}
childLoaded(_local2.obj);
dispatchEvent({type:"complete", target:_local2.obj, current:_local2.loaded, total:_local2.total});
delete loadedList[_local4];
}
}
function convertToUIObject(obj) {
if (obj.setSize == undefined) {
var _local2 = mx.core.UIObject.prototype;
obj.addProperty("width", _local2.__get__width, null);
obj.addProperty("height", _local2.__get__height, null);
obj.addProperty("left", _local2.__get__left, null);
obj.addProperty("x", _local2.__get__x, null);
obj.addProperty("top", _local2.__get__top, null);
obj.addProperty("y", _local2.__get__y, null);
obj.addProperty("right", _local2.__get__right, null);
obj.addProperty("bottom", _local2.__get__bottom, null);
obj.addProperty("visible", _local2.__get__visible, _local2.__set__visible);
obj.move = mx.core.UIObject.prototype.move;
obj.setSize = mx.core.UIObject.prototype.setSize;
obj.size = mx.core.UIObject.prototype.size;
mx.events.UIEventDispatcher.initialize(obj);
}
}
static function enableExternalContent() {
}
static function classConstruct() {
var _local1 = mx.core.View.prototype;
var _local2 = mx.core.ExternalContent.prototype;
_local1.loadExternal = _local2.loadExternal;
_local1.prepareToLoadMovie = _local2.prepareToLoadMovie;
_local1.waitForUnload = _local2.waitForUnload;
_local1.checkLoadProgress = _local2.checkLoadProgress;
_local1.contentLoaded = _local2.contentLoaded;
_local1.convertToUIObject = _local2.convertToUIObject;
return(true);
}
static var classConstructed = classConstruct();
static var ViewDependency = mx.core.View;
}
Symbol 48 MovieClip [__Packages.mx.controls.Button] Frame 0 (7.21 KiB) ● ●
class mx.controls.Button extends mx.controls.SimpleButton
{
var initializing, labelPath, initIcon, getState, enabled, phase, idNames, __width, __height, setState, invalidate, iconName, refresh, createLabel, _iconLinkageName, removeIcons, hitArea_mc, createEmptyObject;
function Button () {
super();
}
function init(Void) {
super.init();
}
function draw() {
if (initializing) {
labelPath.visible = true;
}
super.draw();
if (initIcon != undefined) {
_setIcon(initIcon);
}
delete initIcon;
}
function onRelease(Void) {
super.onRelease();
}
function createChildren(Void) {
super.createChildren();
}
function setSkin(tag, linkageName, initobj) {
return(super.setSkin(tag, linkageName, initobj));
}
function viewSkin(varName) {
var _local3 = (getState() ? "true" : "false");
_local3 = _local3 + (enabled ? (phase) : "disabled");
super.viewSkin(varName, {styleName:this, borderStyle:_local3});
}
function invalidateStyle(c) {
labelPath.invalidateStyle(c);
super.invalidateStyle(c);
}
function setColor(c) {
var _local2 = 0;
while (_local2 < 8) {
this[idNames[_local2]].redraw(true);
_local2++;
}
}
function setEnabled(enable) {
labelPath.enabled = enable;
super.setEnabled(enable);
}
function calcSize(tag, ref) {
if ((__width == undefined) || (__height == undefined)) {
return(undefined);
}
if (tag < 7) {
ref.setSize(__width, __height, true);
}
}
function size(Void) {
setState(getState());
setHitArea(__width, __height);
var _local3 = 0;
while (_local3 < 8) {
var _local4 = idNames[_local3];
if (typeof(this[_local4]) == "movieclip") {
this[_local4].setSize(__width, __height, true);
}
_local3++;
}
super.size();
}
function set labelPlacement(val) {
__labelPlacement = val;
invalidate();
//return(labelPlacement);
}
function get labelPlacement() {
return(__labelPlacement);
}
function getLabelPlacement(Void) {
return(__labelPlacement);
}
function setLabelPlacement(val) {
__labelPlacement = val;
invalidate();
}
function getBtnOffset(Void) {
if (getState()) {
var _local2 = btnOffset;
} else if (phase == "down") {
var _local2 = btnOffset;
} else {
var _local2 = 0;
}
return(_local2);
}
function setView(offset) {
var _local16 = (offset ? (btnOffset) : 0);
var _local12 = getLabelPlacement();
var _local7 = 0;
var _local6 = 0;
var _local9 = 0;
var _local8 = 0;
var _local5 = 0;
var _local4 = 0;
var _local3 = labelPath;
var _local2 = iconName;
var _local15 = _local3.textWidth;
var _local14 = _local3.textHeight;
var _local10 = (__width - borderW) - borderW;
var _local11 = (__height - borderW) - borderW;
if (_local2 != undefined) {
_local7 = _local2._width;
_local6 = _local2._height;
}
if ((_local12 == "left") || (_local12 == "right")) {
if (_local3 != undefined) {
_local9 = Math.min(_local10 - _local7, _local15 + 5);
_local3._width = _local9;
_local8 = Math.min(_local11, _local14 + 5);
_local3._height = _local8;
}
if (_local12 == "right") {
_local5 = _local7;
if (centerContent) {
_local5 = _local5 + (((_local10 - _local9) - _local7) / 2);
}
_local2._x = _local5 - _local7;
} else {
_local5 = (_local10 - _local9) - _local7;
if (centerContent) {
_local5 = _local5 / 2;
}
_local2._x = _local5 + _local9;
}
_local4 = 0;
_local2._y = _local4;
if (centerContent) {
_local2._y = (_local11 - _local6) / 2;
_local4 = (_local11 - _local8) / 2;
}
if (!centerContent) {
_local2._y = _local2._y + Math.max(0, (_local8 - _local6) / 2);
}
} else {
if (_local3 != undefined) {
_local9 = Math.min(_local10, _local15 + 5);
_local3._width = _local9;
_local8 = Math.min(_local11 - _local6, _local14 + 5);
_local3._height = _local8;
}
_local5 = (_local10 - _local9) / 2;
_local2._x = (_local10 - _local7) / 2;
if (_local12 == "top") {
_local4 = (_local11 - _local8) - _local6;
if (centerContent) {
_local4 = _local4 / 2;
}
_local2._y = _local4 + _local8;
} else {
_local4 = _local6;
if (centerContent) {
_local4 = _local4 + (((_local11 - _local8) - _local6) / 2);
}
_local2._y = _local4 - _local6;
}
}
var _local13 = borderW + _local16;
_local3._x = _local5 + _local13;
_local3._y = _local4 + _local13;
_local2._x = _local2._x + _local13;
_local2._y = _local2._y + _local13;
}
function set label(lbl) {
setLabel(lbl);
//return(label);
}
function setLabel(label) {
if (label == "") {
labelPath.removeTextField();
refresh();
return(undefined);
}
if (labelPath == undefined) {
var _local2 = createLabel("labelPath", 200, label);
_local2._width = _local2.textWidth + 5;
_local2._height = _local2.textHeight + 5;
if (initializing) {
_local2.visible = false;
}
} else {
delete labelPath.__text;
labelPath.text = label;
refresh();
}
}
function getLabel(Void) {
return(((labelPath.__text != undefined) ? (labelPath.__text) : (labelPath.text)));
}
function get label() {
return(getLabel());
}
function _getIcon(Void) {
return(_iconLinkageName);
}
function get icon() {
if (initializing) {
return(initIcon);
}
return(_iconLinkageName);
}
function _setIcon(linkage) {
if (initializing) {
if (linkage == "") {
return(undefined);
}
initIcon = linkage;
} else {
if (linkage == "") {
removeIcons();
return(undefined);
}
super.changeIcon(0, linkage);
super.changeIcon(1, linkage);
super.changeIcon(3, linkage);
super.changeIcon(4, linkage);
super.changeIcon(5, linkage);
_iconLinkageName = linkage;
refresh();
}
}
function set icon(linkage) {
_setIcon(linkage);
//return(icon);
}
function setHitArea(w, h) {
if (hitArea_mc == undefined) {
createEmptyObject("hitArea_mc", 100);
}
var _local2 = hitArea_mc;
_local2.clear();
_local2.beginFill(16711680);
_local2.drawRect(0, 0, w, h);
_local2.endFill();
_local2.setVisible(false);
}
static var symbolName = "Button";
static var symbolOwner = mx.controls.Button;
var className = "Button";
static var version = "2.0.2.126";
var btnOffset = 0;
var _color = "buttonColor";
var __label = "default value";
var __labelPlacement = "right";
var falseUpSkin = "ButtonSkin";
var falseDownSkin = "ButtonSkin";
var falseOverSkin = "ButtonSkin";
var falseDisabledSkin = "ButtonSkin";
var trueUpSkin = "ButtonSkin";
var trueDownSkin = "ButtonSkin";
var trueOverSkin = "ButtonSkin";
var trueDisabledSkin = "ButtonSkin";
var falseUpIcon = "";
var falseDownIcon = "";
var falseOverIcon = "";
var falseDisabledIcon = "";
var trueUpIcon = "";
var trueDownIcon = "";
var trueOverIcon = "";
var trueDisabledIcon = "";
var clipParameters = {labelPlacement:1, icon:1, toggle:1, selected:1, label:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.Button.prototype.clipParameters, mx.controls.SimpleButton.prototype.clipParameters);
var centerContent = true;
var borderW = 1;
}
Symbol 49 MovieClip [__Packages.mx.controls.CheckBox] Frame 0 (1.97 KiB) ●
class mx.controls.CheckBox extends mx.controls.Button
{
var _getTextFormat, labelPath, iconName;
function CheckBox () {
super();
}
function onRelease() {
super.onRelease();
}
function init() {
super.init();
}
function size() {
super.size();
}
function get emphasized() {
return(undefined);
}
function calcPreferredHeight() {
var _local5 = _getTextFormat();
var _local3 = _local5.getTextExtent2(labelPath.text).height;
var _local4 = iconName._height;
var _local2 = 0;
if ((__labelPlacement == "left") || (__labelPlacement == "right")) {
_local2 = Math.max(_local3, _local4);
} else {
_local2 = _local3 + _local4;
}
return(Math.max(14, _local2));
}
function set toggle(v) {
//return(toggle);
}
function get toggle() {
}
function set icon(v) {
//return(icon);
}
function get icon() {
}
static var symbolName = "CheckBox";
static var symbolOwner = mx.controls.CheckBox;
static var version = "2.0.2.126";
var className = "CheckBox";
var ignoreClassStyleDeclaration = {Button:1};
var btnOffset = 0;
var __toggle = true;
var __selected = false;
var __labelPlacement = "right";
var __label = "CheckBox";
var falseUpSkin = "";
var falseDownSkin = "";
var falseOverSkin = "";
var falseDisabledSkin = "";
var trueUpSkin = "";
var trueDownSkin = "";
var trueOverSkin = "";
var trueDisabledSkin = "";
var falseUpIcon = "CheckFalseUp";
var falseDownIcon = "CheckFalseDown";
var falseOverIcon = "CheckFalseOver";
var falseDisabledIcon = "CheckFalseDisabled";
var trueUpIcon = "CheckTrueUp";
var trueDownIcon = "CheckTrueDown";
var trueOverIcon = "CheckTrueOver";
var trueDisabledIcon = "CheckTrueDisabled";
var clipParameters = {label:1, labelPlacement:1, selected:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.CheckBox.prototype.clipParameters, mx.controls.Button.prototype.clipParameters);
var centerContent = false;
var borderW = 0;
}
Symbol 80 MovieClip [__Packages.mx.skins.halo.ButtonSkin] Frame 0 (5.58 KiB) ● ●
class mx.skins.halo.ButtonSkin extends mx.skins.RectBorder
{
var __get__width, __get__height, getStyle, _parent, clear, drawRoundRect, __get__x, __get__y;
function ButtonSkin () {
super();
}
function init() {
super.init();
}
function size() {
drawHaloRect(__get__width(), __get__height());
}
function drawHaloRect(w, h) {
var _local6 = getStyle("borderStyle");
var _local4 = getStyle("themeColor");
var _local5 = _parent.emphasized;
clear();
switch (_local6) {
case "falseup" :
if (_local5) {
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 75);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16777215], 85, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, _local4, 75);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16316664, 100);
} else {
drawRoundRect(0, 0, w, h, 5, 9542041, 100);
drawRoundRect(1, 1, w - 2, h - 2, 4, [13291985, 16250871], 100, 0, "radial");
drawRoundRect(2, 2, w - 4, h - 4, 3, [9542041, 13818586], 100, 0, "radial");
drawRoundRect(3, 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(3, 4, w - 6, h - 7, 2, 16316664, 100);
}
break;
case "falsedown" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16579836], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 50);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, _local4, 20);
break;
case "falserollover" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 50);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16777215], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, _local4, 50);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16316664, 100);
break;
case "falsedisabled" :
drawRoundRect(0, 0, w, h, 5, 13159628, 100);
drawRoundRect(1, 1, w - 2, h - 2, 4, 15921906, 100);
drawRoundRect(2, 2, w - 4, h - 4, 3, 13949401, 100);
drawRoundRect(3, 3, w - 6, h - 6, 2, 15921906, 100);
break;
case "trueup" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 10066329, 100);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16579836], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 50);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16250871, 100);
break;
case "truedown" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 10066329, 100);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16579836], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 50);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, _local4, 20);
break;
case "truerollover" :
drawRoundRect(__get__x(), __get__y(), w, h, 5, 9542041, 100);
drawRoundRect(__get__x(), __get__y(), w, h, 5, _local4, 50);
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, [3355443, 16777215], 100, 0, "radial");
drawRoundRect(__get__x() + 1, __get__y() + 1, w - 2, h - 2, 4, _local4, 40);
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, [0, 14342874], 100, 0, "radial");
drawRoundRect(__get__x() + 2, __get__y() + 2, w - 4, h - 4, 3, _local4, 40);
drawRoundRect(__get__x() + 3, __get__y() + 3, w - 6, h - 6, 2, 16777215, 100);
drawRoundRect(__get__x() + 3, __get__y() + 4, w - 6, h - 7, 2, 16316664, 100);
break;
case "truedisabled" :
drawRoundRect(0, 0, w, h, 5, 13159628, 100);
drawRoundRect(1, 1, w - 2, h - 2, 4, 15921906, 100);
drawRoundRect(2, 2, w - 4, h - 4, 3, 13949401, 100);
drawRoundRect(3, 3, w - 6, h - 6, 2, 15921906, 100);
}
}
static function classConstruct() {
mx.core.ext.UIObjectExtensions.Extensions();
_global.skinRegistry.ButtonSkin = true;
return(true);
}
static var symbolName = "ButtonSkin";
static var symbolOwner = mx.skins.halo.ButtonSkin;
var className = "ButtonSkin";
var backgroundColorName = "buttonColor";
static var classConstructed = classConstruct();
static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
}
Symbol 81 MovieClip [__Packages.mx.controls.RadioButton] Frame 0 (5.29 KiB) ● ●
class mx.controls.RadioButton extends mx.controls.Button
{
var setToggle, __value, selected, releaseFocus, phase, dispatchEvent, _parent, __data, setState, __state, getFocusManager;
function RadioButton () {
super();
}
function init(Void) {
setToggle(__toggle);
__value = this;
super.init();
}
function size(Void) {
super.size();
}
function onRelease() {
if (selected) {
return(undefined);
}
releaseFocus();
phase = "up";
setSelected(true);
dispatchEvent({type:"click"});
_parent[__groupName].dispatchEvent({type:"click"});
}
function setData(val) {
__data = val;
}
function set data(val) {
__data = val;
//return(data);
}
function getData(val) {
return(__data);
}
function get data() {
return(__data);
}
function onUnload() {
if (_parent[__groupName].selectedRadio == this) {
_parent[__groupName].selectedRadio = undefined;
}
_parent[__groupName].radioList[indexNumber] = null;
delete _parent[__groupName].radioList[indexNumber];
}
function setSelected(val) {
var _local2 = _parent[__groupName];
var _local4 = _local2.selectedRadio.__width;
var _local5 = _local2.selectedRadio.__height;
if (val) {
_local2.selectedRadio.setState(false);
_local2.selectedRadio = this;
} else if (_local2.selectedRadio == this) {
_local2.selectedRadio.setState(false);
_local2.selectedRadio = undefined;
}
setState(val);
}
function deleteGroupObj(groupName) {
delete _parent[groupName];
}
function getGroupName() {
return(__groupName);
}
function get groupName() {
return(__groupName);
}
function setGroupName(groupName) {
if ((groupName == undefined) || (groupName == "")) {
return(undefined);
}
delete _parent[__groupName].radioList[__data];
addToGroup(groupName);
__groupName = groupName;
}
function set groupName(groupName) {
setGroupName(groupName);
//return(this.groupName);
}
function addToGroup(groupName) {
if ((groupName == "") || (groupName == undefined)) {
return(undefined);
}
var _local2 = _parent[groupName];
if (_local2 == undefined) {
_local2 = (_parent[groupName] = new mx.controls.RadioButtonGroup());
_local2.__groupName = groupName;
}
_local2.addInstance(this);
if (__state) {
_local2.selectedRadio.setState(false);
_local2.selectedRadio = this;
}
}
function get emphasized() {
return(undefined);
}
function keyDown(e) {
switch (e.code) {
case 40 :
setNext();
break;
case 38 :
setPrev();
break;
case 37 :
setPrev();
break;
case 39 :
setNext();
}
}
function setNext() {
var _local2 = _parent[groupName];
if ((_local2.selectedRadio.indexNumber + 1) == _local2.radioList.length) {
return(undefined);
}
var _local4 = (_local2.selectedRadio ? (_local2.selectedRadio.indexNumber) : -1);
var _local3 = 1;
while (_local3 < _local2.radioList.length) {
if ((_local2.radioList[_local4 + _local3] != undefined) && (_local2.radioList[_local4 + _local3].enabled)) {
var _local5 = getFocusManager();
_local2.radioList[_local4 + _local3].selected = true;
_local5.setFocus(_local2.radioList[_local2.selectedRadio.indexNumber]);
_local2.dispatchEvent({type:"click"});
break;
}
_local3++;
}
}
function setPrev() {
var _local2 = _parent[groupName];
if (_local2.selectedRadio.indexNumber == 0) {
return(undefined);
}
var _local4 = (_local2.selectedRadio ? (_local2.selectedRadio.indexNumber) : 1);
var _local3 = 1;
while (_local3 < _local2.radioList.length) {
if ((_local2.radioList[_local4 - _local3] != undefined) && (_local2.radioList[_local4 - _local3].enabled)) {
var _local5 = getFocusManager();
_local2.radioList[_local4 - _local3].selected = true;
_local5.setFocus(_local2.radioList[_local2.selectedRadio.indexNumber]);
_local2.dispatchEvent({type:"click"});
break;
}
_local3++;
}
}
function set toggle(v) {
//return(toggle);
}
function get toggle() {
}
function set icon(v) {
//return(icon);
}
function get icon() {
}
static var symbolName = "RadioButton";
static var symbolOwner = mx.controls.RadioButton;
static var version = "2.0.2.126";
var className = "RadioButton";
var btnOffset = 0;
var __toggle = true;
var __label = "Radio Button";
var __labelPlacement = "right";
var ignoreClassStyleDeclaration = {Button:1};
var __groupName = "radioGroup";
var indexNumber = 0;
var offset = false;
var falseUpSkin = "";
var falseDownSkin = "";
var falseOverSkin = "";
var falseDisabledSkin = "";
var trueUpSkin = "";
var trueDownSkin = "";
var trueOverSkin = "";
var trueDisabledSkin = "";
var falseUpIcon = "RadioFalseUp";
var falseDownIcon = "RadioFalseDown";
var falseOverIcon = "RadioFalseOver";
var falseDisabledIcon = "RadioFalseDisabled";
var trueUpIcon = "RadioTrueUp";
var trueDownIcon = "";
var trueOverIcon = "";
var trueDisabledIcon = "RadioTrueDisabled";
var centerContent = false;
var borderW = 0;
var clipParameters = {labelPlacement:1, data:1, label:1, groupName:1, selected:1};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.controls.RadioButton.prototype.clipParameters, mx.controls.Button.prototype.clipParameters);
}
Symbol 98 MovieClip [__Packages.mx.controls.RadioButtonGroup] Frame 0 (4.57 KiB) ●
class mx.controls.RadioButtonGroup
{
var radioList, __groupName, selectedRadio;
function RadioButtonGroup () {
init();
mx.events.UIEventDispatcher.initialize(this);
}
function init(Void) {
radioList = new Array();
}
function setGroupName(groupName) {
if ((groupName == undefined) || (groupName == "")) {
return(undefined);
}
var _local6 = __groupName;
_parent[groupName] = this;
for (var _local5 in radioList) {
radioList[_local5].groupName = groupName;
var _local3 = radioList[_local5];
}
_local3.deleteGroupObj(_local6);
}
function getGroupName() {
return(__groupName);
}
function addInstance(instance) {
instance.indexNumber = indexNumber++;
radioList.push(instance);
}
function getValue() {
if (selectedRadio.data == "") {
return(selectedRadio.label);
}
return(selectedRadio.__data);
}
function getLabelPlacement() {
for (var _local3 in radioList) {
var _local2 = radioList[_local3].getLabelPlacement();
}
return(_local2);
}
function setLabelPlacement(pos) {
for (var _local3 in radioList) {
radioList[_local3].setLabelPlacement(pos);
}
}
function setEnabled(val) {
for (var _local3 in radioList) {
radioList[_local3].enabled = val;
}
}
function setSize(val, val1) {
for (var _local3 in radioList) {
radioList[_local3].setSize(val, val1);
}
}
function getEnabled() {
for (var _local4 in radioList) {
var _local2 = radioList[_local4].enabled;
var _local3 = t + (_local2 + 0);
}
if (_local3 == radioList.length) {
return(true);
}
if (_local3 == 0) {
return(false);
}
}
function setStyle(name, val) {
for (var _local4 in radioList) {
radioList[_local4].setStyle(name, val);
}
}
function setInstance(val) {
for (var _local3 in radioList) {
if (radioList[_local3] == val) {
radioList[_local3].selected = true;
}
}
}
function getInstance() {
return(selectedRadio);
}
function setValue(val) {
for (var _local4 in radioList) {
if ((radioList[_local4].__data == val) || (radioList[_local4].label == val)) {
var _local2 = _local4;
break;
}
}
if (_local2 != undefined) {
selectedRadio.setState(false);
selectedRadio.hitArea_mc._height = selectedRadio.__height;
selectedRadio.hitArea_mc._width = selectedRadio.__width;
selectedRadio = radioList[_local2];
selectedRadio.setState(true);
selectedRadio.hitArea_mc._height = (selectedRadio.hitArea_mc._width = 0);
}
}
function set groupName(groupName) {
if ((groupName == undefined) || (groupName == "")) {
return;
}
var _local6 = __groupName;
_parent[groupName] = this;
for (var _local5 in radioList) {
radioList[_local5].groupName = groupName;
var _local3 = radioList[_local5];
}
_local3.deleteGroupObj(_local6);
//return(this.groupName);
}
function get groupName() {
return(__groupName);
}
function set selectedData(val) {
for (var _local4 in radioList) {
if ((radioList[_local4].__data == val) || (radioList[_local4].label == val)) {
var _local2 = _local4;
break;
}
}
if (_local2 != undefined) {
selectedRadio.setState(false);
selectedRadio = radioList[_local2];
selectedRadio.setState(true);
}
//return(selectedData);
}
function get selectedData() {
if ((selectedRadio.data == "") || (selectedRadio.data == undefined)) {
return(selectedRadio.label);
}
return(selectedRadio.__data);
}
function get selection() {
return(selectedRadio);
}
function set selection(val) {
for (var _local3 in radioList) {
if (radioList[_local3] == val) {
radioList[_local3].selected = true;
}
}
//return(selection);
}
function set labelPlacement(pos) {
for (var _local3 in radioList) {
radioList[_local3].setLabelPlacement(pos);
}
//return(labelPlacement);
}
function get labelPlacement() {
for (var _local3 in radioList) {
var _local2 = radioList[_local3].getLabelPlacement();
}
return(_local2);
}
function set enabled(val) {
for (var _local3 in radioList) {
radioList[_local3].enabled = val;
}
//return(enabled);
}
function get enabled() {
var _local2 = 0;
for (var _local3 in radioList) {
_local2 = _local2 + radioList[_local3].enabled;
}
if (_local2 == 0) {
return(false);
}
if (_local2 == radioList.length) {
return(true);
}
}
static var symbolName = "RadioButtonGroup";
static var symbolOwner = mx.controls.RadioButtonGroup;
static var version = "2.0.2.126";
var className = "RadioButtonGroup";
var indexNumber = 0;
}
Symbol 169 MovieClip Frame 34 (27 B)
_parent.removeMovieClip();
Symbol 170 MovieClip [flameblast] Frame 1 (8 B)
stop();
Symbol 172 MovieClip Frame 1 (134 B)
stop();
points_txt.embedFonts = true;
points_txt.setNewTextFormat(_global.FORMAT01);
points_txt.text = numbers.format(_parent.XP);
Symbol 173 MovieClip [xppoints] Frame 35 (24 B)
this.removeMovieClip();
Symbol 244 MovieClip Frame 35 (36 B)
stop();
_parent.removeMovieClip();
Symbol 245 MovieClip [lightning1] Frame 1 (8 B)
stop();
Symbol 247 MovieClip Frame 1 (138 B)
stop();
points_txt.embedFonts = true;
points_txt.setNewTextFormat(_global.FORMAT01);
points_txt.text = numbers.format(_parent.DAMAGE);
Symbol 248 MovieClip [damagepoints] Frame 35 (24 B)
this.removeMovieClip();
Symbol 290 MovieClip [fireballA] Frame 1 (187 B)
function setHeight(_H1) {
F = Math.round((100 * _H1) / 300);
if (F > 100) {
F = 100;
}
if (F < 1) {
F = 1;
}
shadow_mc.gotoAndStop(F);
fireball_mc._y = -_H1;
}
Symbol 332 MovieClip [iceballA] Frame 1 (8 B)
stop();
Symbol 382 MovieClip [fireballB] Frame 1 (187 B)
function setHeight(_H1) {
F = Math.round((100 * _H1) / 300);
if (F > 100) {
F = 100;
}
if (F < 1) {
F = 1;
}
shadow_mc.gotoAndStop(F);
fireball_mc._y = -_H1;
}
Symbol 428 MovieClip [poisonball1] Frame 1 (8 B)
stop();
Symbol 429 MovieClip [poisonCloud] Frame 2 (172 B)
FRAMESCOUNT--;
if ((FRAMESCOUNT == 0) || (FRAMESCOUNT == undefined)) {
UNIT.CURPOISONBALL = undefined;
this.removeMovieClip();
} else {
UNIT.poisonUnit(DAMAGE);
}
Symbol 511 MovieClip [firewall1] Frame 1 (8 B)
stop();
Symbol 516 MovieClip Frame 1 (213 B)
function setHealth(_PCT) {
HEALTH = _PCT;
if (HEALTH < 0) {
HEALTH = 0;
}
if (HEALTH > 100) {
HEALTH = 100;
}
gotoAndStop(102 - Math.round(HEALTH));
}
stop();
setHealth(_parent.HEALTH);
Symbol 599 MovieClip Frame 1 (514 B)
function aim() {
setBody(aim_mc, false, 1);
}
function die() {
setBody(die_mc, true, 1);
}
function setBody(_MC, _PLAYCLIP, _PLAYATFRAME) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_PLAYATFRAME);
}
}
stop();
CLIPS = [aim_mc, die_mc];
WALKING = false;
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = _parent._parent;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
MC = aim_mc;
MC._visible = true;
aim();
Symbol 601 MovieClip Frame 1 (8 B)
stop();
Symbol 604 MovieClip [towerguard] Frame 1 (599 B)
#initclip 79
Object.registerClass("towerguard", aiTowerGuard);
#endinitclip
function hitted() {
if (!ALIVE) {
return(undefined);
}
gotoAndPlay (5);
}
function die() {
if (!ALIVE) {
return(undefined);
}
TOWER.archerKilled();
FRAMECOUNT = _global.INTERFACE.FRAMECOUNT;
ALIVE = false;
gotoAndPlay (15);
}
if (INIT == undefined) {
INIT = true;
level_txt.embedFonts = true;
level_txt.setTextFormat(_global.FORMAT01);
ME = this;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
COM = body_mc.com_mc;
HEALTHBAR = health_bar_mc;
LEVELTEXT = level_txt;
}
Symbol 604 MovieClip [towerguard] Frame 2 (8 B)
stop();
Symbol 604 MovieClip [towerguard] Frame 12 (17 B)
gotoAndStop (2);
Symbol 604 MovieClip [towerguard] Frame 35 (33 B)
stop();
this.removeMovieClip();
Symbol 656 MovieClip Frame 24 (8 B)
stop();
Symbol 703 MovieClip Frame 1 (841 B)
function howl() {
setBody(howl_mc, true, 1);
}
function run() {
setBody(run_mc, true, 1);
}
function jumpUp() {
setBody(jumpUp_mc, true, 1);
}
function jumpDown() {
setBody(jumpDown_mc, true, 1);
}
function die() {
setBody(die_mc, true, 1);
}
function setBody(_MC, _PLAYCLIP, _FRAME1) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_FRAME1);
}
}
stop();
CLIPS = [run_mc, howl_mc, jumpUp_mc, jumpDown_mc, die_mc];
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = _parent._parent;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
MC = run_mc;
MC._visible = true;
MC.play();
hitZone_btn.onRollOver = function () {
_global.CURSOR.targetOnUnit();
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.targetOffUnit();
};
Symbol 704 MovieClip Frame 1 (8 B)
stop();
Symbol 705 MovieClip [dog1] Frame 1 (1.02 KiB) ●
#initclip 70
Object.registerClass("dog1", aiGroundUnit2);
#endinitclip
function hitted() {
if (FRAMESICED > 0) {
return(undefined);
}
gotoAndPlay (5);
}
function die() {
if (!ALIVE) {
return(undefined);
}
ALIVE = false;
_global.SCENEMANAGER.unitDead();
BODY.die();
_y = TARGETY;
FRAMECOUNT = _global.INTERFACE.FRAMECOUNT;
_global.RADAR.removeUnit(this);
gotoAndPlay (15);
}
function ice() {
if (!ALIVE) {
return(undefined);
}
BODY.MC.stop();
gotoAndPlay (3);
}
stop();
if (INIT == undefined) {
INIT = true;
ME = this;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
COM = body_mc.com_mc;
EVTMANAGER = _global.EVTMANAGER;
HFACTOR = 50;
HEALTHPCT = 100;
DAMAGEHERO = 5;
INDICATORTYPE = "dogIndicator";
STARTJUMPSPEED = -12;
JUMPSPEED = STARTJUMPSPEED;
SPEED = 8;
HEALTHBAR = health_bar_mc;
_global.RADAR.addUnit(this);
_global.SCENEMANAGER.setUnitDifficulty(this);
if (SIDE == 1) {
body_mc.gotoAndStop(2);
} else {
body_mc.gotoAndStop(1);
}
}
Symbol 705 MovieClip [dog1] Frame 4 (164 B)
FRAMESICED--;
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED <= 0) {
gotoAndStop (2);
BODY.MC.play();
} else {
gotoAndPlay (3);
iceDamage();
}
Symbol 705 MovieClip [dog1] Frame 10 (17 B)
gotoAndStop (2);
Symbol 705 MovieClip [dog1] Frame 87 (33 B)
stop();
this.removeMovieClip();
Symbol 803 MovieClip Frame 1 (8 B)
stop();
Symbol 803 MovieClip Frame 17 (8 B)
stop();
Symbol 803 MovieClip Frame 34 (8 B)
stop();
Symbol 803 MovieClip Frame 52 (8 B)
stop();
Symbol 804 MovieClip [groundeffect] Frame 25 (122 B)
if (_global.SCENEMANAGER.COMPLETEDNIGHT) {
this.removeMovieClip();
} else {
start_mc.gotoAndPlay(GROUNDUNITTYPE);
}
Symbol 804 MovieClip [groundeffect] Frame 40 (151 B)
stop();
if (_global.SCENEMANAGER.COMPLETEDNIGHT) {
this.removeMovieClip();
} else {
_global.SCENEMANAGER.addGroundUnit(this, GROUNDUNITTYPE);
}
Symbol 853 MovieClip Frame 24 (8 B)
stop();
Symbol 885 MovieClip Frame 1 (770 B)
function ready() {
setBody(ready_mc, true, 1);
_parent._parent.FIREDY = -31;
}
function run() {
setBody(run_mc, true, 1);
_parent._parent.FIREDY = -60;
}
function die() {
setBody(die_mc, true, 1);
}
function setBody(_MC, _PLAYCLIP, _FRAME1) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_FRAME1);
}
}
stop();
CLIPS = [run_mc, ready_mc, die_mc];
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = _parent._parent;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
MC = run_mc;
MC._visible = true;
MC.play();
hitZone_btn.onRollOver = function () {
_global.CURSOR.targetOnUnit();
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.targetOffUnit();
};
Symbol 886 MovieClip Frame 1 (31 B)
stop();
_parent.FIREDX = -28;
Symbol 886 MovieClip Frame 2 (21 B)
_parent.FIREDX = 28;
Symbol 887 MovieClip [podling1] Frame 1 (1.02 KiB) ●
#initclip 71
Object.registerClass("podling1", aiGroundUnit1);
#endinitclip
function hitted() {
if (FRAMESICED > 0) {
return(undefined);
}
gotoAndPlay (5);
}
function die() {
if (!ALIVE) {
return(undefined);
}
ALIVE = false;
_global.SCENEMANAGER.unitDead();
BODY.die();
_global.RADAR.removeUnit(this);
FRAMECOUNT = _global.INTERFACE.FRAMECOUNT;
gotoAndPlay (15);
}
function ice() {
if (!ALIVE) {
return(undefined);
}
BODY.MC.stop();
gotoAndPlay (3);
}
stop();
if (INIT == undefined) {
INIT = true;
ME = this;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
COM = body_mc.com_mc;
EVTMANAGER = _global.EVTMANAGER;
HFACTOR = 50;
HEALTHPCT = 100;
DAMAGEHERO = 10;
INDICATORTYPE = "podlingIndicator";
PROJTYPE = "podfireball";
AHEROINTERVAL = 24;
_global.RADAR.addUnit(this);
FIREDY = -31;
SPEED = 8;
HEALTHBAR = health_bar_mc;
_global.SCENEMANAGER.setUnitDifficulty(this);
if (SIDE == 1) {
body_mc.gotoAndStop(2);
} else {
body_mc.gotoAndStop(1);
}
}
Symbol 887 MovieClip [podling1] Frame 4 (164 B)
FRAMESICED--;
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED <= 0) {
gotoAndStop (2);
BODY.MC.play();
} else {
gotoAndPlay (3);
iceDamage();
}
Symbol 887 MovieClip [podling1] Frame 10 (17 B)
gotoAndStop (2);
Symbol 887 MovieClip [podling1] Frame 87 (33 B)
stop();
this.removeMovieClip();
Symbol 935 MovieClip Frame 24 (8 B)
stop();
Symbol 1010 MovieClip Frame 6 (17 B)
UNIT.hitHouse();
Symbol 1010 MovieClip Frame 15 (33 B)
stop();
UNIT.doneAttackHouse();
Symbol 1061 MovieClip Frame 10 (32 B)
stop();
UNIT.doneTakePerson();
Symbol 1112 MovieClip Frame 1 (8 B)
stop();
Symbol 1112 MovieClip Frame 20 (46 B)
stop();
UNIT.sendUnit();
_visible = false;
Symbol 1112 MovieClip Frame 42 (52 B)
stop();
UNIT.sendProjectile();
_visible = false;
Symbol 1137 MovieClip Frame 24 (8 B)
stop();
Symbol 1194 MovieClip Frame 1 (1.85 KiB) ●
function fly() {
setBody(fly_mc, true, 1);
showWingsAndTail();
}
function spellMove() {
setBody(spellMove_mc, true, 1);
showWingsAndTail();
}
function attackHouse() {
setBody(attackHouse_mc, true, 1);
showWingsAndTail();
}
function takePerson() {
setBody(takePerson_mc, true, 1);
showWingsAndTail();
}
function die() {
setBody(die_mc, true, 1);
hideWingsAndTail();
}
function setBody(_MC, _PLAYCLIP, _PLAYATFRAME) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_PLAYATFRAME);
}
}
function showWingsAndTail() {
if (WINGSANDTAIL) {
return(undefined);
}
WINGSANDTAIL = true;
fwing_mc._visible = true;
bwing_mc._visible = true;
tail_mc._visible = true;
fwing_mc.gotoAndPlay(1);
bwing_mc.gotoAndPlay(1);
tail_mc.gotoAndPlay(1);
}
function hideWingsAndTail() {
if (!WINGSANDTAIL) {
return(undefined);
}
WINGSANDTAIL = false;
fwing_mc._visible = false;
bwing_mc._visible = false;
tail_mc._visible = false;
}
function startSpell(_SPELLTYPE) {
spellMove();
spellStart_mc._visible = true;
spellStart_mc.gotoAndPlay(_SPELLTYPE);
}
function stopParts() {
fwing_mc.stop();
bwing_mc.stop();
tail_mc.stop();
}
function playParts() {
fwing_mc.play();
bwing_mc.play();
tail_mc.play();
}
stop();
WINGSANDTAIL = false;
CLIPS = [fly_mc, fwing_mc, bwing_mc, tail_mc, spellMove_mc, attackHouse_mc, takePerson_mc, die_mc];
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = _parent._parent;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
spellStart_mc.UNIT = _parent._parent;
spellStart_mc._visible = false;
MC = fly_mc;
showWingsAndTail();
MC._visible = true;
MC.play();
hitZone_btn.onRollOver = function () {
_global.CURSOR.targetOnUnit();
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.targetOffUnit();
};
Symbol 1195 MovieClip Frame 1 (31 B)
stop();
_parent.FIREDX = -24;
Symbol 1195 MovieClip Frame 2 (21 B)
_parent.FIREDX = 24;
Symbol 1196 MovieClip [nybras1] Frame 1 (1.46 KiB) ●
#initclip 72
Object.registerClass("nybras1", aiFlyUnit);
#endinitclip
function hitted() {
if (FRAMESICED > 0) {
return(undefined);
}
if (!ALIVE) {
return(undefined);
}
if (((MSTATE == GOTOHOUSE) || (MSTATE == ATTACKHOUSE)) || (MSTATE == TAKEPERSON)) {
movementDecision();
_global.EVTMANAGER.evt(AHOUSEINTERVAL, attackHouse, this);
}
gotoAndPlay (5);
}
function die() {
if (!ALIVE) {
return(undefined);
}
ALIVE = false;
_global.RADAR.removeUnit(this);
_global.SCENEMANAGER.unitDead();
BODY.die();
FRAMECOUNT = _global.INTERFACE.FRAMECOUNT;
gotoAndPlay (15);
}
function ice() {
if (!ALIVE) {
return(undefined);
}
BODY.MC.stop();
BODY.stopParts();
gotoAndPlay (3);
}
stop();
if (INIT == undefined) {
INIT = true;
ME = this;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
COM = body_mc.com_mc;
EVTMANAGER = _global.EVTMANAGER;
HFACTOR = 100;
HEALTHPCT = 100;
AHOUSEINTERVAL = 36;
AHEROINTERVAL = 28.8;
PROJTYPE = "fireballB";
CREATEUNITBALL = "fiery1";
DAMAGEHOUSE = 20;
DAMAGEHERO = 20;
INDICATORTYPE = "wyvernIndicator";
CREATEUNITFACTOR = 10;
GROUNDUNIT1 = "dog1";
GROUNDUNIT2 = "podling1";
GROUNDUNIT3 = "spider1";
GROUNDUNITSQTY = 3;
_global.RADAR.addUnit(this);
SPEED = 8;
FIREDY = -20;
TARGETY = 100;
HEALTHBAR = health_bar_mc;
_global.SCENEMANAGER.setUnitDifficulty(this);
if (SIDE == 1) {
body_mc.gotoAndStop(2);
} else {
body_mc.gotoAndStop(1);
}
}
Symbol 1196 MovieClip [nybras1] Frame 4 (184 B)
FRAMESICED--;
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED <= 0) {
gotoAndStop (2);
BODY.MC.play();
BODY.playParts();
} else {
gotoAndPlay (3);
iceDamage();
}
Symbol 1196 MovieClip [nybras1] Frame 10 (17 B)
gotoAndStop (2);
Symbol 1196 MovieClip [nybras1] Frame 87 (33 B)
stop();
this.removeMovieClip();
Symbol 1299 MovieClip Frame 20 (8 B)
stop();
Symbol 1326 MovieClip Frame 1 (844 B)
function ready() {
setBody(ready_mc, true, 1);
}
function run() {
setBody(run_mc, true, 1);
}
function jumpUp() {
setBody(jumpUp_mc, true, 1);
}
function jumpDown() {
setBody(jumpDown_mc, true, 1);
}
function die() {
setBody(die_mc, true, 1);
}
function setBody(_MC, _PLAYCLIP, _FRAME1) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_FRAME1);
}
}
stop();
CLIPS = [run_mc, ready_mc, jumpUp_mc, jumpDown_mc, die_mc];
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = _parent._parent;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
MC = run_mc;
MC._visible = true;
MC.play();
hitZone_btn.onRollOver = function () {
_global.CURSOR.targetOnUnit();
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.targetOffUnit();
};
Symbol 1327 MovieClip Frame 1 (8 B)
stop();
Symbol 1328 MovieClip [spider1] Frame 1 (1.03 KiB) ●
#initclip 73
Object.registerClass("spider1", aiGroundUnit2);
#endinitclip
function hitted() {
if (FRAMESICED > 0) {
return(undefined);
}
gotoAndPlay (5);
}
function die() {
if (!ALIVE) {
return(undefined);
}
ALIVE = false;
_global.SCENEMANAGER.unitDead();
BODY.die();
_y = TARGETY;
FRAMECOUNT = _global.INTERFACE.FRAMECOUNT;
_global.RADAR.removeUnit(this);
gotoAndPlay (15);
}
function ice() {
if (!ALIVE) {
return(undefined);
}
BODY.MC.stop();
gotoAndPlay (3);
}
stop();
if (INIT == undefined) {
INIT = true;
ME = this;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
COM = body_mc.com_mc;
EVTMANAGER = _global.EVTMANAGER;
HFACTOR = 50;
HEALTHPCT = 100;
DAMAGEHERO = 15;
INDICATORTYPE = "spiderIndicator";
SPEED = 6;
STARTJUMPSPEED = -12;
JUMPSPEED = STARTJUMPSPEED;
HEALTHBAR = health_bar_mc;
_global.RADAR.addUnit(this);
_global.SCENEMANAGER.setUnitDifficulty(this);
if (SIDE == 1) {
body_mc.gotoAndStop(2);
} else {
body_mc.gotoAndStop(1);
}
}
Symbol 1328 MovieClip [spider1] Frame 4 (164 B)
FRAMESICED--;
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED <= 0) {
gotoAndStop (2);
BODY.MC.play();
} else {
gotoAndPlay (3);
iceDamage();
}
Symbol 1328 MovieClip [spider1] Frame 10 (17 B)
gotoAndStop (2);
Symbol 1328 MovieClip [spider1] Frame 87 (33 B)
stop();
this.removeMovieClip();
Symbol 1377 MovieClip Frame 24 (8 B)
stop();
Symbol 1423 MovieClip Frame 1 (841 B)
function howl() {
setBody(howl_mc, true, 1);
}
function run() {
setBody(run_mc, true, 1);
}
function jumpUp() {
setBody(jumpUp_mc, true, 1);
}
function jumpDown() {
setBody(jumpDown_mc, true, 1);
}
function die() {
setBody(die_mc, true, 1);
}
function setBody(_MC, _PLAYCLIP, _FRAME1) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_FRAME1);
}
}
stop();
CLIPS = [run_mc, howl_mc, jumpUp_mc, jumpDown_mc, die_mc];
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = _parent._parent;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
MC = run_mc;
MC._visible = true;
MC.play();
hitZone_btn.onRollOver = function () {
_global.CURSOR.targetOnUnit();
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.targetOffUnit();
};
Symbol 1424 MovieClip Frame 1 (8 B)
stop();
Symbol 1425 MovieClip [dog2] Frame 1 (1.02 KiB) ●
#initclip 74
Object.registerClass("dog2", aiGroundUnit2);
#endinitclip
function hitted() {
if (FRAMESICED > 0) {
return(undefined);
}
gotoAndPlay (5);
}
function die() {
if (!ALIVE) {
return(undefined);
}
ALIVE = false;
_global.SCENEMANAGER.unitDead();
BODY.die();
_y = TARGETY;
FRAMECOUNT = _global.INTERFACE.FRAMECOUNT;
_global.RADAR.removeUnit(this);
gotoAndPlay (15);
}
function ice() {
if (!ALIVE) {
return(undefined);
}
BODY.MC.stop();
gotoAndPlay (3);
}
stop();
if (INIT == undefined) {
INIT = true;
ME = this;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
COM = body_mc.com_mc;
EVTMANAGER = _global.EVTMANAGER;
HFACTOR = 75;
HEALTHPCT = 100;
DAMAGEHERO = 10;
INDICATORTYPE = "dogIndicator";
STARTJUMPSPEED = -13;
JUMPSPEED = STARTJUMPSPEED;
SPEED = 8;
HEALTHBAR = health_bar_mc;
_global.RADAR.addUnit(this);
_global.SCENEMANAGER.setUnitDifficulty(this);
if (SIDE == 1) {
body_mc.gotoAndStop(2);
} else {
body_mc.gotoAndStop(1);
}
}
Symbol 1425 MovieClip [dog2] Frame 4 (164 B)
FRAMESICED--;
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED <= 0) {
gotoAndStop (2);
BODY.MC.play();
} else {
gotoAndPlay (3);
iceDamage();
}
Symbol 1425 MovieClip [dog2] Frame 10 (17 B)
gotoAndStop (2);
Symbol 1425 MovieClip [dog2] Frame 87 (33 B)
stop();
this.removeMovieClip();
Symbol 1474 MovieClip Frame 24 (8 B)
stop();
Symbol 1520 MovieClip Frame 1 (841 B)
function howl() {
setBody(howl_mc, true, 1);
}
function run() {
setBody(run_mc, true, 1);
}
function jumpUp() {
setBody(jumpUp_mc, true, 1);
}
function jumpDown() {
setBody(jumpDown_mc, true, 1);
}
function die() {
setBody(die_mc, true, 1);
}
function setBody(_MC, _PLAYCLIP, _FRAME1) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_FRAME1);
}
}
stop();
CLIPS = [run_mc, howl_mc, jumpUp_mc, jumpDown_mc, die_mc];
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = _parent._parent;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
MC = run_mc;
MC._visible = true;
MC.play();
hitZone_btn.onRollOver = function () {
_global.CURSOR.targetOnUnit();
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.targetOffUnit();
};
Symbol 1521 MovieClip Frame 1 (8 B)
stop();
Symbol 1522 MovieClip [dog3] Frame 1 (1.02 KiB) ●
#initclip 75
Object.registerClass("dog3", aiGroundUnit2);
#endinitclip
function hitted() {
if (FRAMESICED > 0) {
return(undefined);
}
gotoAndPlay (5);
}
function die() {
if (!ALIVE) {
return(undefined);
}
ALIVE = false;
_global.SCENEMANAGER.unitDead();
BODY.die();
_y = TARGETY;
FRAMECOUNT = _global.INTERFACE.FRAMECOUNT;
_global.RADAR.removeUnit(this);
gotoAndPlay (15);
}
function ice() {
if (!ALIVE) {
return(undefined);
}
BODY.MC.stop();
gotoAndPlay (3);
}
stop();
if (INIT == undefined) {
INIT = true;
ME = this;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
COM = body_mc.com_mc;
EVTMANAGER = _global.EVTMANAGER;
HFACTOR = 100;
HEALTHPCT = 100;
DAMAGEHERO = 12;
INDICATORTYPE = "dogIndicator";
STARTJUMPSPEED = -14;
JUMPSPEED = STARTJUMPSPEED;
SPEED = 8;
HEALTHBAR = health_bar_mc;
_global.RADAR.addUnit(this);
_global.SCENEMANAGER.setUnitDifficulty(this);
if (SIDE == 1) {
body_mc.gotoAndStop(2);
} else {
body_mc.gotoAndStop(1);
}
}
Symbol 1522 MovieClip [dog3] Frame 4 (164 B)
FRAMESICED--;
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED <= 0) {
gotoAndStop (2);
BODY.MC.play();
} else {
gotoAndPlay (3);
iceDamage();
}
Symbol 1522 MovieClip [dog3] Frame 10 (17 B)
gotoAndStop (2);
Symbol 1522 MovieClip [dog3] Frame 87 (33 B)
stop();
this.removeMovieClip();
Symbol 1571 MovieClip Frame 24 (8 B)
stop();
Symbol 1646 MovieClip Frame 6 (17 B)
UNIT.hitHouse();
Symbol 1646 MovieClip Frame 15 (33 B)
stop();
UNIT.doneAttackHouse();
Symbol 1647 MovieClip Frame 10 (32 B)
stop();
UNIT.doneTakePerson();
Symbol 1648 MovieClip Frame 1 (8 B)
stop();
Symbol 1648 MovieClip Frame 20 (46 B)
stop();
UNIT.sendUnit();
_visible = false;
Symbol 1648 MovieClip Frame 42 (52 B)
stop();
UNIT.sendProjectile();
_visible = false;
Symbol 1673 MovieClip Frame 24 (8 B)
stop();
Symbol 1754 MovieClip Frame 1 (1.85 KiB) ●
function fly() {
setBody(fly_mc, true, 1);
showWingsAndTail();
}
function spellMove() {
setBody(spellMove_mc, true, 1);
showWingsAndTail();
}
function attackHouse() {
setBody(attackHouse_mc, true, 1);
showWingsAndTail();
}
function takePerson() {
setBody(takePerson_mc, true, 1);
showWingsAndTail();
}
function die() {
setBody(die_mc, true, 1);
hideWingsAndTail();
}
function setBody(_MC, _PLAYCLIP, _PLAYATFRAME) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_PLAYATFRAME);
}
}
function showWingsAndTail() {
if (WINGSANDTAIL) {
return(undefined);
}
WINGSANDTAIL = true;
fwing_mc._visible = true;
bwing_mc._visible = true;
tail_mc._visible = true;
fwing_mc.gotoAndPlay(1);
bwing_mc.gotoAndPlay(1);
tail_mc.gotoAndPlay(1);
}
function hideWingsAndTail() {
if (!WINGSANDTAIL) {
return(undefined);
}
WINGSANDTAIL = false;
fwing_mc._visible = false;
bwing_mc._visible = false;
tail_mc._visible = false;
}
function startSpell(_SPELLTYPE) {
spellMove();
spellStart_mc._visible = true;
spellStart_mc.gotoAndPlay(_SPELLTYPE);
}
function stopParts() {
fwing_mc.stop();
bwing_mc.stop();
tail_mc.stop();
}
function playParts() {
fwing_mc.play();
bwing_mc.play();
tail_mc.play();
}
stop();
WINGSANDTAIL = false;
CLIPS = [fly_mc, fwing_mc, bwing_mc, tail_mc, spellMove_mc, attackHouse_mc, takePerson_mc, die_mc];
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = _parent._parent;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
spellStart_mc.UNIT = _parent._parent;
spellStart_mc._visible = false;
MC = fly_mc;
showWingsAndTail();
MC._visible = true;
MC.play();
hitZone_btn.onRollOver = function () {
_global.CURSOR.targetOnUnit();
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.targetOffUnit();
};
Symbol 1755 MovieClip Frame 1 (31 B)
stop();
_parent.FIREDX = -24;
Symbol 1755 MovieClip Frame 2 (21 B)
_parent.FIREDX = 24;
Symbol 1756 MovieClip [nybras2] Frame 1 (1.46 KiB) ●
#initclip 76
Object.registerClass("nybras2", aiFlyUnit);
#endinitclip
function hitted() {
if (FRAMESICED > 0) {
return(undefined);
}
if (!ALIVE) {
return(undefined);
}
if (((MSTATE == GOTOHOUSE) || (MSTATE == ATTACKHOUSE)) || (MSTATE == TAKEPERSON)) {
movementDecision();
_global.EVTMANAGER.evt(AHOUSEINTERVAL, attackHouse, this);
}
gotoAndPlay (5);
}
function die() {
if (!ALIVE) {
return(undefined);
}
ALIVE = false;
_global.RADAR.removeUnit(this);
_global.SCENEMANAGER.unitDead();
BODY.die();
FRAMECOUNT = _global.INTERFACE.FRAMECOUNT;
gotoAndPlay (15);
}
function ice() {
if (!ALIVE) {
return(undefined);
}
BODY.MC.stop();
BODY.stopParts();
gotoAndPlay (3);
}
stop();
if (INIT == undefined) {
INIT = true;
ME = this;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
COM = body_mc.com_mc;
EVTMANAGER = _global.EVTMANAGER;
HFACTOR = 150;
HEALTHPCT = 100;
AHOUSEINTERVAL = 28.8;
AHEROINTERVAL = 24;
PROJTYPE = "fireballB";
CREATEUNITBALL = "fiery1";
DAMAGEHOUSE = 20;
DAMAGEHERO = 20;
INDICATORTYPE = "wyvernIndicator";
CREATEUNITFACTOR = 9;
GROUNDUNIT1 = "dog2";
GROUNDUNIT2 = "podling1";
GROUNDUNIT3 = "spider1";
GROUNDUNITSQTY = 3;
_global.RADAR.addUnit(this);
SPEED = 8;
FIREDY = -20;
TARGETY = 100;
HEALTHBAR = health_bar_mc;
_global.SCENEMANAGER.setUnitDifficulty(this);
if (SIDE == 1) {
body_mc.gotoAndStop(2);
} else {
body_mc.gotoAndStop(1);
}
}
Symbol 1756 MovieClip [nybras2] Frame 4 (184 B)
FRAMESICED--;
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED <= 0) {
gotoAndStop (2);
BODY.MC.play();
BODY.playParts();
} else {
gotoAndPlay (3);
iceDamage();
}
Symbol 1756 MovieClip [nybras2] Frame 10 (17 B)
gotoAndStop (2);
Symbol 1756 MovieClip [nybras2] Frame 87 (33 B)
stop();
this.removeMovieClip();
Symbol 1805 MovieClip Frame 24 (8 B)
stop();
Symbol 1880 MovieClip Frame 6 (17 B)
UNIT.hitHouse();
Symbol 1880 MovieClip Frame 15 (33 B)
stop();
UNIT.doneAttackHouse();
Symbol 1881 MovieClip Frame 10 (32 B)
stop();
UNIT.doneTakePerson();
Symbol 1882 MovieClip Frame 1 (8 B)
stop();
Symbol 1882 MovieClip Frame 20 (46 B)
stop();
UNIT.sendUnit();
_visible = false;
Symbol 1882 MovieClip Frame 42 (52 B)
stop();
UNIT.sendProjectile();
_visible = false;
Symbol 1907 MovieClip Frame 24 (8 B)
stop();
Symbol 1988 MovieClip Frame 1 (1.85 KiB) ●
function fly() {
setBody(fly_mc, true, 1);
showWingsAndTail();
}
function spellMove() {
setBody(spellMove_mc, true, 1);
showWingsAndTail();
}
function attackHouse() {
setBody(attackHouse_mc, true, 1);
showWingsAndTail();
}
function takePerson() {
setBody(takePerson_mc, true, 1);
showWingsAndTail();
}
function die() {
setBody(die_mc, true, 1);
hideWingsAndTail();
}
function setBody(_MC, _PLAYCLIP, _PLAYATFRAME) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_PLAYATFRAME);
}
}
function showWingsAndTail() {
if (WINGSANDTAIL) {
return(undefined);
}
WINGSANDTAIL = true;
fwing_mc._visible = true;
bwing_mc._visible = true;
tail_mc._visible = true;
fwing_mc.gotoAndPlay(1);
bwing_mc.gotoAndPlay(1);
tail_mc.gotoAndPlay(1);
}
function hideWingsAndTail() {
if (!WINGSANDTAIL) {
return(undefined);
}
WINGSANDTAIL = false;
fwing_mc._visible = false;
bwing_mc._visible = false;
tail_mc._visible = false;
}
function startSpell(_SPELLTYPE) {
spellMove();
spellStart_mc._visible = true;
spellStart_mc.gotoAndPlay(_SPELLTYPE);
}
function stopParts() {
fwing_mc.stop();
bwing_mc.stop();
tail_mc.stop();
}
function playParts() {
fwing_mc.play();
bwing_mc.play();
tail_mc.play();
}
stop();
WINGSANDTAIL = false;
CLIPS = [fly_mc, fwing_mc, bwing_mc, tail_mc, spellMove_mc, attackHouse_mc, takePerson_mc, die_mc];
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = _parent._parent;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
spellStart_mc.UNIT = _parent._parent;
spellStart_mc._visible = false;
MC = fly_mc;
showWingsAndTail();
MC._visible = true;
MC.play();
hitZone_btn.onRollOver = function () {
_global.CURSOR.targetOnUnit();
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.targetOffUnit();
};
Symbol 1989 MovieClip Frame 1 (31 B)
stop();
_parent.FIREDX = -24;
Symbol 1989 MovieClip Frame 2 (21 B)
_parent.FIREDX = 24;
Symbol 1990 MovieClip [nybras3] Frame 1 (1.42 KiB) ●
#initclip 77
Object.registerClass("nybras3", aiFlyUnit);
#endinitclip
function hitted() {
if (FRAMESICED > 0) {
return(undefined);
}
if (!ALIVE) {
return(undefined);
}
if (((MSTATE == GOTOHOUSE) || (MSTATE == ATTACKHOUSE)) || (MSTATE == TAKEPERSON)) {
movementDecision();
_global.EVTMANAGER.evt(AHOUSEINTERVAL, attackHouse, this);
}
gotoAndPlay (5);
}
function die() {
if (!ALIVE) {
return(undefined);
}
ALIVE = false;
_global.RADAR.removeUnit(this);
_global.SCENEMANAGER.unitDead();
BODY.die();
FRAMECOUNT = _global.INTERFACE.FRAMECOUNT;
gotoAndPlay (15);
}
function ice() {
if (!ALIVE) {
return(undefined);
}
BODY.MC.stop();
BODY.stopParts();
gotoAndPlay (3);
}
stop();
if (INIT == undefined) {
INIT = true;
ME = this;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
COM = body_mc.com_mc;
HFACTOR = 200;
HEALTHPCT = 100;
AHOUSEINTERVAL = 24;
AHEROINTERVAL = 24;
PROJTYPE = "fireballB";
CREATEUNITBALL = "fiery1";
DAMAGEHOUSE = 20;
DAMAGEHERO = 20;
INDICATORTYPE = "wyvernIndicator";
CREATEUNITFACTOR = 8;
GROUNDUNIT1 = "dog3";
GROUNDUNIT2 = "podling1";
GROUNDUNIT3 = "spider1";
GROUNDUNITSQTY = 3;
_global.RADAR.addUnit(this);
SPEED = 8;
FIREDY = -20;
TARGETY = 100;
HEALTHBAR = health_bar_mc;
_global.SCENEMANAGER.setUnitDifficulty(this);
if (SIDE == 1) {
body_mc.gotoAndStop(2);
} else {
body_mc.gotoAndStop(1);
}
}
Symbol 1990 MovieClip [nybras3] Frame 4 (184 B)
FRAMESICED--;
if (!ALIVE) {
return(undefined);
}
if (FRAMESICED <= 0) {
gotoAndStop (2);
BODY.MC.play();
BODY.playParts();
} else {
gotoAndPlay (3);
iceDamage();
}
Symbol 1990 MovieClip [nybras3] Frame 10 (17 B)
gotoAndStop (2);
Symbol 1990 MovieClip [nybras3] Frame 87 (33 B)
stop();
this.removeMovieClip();
Symbol 2031 MovieClip Frame 20 (27 B)
_parent.removeMovieClip();
Symbol 2032 MovieClip [blood] Frame 1 (8 B)
stop();
Symbol 2042 MovieClip [flameblast2] Frame 1 (8 B)
stop();
Symbol 2179 MovieClip Frame 68 (8 B)
stop();
Symbol 2224 MovieClip Frame 161 (1 B)
Symbol 2225 MovieClip Frame 2 (44 B)
_global.JUKEBOX.playSound1("sound_appear");
Symbol 2225 MovieClip Frame 15 (28 B)
stop();
UNIT.doneAppear();
Symbol 2226 MovieClip Frame 2 (44 B)
_global.JUKEBOX.playSound1("sound_appear");
Symbol 2226 MovieClip Frame 15 (31 B)
stop();
UNIT.doneDisappear();
Symbol 2240 MovieClip [bat1] Frame 1 (8 B)
stop();
Symbol 2241 MovieClip Frame 1 (8 B)
stop();
Symbol 2241 MovieClip Frame 5 (95 B)
stop();
_global.JUKEBOX.playSound1("sound_fireballA");
UNIT.sendSpell();
_visible = false;
Symbol 2241 MovieClip Frame 10 (96 B)
stop();
_global.JUKEBOX.playSound1("sound_poisonball");
UNIT.sendSpell();
_visible = false;
Symbol 2241 MovieClip Frame 17 (93 B)
stop();
UNIT.sendSpell();
_global.JUKEBOX.playSound1("sound_iceball");
_visible = false;
Symbol 2241 MovieClip Frame 22 (89 B)
stop();
_global.JUKEBOX.playSound1("sound_bat");
UNIT.sendSpell();
_visible = false;
Symbol 2241 MovieClip Frame 28 (51 B)
stop();
UNIT.sendLightning();
_visible = false;
Symbol 2241 MovieClip Frame 33 (99 B)
stop();
UNIT.createFirewall();
_global.JUKEBOX.playSound1("sound_firewall");
_visible = false;
Symbol 2241 MovieClip Frame 38 (94 B)
stop();
_global.JUKEBOX.playSound1("sound_repair");
UNIT.repairHouse();
_visible = false;
Symbol 2241 MovieClip Frame 44 (89 B)
stop();
_global.JUKEBOX.playSound1("sound_heal");
UNIT.healUnit();
_visible = false;
Symbol 2242 MovieClip Frame 1 (1.51 KiB) ●
function ready() {
setBody(ready_mc, true, 1);
UNIT.CURHEIGHT = 85;
setStartSpellPos();
}
function walk() {
setBody(walk_mc, true, 1);
UNIT.CURHEIGHT = 85;
setStartSpellPos();
}
function fly() {
setBody(fly_mc, true, 1);
UNIT.CURHEIGHT = 85;
setStartSpellPos();
}
function jump() {
setBody(jump_mc, true, 1);
UNIT.CURHEIGHT = 85;
setStartSpellPos();
}
function kneel() {
setBody(kneel_mc, true, 1);
UNIT.CURHEIGHT = 55;
setStartSpellPos();
}
function die() {
setBody(die_mc, true, 1);
}
function disappear() {
setBody(disappear_mc, true, 1);
}
function appear() {
setBody(appear_mc, true, 1);
}
function setBody(_MC, _PLAYCLIP, _PLAYATFRAME) {
MC.stop();
MC._visible = false;
MC = _MC;
MC._visible = true;
if (_PLAYCLIP) {
MC.gotoAndPlay(_PLAYATFRAME);
}
}
function startSpell(_SPELLOBJ) {
spell_mc._visible = true;
spell_mc.gotoAndPlay(_SPELLOBJ.NAME);
}
function setStartSpellPos() {
if (UNIT.CURHEIGHT == 55) {
spell_mc._x = 35;
spell_mc._y = 53;
} else {
spell_mc._x = 26;
spell_mc._y = 19;
}
}
stop();
UNIT = _parent._parent;
spell_mc.UNIT = UNIT;
spell_mc._visible = false;
CLIPS = [];
CLIPS.push(ready_mc);
CLIPS.push(walk_mc);
CLIPS.push(fly_mc);
CLIPS.push(jump_mc);
CLIPS.push(kneel_mc);
CLIPS.push(die_mc);
CLIPS.push(disappear_mc);
CLIPS.push(appear_mc);
C = CLIPS.length;
i = 0;
while (i < C) {
CLIPS[i].UNIT = UNIT;
CLIPS[i].stop();
CLIPS[i]._visible = false;
i++;
}
MC = ready_mc;
MC._visible = true;
ready();
Symbol 2243 MovieClip Frame 1 (8 B)
stop();
Symbol 2244 MovieClip [hero] Frame 1 (360 B)
#initclip 78
Object.registerClass("hero", aiHero);
#endinitclip
function hitted() {
ISHITTED = true;
gotoAndPlay (5);
}
stop();
if (INIT == undefined) {
INIT = true;
BODY = body_mc.body_mc;
BODYORIENTATION = body_mc;
EVTMANAGER = _global.EVTMANAGER;
if (SIDE == 1) {
body_mc.gotoAndStop(2);
} else {
body_mc.gotoAndStop(1);
}
}
Symbol 2244 MovieClip [hero] Frame 11 (36 B)
ISHITTED = false;
gotoAndStop (2);
Symbol 2271 MovieClip Frame 13 (27 B)
_parent.removeMovieClip();
Symbol 2311 MovieClip Frame 19 (27 B)
_parent.removeMovieClip();
Symbol 2312 MovieClip [sparks] Frame 1 (8 B)
stop();
Symbol 2333 MovieClip Frame 1 (2.57 KiB) ●
function begin(_STYLE) {
LASTTRACKTOPLAY = TRACKTOPLAY;
switch (_STYLE) {
case 1 :
TRACKTOPLAY = "beneath_loop01";
break;
case 2 :
TRACKTOPLAY = "beneath_loop02";
break;
case 3 :
TRACKTOPLAY = "epic-7-suspense";
break;
default :
TRACKTOPLAY = "beneath_loop01";
}
if ((!MUTE) && (TRACKTOPLAY != LASTTRACKTOPLAY)) {
JUKEBOX.stop();
JUKEBOX.attachSound(TRACKTOPLAY);
JUKEBOX.start(0, 0);
}
}
function skipForward() {
PLAYINDEX++;
if (PLAYINDEX >= PLAYLIST.length) {
PLAYINDEX = 0;
}
if (!MUTE) {
JUKEBOX.stop();
JUKEBOX.attachSound(PLAYLIST[PLAYINDEX]);
JUKEBOX.start(0, PLAYLOOP);
}
}
function skipBackward() {
PLAYINDEX--;
if (PLAYINDEX < 0) {
PLAYINDEX = PLAYLIST.length - 1;
}
if (!MUTE) {
JUKEBOX.stop();
JUKEBOX.attachSound(PLAYLIST[PLAYINDEX]);
JUKEBOX.start(0, PLAYLOOP);
}
}
function stopJukebox() {
JUKEBOX.stop();
}
function soundOff() {
MUTE = true;
JUKEBOX.stop();
}
function soundOn() {
MUTE = false;
if (!STOP) {
JUKEBOX.attachSound(TRACKTOPLAY);
JUKEBOX.start(0, 0);
}
}
function setVolume(_PCT) {
JUKEBOX.setVolume(Math.round(_PCT * 0.5));
SFX1.setVolume(Math.round(_PCT * 0.2));
SFX2.setVolume(Math.round(_PCT * 1));
SFX3.setVolume(Math.round(_PCT * 0.3));
}
function playSound1(_SOUNDID) {
if (!MUTE) {
SFX1.attachSound(_SOUNDID);
SFX1.start();
}
}
function playSound2(_SOUNDID) {
if (!MUTE) {
SFX2.attachSound(_SOUNDID);
SFX2.start();
}
}
function playSound3(_SOUNDID) {
if (!MUTE) {
SFX3.attachSound(_SOUNDID);
SFX3.start();
}
}
stop();
_global.JUKEBOX = this;
JUKEBOX = new Sound(dummy1_mc);
SFX1 = new Sound(dummy2_mc);
SFX2 = new Sound(dummy3_mc);
SFX3 = new Sound(dummy4_mc);
PLAYINDEX = 0;
PLAYLOOP = 0;
TRACKTOPLAY = "";
PLAYLIST = new Array();
PLAYLIST.push("Are_you_ready");
PLAYLIST.push("On_the_edge_1");
nosound_btn._visible = false;
play_btn._visible = false;
MUTE = false;
STOP = false;
setVolume(100);
JUKEBOX.onSoundComplete = function () {
if (!MUTE) {
JUKEBOX.attachSound(TRACKTOPLAY);
JUKEBOX.start(0, 0);
}
};
skipb_btn.onRelease = function () {
skipBackward();
};
skipf_btn.onRelease = function () {
skipForward();
};
stop_btn.onRelease = function () {
STOP = true;
stop_btn._visible = false;
play_btn._visible = true;
JUKEBOX.stop();
};
play_btn.onRelease = function () {
STOP = false;
play_btn._visible = false;
stop_btn._visible = true;
if (!MUTE) {
JUKEBOX.attachSound(PLAYLIST[PLAYINDEX]);
JUKEBOX.start(0, PLAYLOOP);
}
};
Symbol 2340 Button (82 B)
on (release) {
url = "http://www.qigames.com";
getURL (url, "_blank", "POST");
}
Symbol 2342 MovieClip Frame 75 (32 B)
_parent.gotoAndStop("splash2");
Symbol 2349 Button (89 B)
on (release) {
url = "http://www.playnow3dgames.com";
getURL (url, "_blank", "POST");
}
Symbol 2351 MovieClip Frame 75 (29 B)
_parent.gotoAndStop("game");
Symbol 2355 Button (125 B)
on (release) {
url = "http://www.playnow3dgames.com/index.php?refgame=" + _global.GAMEID;
getURL (url, "_blank", "POST");
}
Symbol 2359 Button (125 B)
on (release) {
url = "http://www.playnow3dgames.com/index.php?refgame=" + _global.GAMEID;
getURL (url, "_blank", "POST");
}
Symbol 2363 Button (136 B)
on (release) {
url = "http://www.playnow3dgames.com/gamesforyoursite.php?refgame=" + _global.GAMEID;
getURL (url, "_blank", "POST");
}
Symbol 2365 MovieClip Frame 1 (8 B)
stop();
Symbol 2375 MovieClip Frame 1 (8 B)
stop();
Symbol 2375 MovieClip Frame 2 (44 B)
_global.JUKEBOX.playSound1("sound_appear");
Symbol 2375 MovieClip Frame 131 (8 B)
stop();
Symbol 2382 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2385 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2388 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2392 MovieClip Frame 1 (374 B)
function showWizard() {
if (wizard_mc._currentframe == 1) {
wizard_mc.gotoAndPlay(2);
}
}
function hideWizard() {
wizard_mc.gotoAndStop(1);
}
stop();
howtoplay_btn.onRelease = function () {
_parent.gotoInstructions();
};
credits_btn.onRelease = function () {
_parent.gotoCredits();
};
options_btn.onRelease = function () {
_parent.gotoOptions();
};
Symbol 2423 MovieClip Frame 1 (97 B)
function rollDown() {
gotoAndPlay (2);
}
function rollUp() {
gotoAndPlay (16);
}
stop();
Symbol 2423 MovieClip Frame 15 (8 B)
stop();
Symbol 2423 MovieClip Frame 30 (8 B)
stop();
Symbol 2426 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2429 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2432 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2434 MovieClip Frame 10 (22 B)
scroll_mc.rollDown();
Symbol 2434 MovieClip Frame 25 (710 B)
function order(GAME1, GAME2) {
if (GAME1.LASTMODIFIED > GAME2.LASTMODIFIED) {
return(-1);
}
if (GAME1.LASTMODIFIED < GAME2.LASTMODIFIED) {
return(1);
}
return(0);
}
stop();
_global.GAMES = gameData.getGames();
_global.GAMES.sort(order);
if (_global.GAMES.length == 0) {
loadgame_btn._visible = false;
} else {
loadgame_btn._visible = true;
}
NEWGAME = 0;
LOADGAME = 1;
ACTION = NEWGAME;
newgame_btn.onRelease = function () {
ACTION = NEWGAME;
play();
scroll_mc.rollUp();
};
loadgame_btn.onRelease = function () {
ACTION = LOADGAME;
play();
scroll_mc.rollUp();
};
cheat_btn.onRelease = function () {
ACTION = CHEATGAME;
play();
scroll_mc.rollUp();
};
Symbol 2434 MovieClip Frame 45 (161 B)
stop();
if (ACTION == LOADGAME) {
_parent.gotoLoadGame();
} else if (ACTION == CHEATGAME) {
_parent.gotoCheatGame();
} else {
_parent.gotoNewGame();
}
Symbol 2436 MovieClip Frame 1 (8 B)
stop();
Symbol 2440 MovieClip Frame 1 (8 B)
stop();
Symbol 2444 MovieClip Frame 1 (8 B)
stop();
Symbol 2447 MovieClip Frame 1 (8 B)
stop();
Symbol 2454 MovieClip Frame 1 (2.43 KiB) ●
function menuMode() {
if (QUESTIONMARK) {
question_mc._visible = true;
arrow_mc._visible = false;
} else {
arrow_mc._visible = true;
question_mc._visible = false;
}
target_mc._visible = false;
repair_mc._visible = false;
heal_mc._visible = false;
transport_mc._visible = false;
}
function questionMarkOn() {
QUESTIONMARK = true;
}
function questionMarkOff() {
QUESTIONMARK = false;
}
function attackMode() {
if (QUESTIONMARK && (_global.GAMEPERIOD == 1)) {
question_mc._visible = true;
target_mc._visible = false;
} else {
target_mc._visible = true;
question_mc._visible = false;
}
arrow_mc._visible = false;
repair_mc._visible = false;
heal_mc._visible = false;
transport_mc._visible = false;
}
function healMode() {
if (QUESTIONMARK && (_global.GAMEPERIOD == 1)) {
question_mc._visible = true;
heal_mc._visible = false;
} else {
heal_mc._visible = true;
question_mc._visible = false;
}
arrow_mc._visible = false;
target_mc._visible = false;
repair_mc._visible = false;
transport_mc._visible = false;
}
function repairMode() {
if (QUESTIONMARK && (_global.GAMEPERIOD == 1)) {
question_mc._visible = true;
repair_mc._visible = false;
} else {
repair_mc._visible = true;
question_mc._visible = false;
}
arrow_mc._visible = false;
target_mc._visible = false;
heal_mc._visible = false;
transport_mc._visible = false;
}
function transportMode() {
if (QUESTIONMARK && (_global.GAMEPERIOD == 1)) {
question_mc._visible = true;
transport_mc._visible = false;
} else {
transport_mc._visible = true;
question_mc._visible = false;
}
arrow_mc._visible = false;
target_mc._visible = false;
repair_mc._visible = false;
heal_mc._visible = false;
}
function targetOnUnit() {
target_mc.gotoAndStop(2);
}
function targetOffUnit() {
target_mc.gotoAndStop(1);
}
function hammerOnHouse() {
repair_mc.gotoAndStop(2);
}
function hammerOffHouse() {
repair_mc.gotoAndStop(1);
}
function heartOnUnit() {
heal_mc.gotoAndStop(2);
}
function heartOffUnit() {
heal_mc.gotoAndStop(1);
}
function transportRight() {
transport_mc.gotoAndStop(1);
}
function transportLeft() {
transport_mc.gotoAndStop(2);
}
stop();
_global.CURSOR = this;
QUESTIONMARK = false;
target_mc._visible = false;
repair_mc._visible = false;
heal_mc._visible = false;
transport_mc._visible = false;
question_mc._visible = false;
Symbol 2455 MovieClip Frame 1 (97 B)
function onEnterFrame() {
Mouse.hide();
cursor_mc._x = _xmouse;
cursor_mc._y = _ymouse;
}
Symbol 2516 MovieClip Frame 1 (8 B)
stop();
Symbol 2544 MovieClip Frame 1 (8 B)
stop();
Symbol 2591 MovieClip Frame 1 (8 B)
stop();
Symbol 2595 MovieClip Frame 1 (366 B)
function hideStable() {
stable_mc._visible = false;
}
function showStable() {
stable_mc._visible = true;
}
function hidePorch() {
porch_mc._visible = false;
}
function showPorch() {
porch_mc._visible = true;
}
function roofDamage(_DAGAME) {
F = 1 + Math.round(_DAGAME / 10);
roof_mc.gotoAndStop(F);
}
stop();
roofDamage(100 - _parent.HEALTH);
Symbol 2602 MovieClip Frame 1 (8 B)
stop();
Symbol 2607 MovieClip Frame 1 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2607 MovieClip Frame 2 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2607 MovieClip Frame 3 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2611 MovieClip Frame 1 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2611 MovieClip Frame 2 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2611 MovieClip Frame 3 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2615 MovieClip Frame 1 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2615 MovieClip Frame 2 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2615 MovieClip Frame 3 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2618 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2620 MovieClip Frame 1 (1.43 KiB) ●
function setTab(_INDEX) {
_global.JUKEBOX.playSound1("click");
var _local2;
_local2 = 1;
while (_local2 < 4) {
if (_local2 == _INDEX) {
BUTTONS[_local2 - 1].gotoAndStop(3);
UIS[_local2 - 1]._visible = true;
} else {
BUTTONS[_local2 - 1].gotoAndStop(1);
UIS[_local2 - 1]._visible = false;
}
_local2++;
}
SELECTEDINDEX = _INDEX;
}
function over(_INDEX) {
if (_INDEX != SELECTEDINDEX) {
BUTTONS[_INDEX - 1].gotoAndStop(2);
}
}
function out(_INDEX) {
if (_INDEX != SELECTEDINDEX) {
BUTTONS[_INDEX - 1].gotoAndStop(1);
}
}
stop();
caption_txt.embedFonts = true;
caption_txt.setTextFormat(_global.FORMAT01);
BUTTONS = [c1_mc, c2_mc, c3_mc];
UIS = [controls_ui, spells_ui, elements_ui];
controls_ui._visible = true;
spells_ui._visible = false;
elements_ui._visible = false;
ZONES = [zone1_mc, zone2_mc, zone3_mc];
zone1_mc.onRelease = function () {
setTab(1);
};
zone2_mc.onRelease = function () {
setTab(2);
};
zone3_mc.onRelease = function () {
setTab(3);
};
zone1_mc.onRollOver = function () {
over(1);
};
zone2_mc.onRollOver = function () {
over(2);
};
zone3_mc.onRollOver = function () {
over(3);
};
zone1_mc.onRollOut = function () {
out(1);
};
zone2_mc.onRollOut = function () {
out(2);
};
zone3_mc.onRollOut = function () {
out(3);
};
SELECTEDINDEX = 1;
BUTTONS[0].gotoAndStop(3);
ok_btn.onRelease = function () {
_parent.backFromInstructions();
};
Symbol 2630 MovieClip Frame 1 (1.07 KiB) ●
stop();
text1_txt.embedFonts = true;
text1_txt.setTextFormat(_global.FORMAT01);
text2_txt.embedFonts = true;
text2_txt.setTextFormat(_global.FORMAT01);
text3_txt.embedFonts = true;
text3_txt.setTextFormat(_global.FORMAT01);
text4_txt.embedFonts = true;
text4_txt.setTextFormat(_global.FORMAT01);
if (_global.JUKEBOX.MUTE) {
on_btn.selected = false;
off_btn.selected = true;
} else {
on_btn.selected = true;
off_btn.selected = false;
}
ok_btn.onRelease = function () {
if (on_btn.selected) {
if (_global.JUKEBOX.MUTE) {
_global.JUKEBOX.soundOn();
}
} else if (!_global.JUKEBOX.MUTE) {
_global.JUKEBOX.soundOff();
}
_global.JUKEBOX.playSound1("click");
_global.uiGAME.backFromInstructions();
};
on_btn.onRelease = function () {
if (_global.JUKEBOX.MUTE) {
_global.JUKEBOX.soundOn();
}
off_btn.selected = false;
on_btn.selected = true;
_global.JUKEBOX.playSound1("click");
};
off_btn.onRelease = function () {
if (!_global.JUKEBOX.MUTE) {
_global.JUKEBOX.soundOff();
}
off_btn.selected = true;
on_btn.selected = false;
};
Instance of Symbol 97 MovieClip [RadioButton] "on_btn" in Symbol 2630 MovieClip Frame 1 (147 B)
//component parameters
onClipEvent (construct) {
data = "";
groupName = "radioGroup";
label = "";
labelPlacement = "right";
selected = true;
}
Instance of Symbol 97 MovieClip [RadioButton] "off_btn" in Symbol 2630 MovieClip Frame 1 (148 B)
//component parameters
onClipEvent (construct) {
data = "";
groupName = "radioGroup";
label = "";
labelPlacement = "right";
selected = false;
}
Symbol 2634 MovieClip Frame 1 (82 B)
stop();
text2_txt.embedFonts = true;
text2_txt.setTextFormat(_global.FORMAT01);
Symbol 2635 Button (82 B)
on (release) {
url = "http://www.qigames.com";
getURL (url, "_blank", "POST");
}
Symbol 2636 MovieClip Frame 1 (235 B)
stop();
text1_txt.embedFonts = true;
text1_txt.setTextFormat(_global.FORMAT01);
text3_txt.embedFonts = true;
text3_txt.setTextFormat(_global.FORMAT01);
ok_btn.onRelease = function () {
_global.uiGAME.backFromInstructions();
};
Symbol 2639 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2642 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2648 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2650 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2653 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2656 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2658 MovieClip Frame 10 (22 B)
scroll_mc.rollDown();
Symbol 2658 MovieClip Frame 25 (833 B)
stop();
_root.focusManager.setFocus(pilotName_txt);
pilotName_txt.embedFonts = true;
pilotName_txt.setNewTextFormat(_global.FORMAT01);
PLAYGAME = 0;
CANCEL = 1;
ACTION = PLAYGAME;
ok_btn.onRelease = function () {
PILOTNAME = pilotName_txt.text;
if (PILOTNAME == "") {
PILOTNAME = "Player 1";
}
C = _global.GAMES.length;
if (C < 5) {
_global.CGAME = new gameData(PILOTNAME, 2);
_global.TEMPGAME = new gameData(PILOTNAME, 2);
_global.GAMES.push(_global.TEMPGAME);
} else {
_global.CGAME = new gameData(PILOTNAME, 2);
_global.TEMPGAME = new gameData(PILOTNAME, 2);
_global.GAMES[4] = _global.TEMPGAME;
}
gameData.saveGames(_global.GAMES);
ACTION = PLAYGAME;
scroll_mc.rollUp();
play();
};
cancel_btn.onRelease = function () {
ACTION = CANCEL;
scroll_mc.rollUp();
play();
};
Symbol 2658 MovieClip Frame 45 (93 B)
if (ACTION == CANCEL) {
stop();
_parent.gotoMenu();
} else {
scroll_mc.rollDown();
}
Symbol 2658 MovieClip Frame 60 (433 B)
stop();
PLAYGAME = 0;
CANCEL = 1;
ACTION = PLAYGAME;
easy_btn.onRelease = function () {
_global.CGAME.DIFFICULTY = 1;
ACTION = PLAYGAME;
scroll_mc.rollUp();
play();
};
medium_btn.onRelease = function () {
_global.CGAME.DIFFICULTY = 2;
ACTION = PLAYGAME;
scroll_mc.rollUp();
play();
};
hard_btn.onRelease = function () {
_global.CGAME.DIFFICULTY = 3;
ACTION = PLAYGAME;
scroll_mc.rollUp();
play();
};
Symbol 2658 MovieClip Frame 81 (59 B)
if (ACTION == CANCEL) {
stop();
_parent.gotoMenu();
}
Symbol 2658 MovieClip Frame 101 (31 B)
stop();
_parent.gotoSelect();
Symbol 2683 MovieClip Frame 1 (97 B)
function rollDown() {
gotoAndPlay (2);
}
function rollUp() {
gotoAndPlay (16);
}
stop();
Symbol 2683 MovieClip Frame 15 (8 B)
stop();
Symbol 2683 MovieClip Frame 30 (8 B)
stop();
Symbol 2686 MovieClip Frame 10 (22 B)
scroll_mc.rollDown();
Symbol 2686 MovieClip Frame 25 (384 B)
stop();
txt1_txt.embedFonts = true;
txt1_txt.setTextFormat(_global.FORMAT01);
txt2_txt.embedFonts = true;
txt2_txt.setTextFormat(_global.FORMAT01);
PLAYGAME = 0;
CANCEL = 1;
ACTION = PLAYGAME;
ok_btn.onRelease = function () {
ACTION = PLAYGAME;
scroll_mc.rollUp();
play();
};
cancel_btn.onRelease = function () {
ACTION = CANCEL;
scroll_mc.rollUp();
play();
};
Symbol 2686 MovieClip Frame 45 (59 B)
if (ACTION == CANCEL) {
stop();
_parent.gotoMenu();
}
Symbol 2686 MovieClip Frame 65 (29 B)
stop();
_parent.gotoPlay();
Symbol 2697 MovieClip Frame 10 (22 B)
scroll_mc.rollDown();
Symbol 2697 MovieClip Frame 25 (1.62 KiB) ●
stop();
LABELS = [game1_txt, game2_txt, game3_txt, game4_txt, game5_txt];
ZONES = [zone1_btn, zone2_btn, zone3_btn, zone4_btn, zone5_btn];
SELECTED = 1;
C = _global.GAMES.length;
i = 0;
while (i < 5) {
if (i > (C - 1)) {
LABELS[i].text = "";
ZONES[i]._visible = false;
} else {
LABELS[i].text = _global.GAMES[i].PLAYERNAME;
}
LABELS[i].embedFonts = true;
LABELS[i].setTextFormat(_global.FORMAT01);
i++;
}
LOADGAME = 0;
CANCEL = 1;
ACTION = LOADGAME;
ICONY0 = 45;
ZONEY0 = 55;
zone1_btn.onRelease = function () {
if (C < 1) {
return(undefined);
}
SELECTED = 1;
icon_mc._y = ICONY0 + 0;
selection_mc._y = ZONEY0 + 0;
};
zone2_btn.onRelease = function () {
if (C < 2) {
return(undefined);
}
SELECTED = 2;
icon_mc._y = ICONY0 + 25;
selection_mc._y = ZONEY0 + 25;
};
zone3_btn.onRelease = function () {
if (C < 3) {
return(undefined);
}
SELECTED = 3;
icon_mc._y = ICONY0 + 50;
selection_mc._y = ZONEY0 + 50;
};
zone4_btn.onRelease = function () {
if (C < 4) {
return(undefined);
}
SELECTED = 4;
icon_mc._y = ICONY0 + 75;
selection_mc._y = ZONEY0 + 75;
};
zone5_btn.onRelease = function () {
if (C < 5) {
return(undefined);
}
SELECTED = 5;
icon_mc._y = ICONY0 + 100;
selection_mc._y = ZONEY0 + 100;
};
ok_btn.onRelease = function () {
_global.CGAME = new gameData(PILOTNAME, 2);
_global.TEMPGAME = _global.GAMES[SELECTED - 1];
gameData.copyGame(_global.TEMPGAME, _global.CGAME);
ACTION = LOADGAME;
scroll_mc.rollUp();
play();
};
cancel_btn.onRelease = function () {
ACTION = CANCEL;
scroll_mc.rollUp();
play();
};
Symbol 2697 MovieClip Frame 45 (103 B)
if (ACTION == CANCEL) {
stop();
_parent.gotoMenu();
} else {
stop();
_parent.gotoSelect();
}
Symbol 2697 MovieClip Frame 65 (31 B)
stop();
_parent.gotoSelect();
Symbol 2701 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2704 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2706 MovieClip Frame 1 (146 B)
play_btn.onRelease = function () {
_global.CLEVEL = 1;
_parent.gotoIntro();
};
back_btn.onRelease = function () {
_parent.gotoMenu();
};
Symbol 2711 MovieClip Frame 1 (123 B)
stop();
name_txt.text = _global.CGAME.PLAYERNAME;
name_txt.embedFonts = true;
name_txt.setTextFormat(_global.FORMAT01);
Symbol 2717 MovieClip Frame 100 (8 B)
stop();
Symbol 2718 MovieClip Frame 70 (20 B)
_parent.gotoPlay();
Symbol 2719 MovieClip Frame 1 (1.15 KiB) ●
function evt(_NFRAMES, _METHOD, _OBJ, _DATA) {
NEWEVENT = {t:TIMER + _NFRAMES, method:_METHOD, obj:_OBJ, cancel:false, evtdata:_DATA};
C = EVENTS.length;
i = 0;
while (i < C) {
if (NEWEVENT.t < EVENTS[i].t) {
EVENTS.splice(i, 0, NEWEVENT);
return(undefined);
}
i++;
}
EVENTS.push(NEWEVENT);
return(NEWEVENT);
}
function evtAtTime(_TIME, _METHOD, _OBJ) {
NEWEVENT = {t:_TIME, method:_METHOD, obj:_OBJ, cancel:false};
C = EVENTS.length;
i = 0;
while (i < C) {
if (NEWEVENT.t < EVENTS[i].t) {
EVENTS.splice(i, 0, NEWEVENT);
return(undefined);
}
i++;
}
EVENTS.push(NEWEVENT);
return(NEWEVENT);
}
function nextState() {
TIMER++;
DELETECOUNT = 0;
CALLS = [];
C = EVENTS.length;
i = 0;
while (i < C) {
if (EVENTS[i].cancel) {
DELETECOUNT++;
} else if (TIMER >= EVENTS[i].t) {
CALLS.push(EVENTS[i]);
DELETECOUNT++;
} else {
break;
}
i++;
}
EVENTS.splice(0, DELETECOUNT);
CJ = CALLS.length;
j = 0;
while (j < CJ) {
CALLS[j].method.call(CALLS[j].obj, CALLS[j].evtdata);
j++;
}
}
stop();
_global.EVTMANAGER = this;
TIMER = 0;
EVENTS = [];
Symbol 2723 MovieClip Frame 1 (275 B)
function goDay() {
gotoAndPlay (2);
}
function goNight() {
gotoAndPlay (13);
}
function lightningOn() {
lightning_mc._visible = true;
}
function lightningOff() {
lightning_mc._visible = false;
}
stop();
_global.BGTIME = this;
lightning_mc._visible = false;
Symbol 2723 MovieClip Frame 12 (8 B)
stop();
Symbol 2723 MovieClip Frame 24 (8 B)
stop();
Symbol 2727 MovieClip [house 0] Frame 1 (559 B)
#initclip 97
Object.registerClass("house 0", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 0;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2730 MovieClip [house 2] Frame 1 (559 B)
#initclip 80
Object.registerClass("house 2", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 2;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2733 MovieClip Frame 1 (482 B)
stop();
hitZone_btn.onRollOver = function () {
if ((_global.PLAYSOUND == 1) && (!_global.INTERFACE.GAMEPAUSED)) {
_global.CURSOR.questionMarkOn();
}
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.questionMarkOff();
};
hitZone_btn.onRelease = function () {
if ((_global.PLAYSOUND == 1) && (!_global.INTERFACE.GAMEPAUSED)) {
_global.CURSOR.questionMarkOff();
_global.CURSOR.menuMode();
_global.INTERFACE.showCharacterSheet();
}
};
Symbol 2736 MovieClip [house 4] Frame 1 (559 B)
#initclip 81
Object.registerClass("house 4", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 4;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2739 MovieClip [house 6] Frame 1 (559 B)
#initclip 82
Object.registerClass("house 6", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 6;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2742 MovieClip [house 8] Frame 1 (559 B)
#initclip 83
Object.registerClass("house 8", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 8;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2745 MovieClip [house 1] Frame 1 (559 B)
#initclip 84
Object.registerClass("house 1", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 1;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2748 MovieClip [house 3] Frame 1 (559 B)
#initclip 85
Object.registerClass("house 3", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 3;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2751 MovieClip [house 5] Frame 1 (559 B)
#initclip 86
Object.registerClass("house 5", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 5;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2754 MovieClip [house 7] Frame 1 (559 B)
#initclip 87
Object.registerClass("house 7", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 7;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2757 MovieClip [house 9] Frame 1 (559 B)
#initclip 88
Object.registerClass("house 9", aiHouse);
#endinitclip
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
if (INIT == undefined) {
INIT = true;
ME = this;
HOUSEIND = 9;
HEALTH = _global.CGAME.HOUSES[HOUSEIND][1];
PEOPLEIN = _global.CGAME.HOUSES[HOUSEIND][2];
if (!_global.CGAME.HOUSES[HOUSEIND][0]) {
this._visible = false;
}
HEALTHBAR = health_bar_mc;
HOUSEMC = house_mc;
PEOPLETEXT = people_txt;
init();
}
Symbol 2761 MovieClip Frame 1 (494 B)
stop();
hitZone_btn.onRollOver = function () {
if ((_global.PLAYSOUND == 1) && (!_global.INTERFACE.GAMEPAUSED)) {
_global.CURSOR.questionMarkOn();
}
};
hitZone_btn.onRollOut = function () {
_global.CURSOR.questionMarkOff();
};
hitZone_btn.onRelease = function () {
if ((_global.PLAYSOUND == 1) && (!_global.INTERFACE.GAMEPAUSED)) {
_global.CURSOR.questionMarkOff();
_global.CURSOR.menuMode();
_global.INTERFACE.showTowerSheet(_parent.TOWERIND);
}
};
Symbol 2762 MovieClip [tower 0] Frame 1 (224 B)
#initclip 89
Object.registerClass("tower 0", aiTower);
#endinitclip
stop();
if (INIT == undefined) {
INIT = true;
TOWERIND = 0;
if (!_global.CGAME.TOWERS[TOWERIND][0]) {
this._visible = false;
}
init();
}
Symbol 2763 MovieClip [tower 2] Frame 1 (224 B)
#initclip 90
Object.registerClass("tower 2", aiTower);
#endinitclip
stop();
if (INIT == undefined) {
INIT = true;
TOWERIND = 2;
if (!_global.CGAME.TOWERS[TOWERIND][0]) {
this._visible = false;
}
init();
}
Symbol 2764 MovieClip [tower 4] Frame 1 (224 B)
#initclip 91
Object.registerClass("tower 4", aiTower);
#endinitclip
stop();
if (INIT == undefined) {
INIT = true;
TOWERIND = 4;
if (!_global.CGAME.TOWERS[TOWERIND][0]) {
this._visible = false;
}
init();
}
Symbol 2765 MovieClip [tower 6] Frame 1 (224 B)
#initclip 92
Object.registerClass("tower 6", aiTower);
#endinitclip
stop();
if (INIT == undefined) {
INIT = true;
TOWERIND = 6;
if (!_global.CGAME.TOWERS[TOWERIND][0]) {
this._visible = false;
}
init();
}
Symbol 2766 MovieClip [tower 1] Frame 1 (224 B)
#initclip 93
Object.registerClass("tower 1", aiTower);
#endinitclip
stop();
if (INIT == undefined) {
INIT = true;
TOWERIND = 1;
if (!_global.CGAME.TOWERS[TOWERIND][0]) {
this._visible = false;
}
init();
}
Symbol 2767 MovieClip [tower 3] Frame 1 (224 B)
#initclip 94
Object.registerClass("tower 3", aiTower);
#endinitclip
stop();
if (INIT == undefined) {
INIT = true;
TOWERIND = 3;
if (!_global.CGAME.TOWERS[TOWERIND][0]) {
this._visible = false;
}
init();
}
Symbol 2768 MovieClip [tower 5] Frame 1 (224 B)
#initclip 95
Object.registerClass("tower 5", aiTower);
#endinitclip
stop();
if (INIT == undefined) {
INIT = true;
TOWERIND = 5;
if (!_global.CGAME.TOWERS[TOWERIND][0]) {
this._visible = false;
}
init();
}
Symbol 2769 MovieClip [tower 7] Frame 1 (224 B)
#initclip 96
Object.registerClass("tower 7", aiTower);
#endinitclip
stop();
if (INIT == undefined) {
INIT = true;
TOWERIND = 7;
if (!_global.CGAME.TOWERS[TOWERIND][0]) {
this._visible = false;
}
init();
}
Symbol 2771 MovieClip Frame 1 (8 B)
stop();
Symbol 2772 MovieClip Frame 1 (2.18 KiB) ●
function fire(_PTYPE, _X0, _Y0, _AIMX, _AIMY, _H0, _SPEEDXY, _SPEEDZ, _DAMAGE) {
P = this.attachMovie(_PTYPE, _PTYPE + "_mc", this.getNextHighestDepth());
P._x = _X0;
P._y = _Y0;
P.DAMAGE = _DAMAGE;
DX = _AIMX - _X0;
DY = _AIMY - _Y0;
DT = Math.sqrt((DX * DX) + (DY * DY));
SX = (_SPEEDXY * DX) / DT;
SY = (_SPEEDXY * DY) / DT;
P.H = _H0;
P.SX = SX;
P.SY = SY;
P.SZ = _SPEEDZ;
PROJECTILES.push(P);
}
function strikeLightning(_X0, _Y0, _DAMAGE) {
MC = this.attachMovie("lightning", "lightning_mc", this.getNextHighestDepth());
MC._x = _X0;
MC._y = _Y0;
MC.RANGE = 60;
MC.DAMAGE = _DAMAGE;
SCENEAI.testExplosion(MC);
}
function strikeEtheral(_X0, _Y0, _DAMAGE) {
MC = this.attachMovie("etheralstrike", "etheralstrike_mc", this.getNextHighestDepth());
MC._x = _X0;
MC._y = _Y0;
MC.RANGE = 200;
MC.DAMAGE = _DAMAGE;
SCENEAI.testExplosion(MC);
}
function strikeApocalypse(_X0, _Y0, _DAMAGE) {
MC = this.attachMovie("apocalypse", "apocalypse_mc", this.getNextHighestDepth());
MC._x = _X0 - 100;
MC._y = _Y0 - 400;
MC.RANGE = 200;
MC.DAMAGE = _DAMAGE;
SCENEAI.testExplosion(MC);
TWEEN1 = new mx.transitions.Tween(MC, "_x", mx.transitions.easing.None.easeNone, _X0 - 100, _X0, 15, false);
TWEEN2 = new mx.transitions.Tween(MC, "_y", mx.transitions.easing.None.easeNone, _Y0 - 400, _Y0, 15, false);
_global.EVTMANAGER.evt(15, explodeApocalypse, this, MC);
}
function explodeApocalypse(_EVT) {
explosion(_EVT.userdata);
_EVT.userdata.removeMovieClip();
}
function nextState() {
TMP = [];
C = PROJECTILES.length;
i = 0;
while (i < C) {
P = PROJECTILES[i];
P._x = P._x + P.SX;
P._y = P._y + P.SY;
P.SZ = P.SZ + G;
P.H = P.H + P.SZ;
P.setHeight(P.H);
if (P.H > 0) {
if (SCENEAI.testProjectile(P)) {
explosion(P);
} else {
TMP.push(P);
}
} else {
explosion(P);
}
i++;
}
PROJECTILES = TMP;
}
function explosion(_P) {
E = this.attachMovie("flameblast", "blast_mc", this.getNextHighestDepth());
E._x = _P._x;
E._y = _P._y;
E.RANGE = 100;
E.DAMAGE = _P.DAMAGE;
SCENEAI.testExplosion(E);
P.removeMovieClip();
}
stop();
_global.FIREMANAGER = this;
PROJECTILES = [];
G = -2;
Symbol 2773 MovieClip Frame 1 (170 B)
function goDark() {
gotoAndPlay (2);
}
function goBright() {
gotoAndPlay (16);
}
function blueFlash() {
gotoAndPlay (40);
}
stop();
_global.SKYLIGHT = this;
Symbol 2773 MovieClip Frame 15 (8 B)
stop();
Symbol 2773 MovieClip Frame 30 (8 B)
stop();
Symbol 2773 MovieClip Frame 45 (18 B)
gotoAndStop (15);
Symbol 2780 MovieClip Frame 1 (8 B)
stop();
Symbol 2780 MovieClip Frame 100 (8 B)
stop();
Symbol 2781 MovieClip Frame 1 (8 B)
stop();
Symbol 2781 MovieClip Frame 100 (8 B)
stop();
Symbol 2782 MovieClip Frame 1 (818 B)
function nextState() {
_global.HERO.MANAPCT = _global.HERO.MANAPCT + _global.HERO.MANAINC;
if (_global.HERO.MANAPCT > 100) {
_global.HERO.MANAPCT = 100;
}
will_mc.gotoAndStop(101 - Math.round(_global.HERO.MANAPCT));
_global.HERO.HEALTHPCT = _global.HERO.HEALTHPCT + _global.HERO.HEALTHINC;
if (_global.HERO.HEALTHPCT > 100) {
_global.HERO.HEALTHPCT = 100;
}
health_mc.gotoAndStop(101 - Math.round(_global.HERO.HEALTHPCT));
if (((_global.HERO.HEALTHPCT < 50) && (_global.HERO.HEALTHPCT > 0)) && (!STARTFLASH)) {
STARTFLASH = true;
gotoAndPlay (5);
}
}
stop();
_global.STATUS = this;
label1_txt.embedFonts = true;
label1_txt.setTextFormat(_global.FORMAT01);
label2_txt.embedFonts = true;
label2_txt.setTextFormat(_global.FORMAT01);
STARTFLASH = false;
Symbol 2782 MovieClip Frame 2 (20 B)
STARTFLASH = false;
Symbol 2782 MovieClip Frame 22 (17 B)
gotoAndStop (2);
Symbol 2788 MovieClip Frame 1 (235 B)
function levelUp() {
gotoAndStop (3);
}
function normal() {
gotoAndStop (2);
}
stop();
_global.HEAD = this;
name_txt.embedFonts = true;
name_txt.setNewTextFormat(_global.FORMAT01);
name_txt.text = _global.CGAME.PLAYERNAME;
Symbol 2795 MovieClip Frame 1 (8 B)
stop();
Symbol 2798 MovieClip Frame 1 (1.19 KiB) ●
function refreshHealing() {
qty_txt.text = "x " + String(_global.CGAME.HEALPOTIONS);
if (_global.CGAME.HEALPOTIONS == 0) {
zone_mc._visible = false;
heal_mc.gotoAndStop(3);
} else {
zone_mc._visible = true;
heal_mc.gotoAndStop(1);
}
}
function addHealToHero() {
if (_global.CGAME.HEALPOTIONS == 0) {
return(undefined);
}
if (_global.HERO.HEALTHPCT >= 100) {
return(undefined);
}
_global.CGAME.HEALPOTIONS--;
_global.JUKEBOX.playSound1("sound_heal");
_global.HERO.addHealthPct(100);
refreshHealing();
}
function onKeyDown() {
if (_global.INTERFACE.GAMEPAUSED) {
return(undefined);
}
KEY = Key.getCode();
if (KEY == 81) {
addHealToHero();
}
}
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
qty_txt.embedFonts = true;
qty_txt.setTextFormat(_global.FORMAT01);
Key.addListener(this);
refreshHealing();
zone_mc.onRollOver = function () {
if (_global.CGAME.HEALPOTIONS > 0) {
heal_mc.gotoAndStop(2);
}
};
zone_mc.onRollOut = function () {
if (_global.CGAME.HEALPOTIONS == 0) {
heal_mc.gotoAndStop(3);
} else {
heal_mc.gotoAndStop(1);
}
};
zone_mc.onRelease = function () {
addHealToHero();
};
Symbol 2803 MovieClip Frame 1 (8 B)
stop();
Symbol 2804 MovieClip Frame 1 (1.18 KiB) ●
function refreshMana() {
qty_txt.text = "x " + String(_global.CGAME.MANAPOTIONS);
if (_global.CGAME.MANAPOTIONS == 0) {
zone_mc._visible = false;
mana_mc.gotoAndStop(3);
} else {
zone_mc._visible = true;
mana_mc.gotoAndStop(1);
}
}
function addManaToHero() {
if (_global.CGAME.MANAPOTIONS == 0) {
return(undefined);
}
if (_global.HERO.MANAPCT >= 100) {
return(undefined);
}
_global.CGAME.MANAPOTIONS--;
_global.JUKEBOX.playSound1("sound_heal");
_global.HERO.addManaPct(100);
refreshMana();
}
function onKeyDown() {
if (_global.INTERFACE.GAMEPAUSED) {
return(undefined);
}
KEY = Key.getCode();
if (KEY == 69) {
addManaToHero();
}
}
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
qty_txt.embedFonts = true;
qty_txt.setTextFormat(_global.FORMAT01);
Key.addListener(this);
refreshMana();
zone_mc.onRollOver = function () {
if (_global.CGAME.MANAPOTIONS > 0) {
mana_mc.gotoAndStop(2);
}
};
zone_mc.onRollOut = function () {
if (_global.CGAME.MANAPOTIONS == 0) {
mana_mc.gotoAndStop(3);
} else {
mana_mc.gotoAndStop(1);
}
};
zone_mc.onRelease = function () {
addManaToHero();
};
Symbol 2806 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2810 MovieClip Frame 1 (8 B)
stop();
Symbol 2811 MovieClip Frame 1 (8 B)
stop();
Symbol 2812 MovieClip Frame 1 (8 B)
stop();
Symbol 2813 MovieClip Frame 1 (8 B)
stop();
Symbol 2814 MovieClip Frame 1 (8 B)
stop();
Symbol 2815 MovieClip Frame 1 (8 B)
stop();
Symbol 2816 MovieClip Frame 1 (8 B)
stop();
Symbol 2817 MovieClip Frame 1 (8 B)
stop();
Symbol 2818 MovieClip Frame 1 (8 B)
stop();
Symbol 2827 MovieClip Frame 1 (488 B)
function setRechargePct(_PCT) {
if (_PCT >= 100) {
gotoAndStop (40);
} else if (_PCT >= 87.5) {
gotoAndStop (35);
} else if (_PCT >= 75) {
gotoAndStop (30);
} else if (_PCT >= 62.5) {
gotoAndStop (25);
} else if (_PCT >= 50) {
gotoAndStop (20);
} else if (_PCT >= 37.5) {
gotoAndStop (15);
} else if (_PCT >= 25) {
gotoAndStop (10);
} else if (_PCT >= 12.5) {
gotoAndStop (5);
} else {
gotoAndStop (2);
}
}
stop();
Symbol 2827 MovieClip Frame 40 (17 B)
gotoAndStop (1);
Symbol 2837 MovieClip Frame 1 (5.48 KiB) ● ●
function refreshSpells() {
i = 0;
while (i < _global.CGAME.SPELLS.length) {
if (!_global.CGAME.SPELLS[i][2]) {
ZONES[i]._visible = false;
BUTTONS[i].BTNDISABLED = true;
BUTTONS[i].gotoAndStop(4);
} else {
BUTTONS[i].BTNDISABLED = false;
ZONES[i]._visible = true;
if (SELECTEDIND == (i + 1)) {
BUTTONS[i].gotoAndStop(3);
} else {
BUTTONS[i].gotoAndStop(1);
}
}
i++;
}
}
function setSpell(_INDEX) {
_global.JUKEBOX.playSound1("click");
if (BUTTONS[_INDEX - 1].BTNDISABLED) {
return(undefined);
}
if (_global.HERO.ONTRANSPORT && (_INDEX != 9)) {
_global.HERO.endTransport();
}
SELECTEDIND = _INDEX;
_global.SPELLMANAGER.setSpell(_INDEX - 1);
if (SELECTEDIND == 9) {
_global.INTERFACE.setMessage("Click to disappear.");
} else {
_global.INTERFACE.hideMessage();
}
var _local2;
_local2 = 1;
while (_local2 < 10) {
if (_local2 == _INDEX) {
BUTTONS[_local2 - 1].gotoAndStop(3);
} else if (!BUTTONS[_local2 - 1].BTNDISABLED) {
BUTTONS[_local2 - 1].gotoAndStop(1);
} else {
BUTTONS[_local2 - 1].gotoAndStop(4);
}
_local2++;
}
}
function over(_INDEX) {
if (SELECTEDIND != _INDEX) {
if (!BUTTONS[_INDEX - 1].BTNDISABLED) {
BUTTONS[_INDEX - 1].gotoAndStop(2);
}
}
}
function out(_INDEX) {
if (SELECTEDIND != _INDEX) {
if (!BUTTONS[_INDEX - 1].BTNDISABLED) {
BUTTONS[_INDEX - 1].gotoAndStop(1);
}
}
}
function onMouseWheel(_DELTA) {
DELTA = DELTA + _DELTA;
if (DELTA >= 3) {
MOUSEWHEELIND = getNextAvailable();
setSpell(MOUSEWHEELIND);
DELTA = 0;
} else if (DELTA <= -3) {
MOUSEWHEELIND = getPrevAvailable();
setSpell(MOUSEWHEELIND);
DELTA = 0;
}
}
function onKeyDown() {
if (_global.INTERFACE.GAMEPAUSED) {
return(undefined);
}
KEY = Key.getCode();
if (KEY == 49) {
setSpell(1);
}
if (KEY == 50) {
setSpell(2);
}
if (KEY == 51) {
setSpell(3);
}
if (KEY == 52) {
setSpell(4);
}
if (KEY == 53) {
setSpell(5);
}
if (KEY == 54) {
setSpell(6);
}
if (KEY == 55) {
setSpell(7);
}
if (KEY == 56) {
setSpell(8);
}
if (KEY == 57) {
setSpell(9);
}
}
function getNextAvailable() {
var _local1 = SELECTEDIND + 1;
while (_local1 <= BUTTONS.length) {
if (!BUTTONS[_local1 - 1].BTNDISABLED) {
return(_local1);
}
_local1++;
}
_local1 = 1;
while (_local1 < SELECTEDIND) {
if (!BUTTONS[_local1 - 1].BTNDISABLED) {
return(_local1);
}
_local1++;
}
}
function getPrevAvailable() {
var _local1 = SELECTEDIND - 1;
while (_local1 >= 1) {
if (!BUTTONS[_local1 - 1].BTNDISABLED) {
return(_local1);
}
_local1--;
}
_local1 = BUTTONS.length;
while (_local1 > SELECTEDIND) {
if (!BUTTONS[_local1 - 1].BTNDISABLED) {
return(_local1);
}
_local1--;
}
}
function rechargePct(_SELECTEDIND, _PCT) {
RECHARGEMCS[_SELECTEDIND].setRechargePct(_PCT);
}
stop();
_global.SPELLSELECTION = this;
Mouse.addListener(this);
Key.addListener(this);
control1_txt.embedFonts = true;
control1_txt.setTextFormat(_global.FORMAT01);
control2_txt.embedFonts = true;
control2_txt.setTextFormat(_global.FORMAT01);
control3_txt.embedFonts = true;
control3_txt.setTextFormat(_global.FORMAT01);
control4_txt.embedFonts = true;
control4_txt.setTextFormat(_global.FORMAT01);
control5_txt.embedFonts = true;
control5_txt.setTextFormat(_global.FORMAT01);
control6_txt.embedFonts = true;
control6_txt.setTextFormat(_global.FORMAT01);
control7_txt.embedFonts = true;
control7_txt.setTextFormat(_global.FORMAT01);
control8_txt.embedFonts = true;
control8_txt.setTextFormat(_global.FORMAT01);
control9_txt.embedFonts = true;
control9_txt.setTextFormat(_global.FORMAT01);
RECHARGEMCS = [rc1_mc, rc2_mc, rc3_mc, rc4_mc, rc5_mc, rc6_mc, rc7_mc, rc8_mc, rc9_mc];
BUTTONS = [m1_mc, m2_mc, m3_mc, m4_mc, m5_mc, m6_mc, m7_mc, m8_mc, m9_mc];
ZONES = [zone1_btn, zone2_btn, zone3_btn, zone4_btn, zone5_btn, zone6_btn, zone7_btn, zone8_btn, zone9_btn];
zone1_btn.onRelease = function () {
setSpell(1);
};
zone2_btn.onRelease = function () {
setSpell(2);
};
zone3_btn.onRelease = function () {
setSpell(3);
};
zone4_btn.onRelease = function () {
setSpell(4);
};
zone5_btn.onRelease = function () {
setSpell(5);
};
zone6_btn.onRelease = function () {
setSpell(6);
};
zone7_btn.onRelease = function () {
setSpell(7);
};
zone8_btn.onRelease = function () {
setSpell(8);
};
zone9_btn.onRelease = function () {
setSpell(9);
};
zone1_btn.onRollOver = function () {
over(1);
};
zone2_btn.onRollOver = function () {
over(2);
};
zone3_btn.onRollOver = function () {
over(3);
};
zone4_btn.onRollOver = function () {
over(4);
};
zone5_btn.onRollOver = function () {
over(5);
};
zone6_btn.onRollOver = function () {
over(6);
};
zone7_btn.onRollOver = function () {
over(7);
};
zone8_btn.onRollOver = function () {
over(8);
};
zone9_btn.onRollOver = function () {
over(9);
};
zone1_btn.onRollOut = function () {
out(1);
};
zone2_btn.onRollOut = function () {
out(2);
};
zone3_btn.onRollOut = function () {
out(3);
};
zone4_btn.onRollOut = function () {
out(4);
};
zone5_btn.onRollOut = function () {
out(5);
};
zone6_btn.onRollOut = function () {
out(6);
};
zone7_btn.onRollOut = function () {
out(7);
};
zone8_btn.onRollOut = function () {
out(8);
};
zone9_btn.onRollOut = function () {
out(9);
};
SELECTEDIND = 1;
MOUSEWHEELIND = SELECTEDIND;
BUTTONS[0].gotoAndStop(3);
DELTA = 0;
refreshSpells();
Symbol 2840 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2851 MovieClip Frame 1 (8 B)
stop();
Symbol 2856 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2859 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2862 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2864 MovieClip Frame 1 (421 B)
stop();
msg_txt.embedFonts = true;
msg_txt.setTextFormat(_global.FORMAT01);
no_btn.onRelease = function () {
_global.INTERFACE.GAMEPAUSED = false;
_parent.hideConfirm();
};
yes_btn.onRelease = function () {
_global.INTERFACE.GAMEPAUSED = false;
_parent.goNight();
};
confirmNot_btn.onRelease = function () {
_global.INTERFACE.GAMEPAUSED = false;
_global.CANCELCONFIRM1 = true;
_parent.goNight();
};
Symbol 2865 MovieClip Frame 1 (1.9 KiB) ●
function nextState() {
if (_global.GAMEPERIOD == 2) {
COUNTFRAMES++;
if (COUNTFRAMES >= 24) {
COUNTFRAMES = 0;
DTIMESEC--;
tempPct = Math.round(((DTIMESEC * 24) / _global.CGAME.NIGHTFRAMES) * 100);
tempMin = Math.floor(DTIMESEC / 60);
tempSec = DTIMESEC % 60;
tempString = "";
if (tempSec < 10) {
tempString = "0";
}
TIMELEFT_txt.text = ((tempMin + ":") + tempString) + tempSec;
goFrame = 101 - tempPct;
if (goFrame == 101) {
goFrame = 100;
}
hourglass_mc.gotoAndStop(goFrame);
if (DTIMESEC <= 0) {
_global.GAMEPERIOD = 1;
}
}
}
}
function goDay() {
_global.GAMEPERIOD = 1;
hourglass_mc._visible = false;
TIMELEFT_txt._visible = false;
restNight_btn._visible = true;
_global.INTERFACE.hideRadar();
_global.PLAYSOUND = 1;
}
function goNight() {
restNight_btn._visible = false;
confirm_mc._visible = false;
_global.BGTIME.goNight();
_global.SCENEMANAGER.STARTNIGHTPOP = _global.CGAME.POPNB;
_global.GAMEPERIOD = 2;
_global.SCENEMANAGER.initNight();
DTIMESEC = _global.CGAME.NIGHTFRAMES / 24;
COUNTFRAMES = 0;
_global.PLAYSOUND = 2;
hourglass_mc._visible = true;
TIMELEFT_txt._visible = true;
tempMin = Math.floor(DTIMESEC / 60);
tempSec = DTIMESEC % 60;
tempString = "";
if (tempSec < 10) {
tempString = "0";
}
TIMELEFT_txt.text = ((tempMin + ":") + tempString) + tempSec;
hourglass_mc.gotoAndStop(1);
_global.INTERFACE.showRadar();
}
function hideConfirm() {
confirm_mc._visible = false;
}
stop();
_global.GAMETIME = this;
TIMELEFT_txt.embedFonts = true;
TIMELEFT_txt.setTextFormat(_global.FORMAT01);
confirm_mc._visible = false;
if (_global.GAMEPERIOD == 1) {
goDay();
} else {
goNight();
}
restNight_btn.onRelease = function () {
if (_global.CANCELCONFIRM1) {
goNight();
} else {
_global.INTERFACE.GAMEPAUSED = true;
confirm_mc._visible = true;
}
};
Symbol 2871 MovieClip Frame 1 (255 B)
function underAttack() {
if (TEMPCOUNT == 0) {
TEMPCOUNT = 4;
gotoAndPlay (5);
} else {
TEMPCOUNT = TEMPCOUNT + 4;
}
}
function unprotected() {
gotoAndStop (25);
}
function protected() {
gotoAndStop (1);
}
stop();
TEMPCOUNT = 0;
Symbol 2871 MovieClip Frame 15 (90 B)
TEMPCOUNT--;
if (TEMPCOUNT <= 0) {
gotoAndStop (1);
} else {
gotoAndPlay (5);
}
Symbol 2876 MovieClip Frame 1 (2.04 KiB) ●
function refreshHouses() {
i = 0;
while (i < 10) {
if (!_global.CGAME.HOUSES[i][0]) {
HOUSES[i]._visible = false;
} else {
HOUSES[i]._visible = true;
}
i++;
}
}
function nextState() {
tempX = Math.round((395 * _global.SCENEMANAGER.HERO._x) / 4600);
if (hero_mc._x < tempX) {
hero_mc.gotoAndStop(2);
} else if (hero_mc._x > tempX) {
hero_mc.gotoAndStop(1);
}
hero_mc._x = tempX;
var _local2 = 0;
while (_local2 < UNITS.length) {
tempX = Math.round((395 * UNITS[_local2][1]._x) / 4600);
if (UNITS[_local2][0]._x < tempX) {
UNITS[_local2][0].gotoAndStop(2);
} else if (UNITS[_local2][0]._x > tempX) {
UNITS[_local2][0].gotoAndStop(1);
}
UNITS[_local2][0]._x = tempX;
if ((UNITS[_local2][0]._x > 395) || (UNITS[_local2][0]._x < 0)) {
UNITS[_local2][0]._visible = false;
} else {
UNITS[_local2][0]._visible = true;
}
_local2++;
}
}
function underAttack(_HOUSEIND) {
HOUSES[_HOUSEIND].underAttack();
}
function unprotected(_HOUSEIND) {
HOUSES[_HOUSEIND].unprotected();
}
function protected(_HOUSEIND) {
HOUSES[_HOUSEIND].protected();
}
function addUnit(_UNIT) {
var _local2;
var _local4;
SPAWNCOUNT++;
_local4 = Math.round((395 * _UNIT._x) / 4600);
_local2 = this.attachMovie(_UNIT.INDICATORTYPE, (_UNIT.INDICATORTYPE + SPAWNCOUNT) + "_mc", this.getNextHighestDepth());
_local2._x = _local4;
if (_UNIT.INDICATORTYPE != "wyvernIndicator") {
_local2._y = 34;
} else {
_local2._y = 10;
}
if ((_local2._x > 395) || (_local2._x < 0)) {
_local2._visible = false;
}
UNITS.push([_local2, _UNIT]);
}
function removeUnit(_UNIT) {
var _local1 = 0;
while (_local1 < UNITS.length) {
if (UNITS[_local1][1] == _UNIT) {
UNITS[_local1][0].removeMovieClip();
UNITS.splice(_local1, 1);
break;
}
_local1++;
}
}
stop();
_global.RADAR = this;
HOUSES = [house0_mc, house1_mc, house2_mc, house3_mc, house4_mc, house5_mc, house6_mc, house7_mc, house8_mc, house9_mc];
UNITS = [];
SPAWNCOUNT = 0;
refreshHouses();
Symbol 2879 MovieClip [coin] Frame 1 (43 B)
stop();
GROUNDZ = 15;
DX = 15;
DY = 15;
Symbol 2881 MovieClip Frame 1 (207 B)
function refreshMoney() {
money_txt.text = String(_global.CGAME.MONEY);
}
stop();
money_txt.embedFonts = true;
money_txt.setTextFormat(_global.FORMAT01);
money_txt.text = String(_global.CGAME.MONEY);
Symbol 2887 MovieClip Frame 1 (276 B)
function refreshPeople() {
qty_txt.text = String(_global.CGAME.POPNB);
}
stop();
people_txt.embedFonts = true;
people_txt.setTextFormat(_global.FORMAT01);
qty_txt.embedFonts = true;
qty_txt.setTextFormat(_global.FORMAT01);
qty_txt.text = String(_global.CGAME.POPNB);
Symbol 2897 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2911 MovieClip Frame 1 (1.46 KiB) ●
function setMsgs(_POPBEF, _POPNOW, _MONEYEARNED, _POPBORN, _POPKILLED, _TOWERCONSTRUCTED) {
if (_POPBEF < _POPNOW) {
caption_txt.text = "Great Job! Your population increased!";
} else if (_POPBEF == _POPNOW) {
caption_txt.text = "Good work. Your population did not change.";
} else {
caption_txt.text = "Be careful. Your population decreased!";
}
msg1_txt.text = "+" + String(_POPBORN);
msg2_txt.text = String(_POPNOW);
msg5_txt.text = "+" + String(_POPBEF);
msg4_txt.text = "-" + String(_POPKILLED);
msg3_txt.text = String(_MONEYEARNED) + "$";
msg6_txt.text = String(60 - _POPNOW);
caption_txt._visible = false;
msg1_txt._visible = false;
msg2_txt._visible = false;
msg5_txt._visible = false;
msg4_txt._visible = false;
msg3_txt._visible = false;
msg6_txt._visible = false;
TOWERCONSTRUCTED = _TOWERCONSTRUCTED;
gotoAndStop (2);
}
stop();
caption_txt.embedFonts = true;
caption_txt.setTextFormat(_global.FORMAT01);
msg1_txt.embedFonts = true;
msg1_txt.setTextFormat(_global.FORMAT01);
msg2_txt.embedFonts = true;
msg2_txt.setTextFormat(_global.FORMAT01);
msg3_txt.embedFonts = true;
msg3_txt.setTextFormat(_global.FORMAT01);
msg4_txt.embedFonts = true;
msg4_txt.setTextFormat(_global.FORMAT01);
msg5_txt.embedFonts = true;
msg5_txt.setTextFormat(_global.FORMAT01);
msg6_txt.embedFonts = true;
msg6_txt.setTextFormat(_global.FORMAT01);
nightOver_btn._visible = true;
nightOver_btn.onRelease = function () {
gotoAndStop (5);
};
Symbol 2911 MovieClip Frame 2 (31 B)
nightOver_btn._visible = true;
Symbol 2911 MovieClip Frame 5 (906 B)
stop();
label1_txt.embedFonts = true;
label1_txt.setTextFormat(_global.FORMAT01);
label2_txt.embedFonts = true;
label2_txt.setTextFormat(_global.FORMAT01);
label3_txt.embedFonts = true;
label3_txt.setTextFormat(_global.FORMAT01);
label4_txt.embedFonts = true;
label4_txt.setTextFormat(_global.FORMAT01);
label5_txt.embedFonts = true;
label5_txt.setTextFormat(_global.FORMAT01);
label6_txt.embedFonts = true;
label6_txt.setTextFormat(_global.FORMAT01);
label7_txt.embedFonts = true;
label7_txt.setTextFormat(_global.FORMAT01);
caption_txt._visible = true;
msg1_txt._visible = true;
msg2_txt._visible = true;
msg5_txt._visible = true;
msg4_txt._visible = true;
msg3_txt._visible = true;
msg6_txt._visible = true;
nightOver_btn._visible = false;
go_btn.onRelease = function () {
if (TOWERCONSTRUCTED) {
gotoAndStop (10);
} else {
_global.INTERFACE.hideNightOverMsg();
}
};
Symbol 2911 MovieClip Frame 10 (546 B)
stop();
label1_txt.embedFonts = true;
label1_txt.setTextFormat(_global.FORMAT01);
label2_txt.embedFonts = true;
label2_txt.setTextFormat(_global.FORMAT01);
label3_txt.embedFonts = true;
label3_txt.setTextFormat(_global.FORMAT01);
nightOver_btn._visible = false;
caption_txt._visible = false;
msg1_txt._visible = false;
msg2_txt._visible = false;
msg5_txt._visible = false;
msg4_txt._visible = false;
msg3_txt._visible = false;
msg6_txt._visible = false;
go_btn.onRelease = function () {
_global.INTERFACE.hideNightOverMsg();
};
Symbol 2915 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2918 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2920 MovieClip Frame 1 (578 B)
function setType(_TYPE) {
if (_TYPE == 1) {
msg1txt.text = "All off your people have been killed!";
} else {
msg1txt.text = "You can not protect the city if you are dead! Be more careful next time!";
}
}
stop();
caption_txt.embedFonts = true;
caption_txt.setTextFormat(_global.FORMAT01);
msg1txt.embedFonts = true;
msg1txt.setTextFormat(_global.FORMAT01);
tryAgain_btn.onRelease = function () {
gameData.copyGame(_global.TEMPGAME, _global.CGAME);
_global.GAMEPLAY.tryAgain();
};
backToMenu_btn.onRelease = function () {
_global.uiGAME.gotoMenu();
};
Symbol 2921 MovieClip Frame 1 (8 B)
stop();
Symbol 2923 MovieClip Frame 1 (133 B)
function setMessage(_MSG) {
msg1txt.text = _MSG;
}
stop();
msg1txt.embedFonts = true;
msg1txt.setTextFormat(_global.FORMAT01);
Symbol 2925 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2927 MovieClip Frame 1 (651 B)
function setScore(_HEALTH, _ACCURACY) {
BONUS = 20000 + (_global.CGAME.CLEVEL * 5000);
_global.CGAME.CLEVEL++;
HBONUS = (_HEALTH * 0.01) * BONUS;
ABONUS = (_ACCURACY * 0.01) * BONUS;
h_txt.text = _HEALTH + "%";
a_txt.text = _ACCURACY + "%";
health_txt.text = numbers.format(HBONUS);
accuracy_txt.text = numbers.format(ABONUS);
_global.CGAME.POINTS = _global.CGAME.POINTS + HBONUS;
_global.CGAME.POINTS = _global.CGAME.POINTS + ABONUS;
total_txt.text = numbers.format(_global.CGAME.POINTS);
gameData.saveGames(_global.GAMES);
}
stop();
ok_btn.onRelease = function () {
_global.uiGAME.gotoSelect();
_visible = false;
};
Symbol 2934 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2940 MovieClip Frame 1 (519 B)
function refreshHeal() {
bar_mc.gotoAndStop(101 - Math.round(_global.HERO.HEALTHPCT));
qty_txt.text = (String(Math.round((_global.HERO.HFACTOR * _global.HERO.HEALTHPCT) / 100)) + "/") + String(_global.HERO.HFACTOR);
potions_txt.text = "x " + String(_global.CGAME.HEALPOTIONS);
}
stop();
health_txt.embedFonts = true;
health_txt.setTextFormat(_global.FORMAT01);
qty_txt.embedFonts = true;
qty_txt.setTextFormat(_global.FORMAT01);
potions_txt.embedFonts = true;
potions_txt.setTextFormat(_global.FORMAT01);
Symbol 2943 MovieClip Frame 1 (8 B)
stop();
Symbol 2947 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2951 MovieClip Frame 1 (781 B)
function reset() {
if (LEVEL > 0) {
dot1_mc.gotoAndStop(2);
}
if (LEVEL > 1) {
dot2_mc.gotoAndStop(2);
}
if (LEVEL > 2) {
dot3_mc.gotoAndStop(2);
}
if (LEVEL > 3) {
dot4_mc.gotoAndStop(2);
}
if (LEVEL > 4) {
dot5_mc.gotoAndStop(2);
}
if (LEVEL == 5) {
cost_txt._visible = false;
buy_btn._visible = false;
coin_mc._visible = false;
return(undefined);
}
NEXTCOST = COSTS[LEVEL];
cost_txt.text = NEXTCOST;
if (NEXTCOST > AVAILABLE) {
buy_btn._visible = false;
gotoAndStop (2);
} else {
buy_btn._visible = true;
gotoAndStop (1);
}
}
cost_txt.embedFonts = true;
cost_txt.setNewTextFormat(_global.FORMAT01);
reset();
buy_btn.onRelease = function () {
_parent.buyItem(INDEX, NEXTCOST);
};
Symbol 2951 MovieClip Frame 2 (110 B)
stop();
cost_txt.embedFonts = true;
cost_txt.setNewTextFormat(_global.FORMAT01);
cost_txt.text = NEXTCOST;
Symbol 2960 MovieClip Frame 1 (3.11 KiB) ●
function refreshAttributes() {
att1_mc.LEVEL = _global.CGAME.CONSTLEVEL;
att1_mc.reset();
att2_mc.LEVEL = _global.CGAME.STRENGLEVEL;
att2_mc.reset();
att3_mc.LEVEL = _global.CGAME.WISDOMLEVEL;
att3_mc.reset();
att4_mc.LEVEL = _global.CGAME.CONCENLEVEL;
att4_mc.reset();
}
function buyItem(_INDEX, _COST) {
if (_global.CGAME.MONEY < _COST) {
_parent.notEnoughMoney();
} else {
_global.CGAME.MONEY = _global.CGAME.MONEY - _COST;
_parent.refreshMoney();
switch (_INDEX) {
case 1 :
_global.CGAME.CONSTLEVEL++;
att1_mc.LEVEL = _global.CGAME.CONSTLEVEL;
att1_mc.reset();
tempLevel = _global.CGAME.CONSTLEVEL;
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.HFACTOR = _global.CGAME.CONSTLIST[tempLevel][1];
_global.HERO.HFACTOR = _global.CGAME.HFACTOR;
break;
case 2 :
_global.CGAME.STRENGLEVEL++;
att2_mc.LEVEL = _global.CGAME.STRENGLEVEL;
att2_mc.reset();
tempLevel = _global.CGAME.STRENGLEVEL;
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.HEALTHINC = _global.CGAME.STRENGLIST[tempLevel][1];
_global.HERO.HEALTHINC = _global.CGAME.HEALTHINC;
break;
case 3 :
_global.CGAME.WISDOMLEVEL++;
att3_mc.LEVEL = _global.CGAME.WISDOMLEVEL;
att3_mc.reset();
tempLevel = _global.CGAME.WISDOMLEVEL;
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.MFACTOR = _global.CGAME.WISDOMLIST[tempLevel][1];
_global.HERO.MFACTOR = _global.CGAME.MFACTOR;
break;
case 4 :
_global.CGAME.CONCENLEVEL++;
att4_mc.LEVEL = _global.CGAME.CONCENLEVEL;
att4_mc.reset();
tempLevel = _global.CGAME.CONCENLEVEL;
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.MANAINC = _global.CGAME.CONCENLIST[tempLevel][1];
_global.HERO.MANAINC = _global.CGAME.MANAINC;
}
_parent.refreshUi();
}
}
stop();
att1_txt.embedFonts = true;
att1_txt.setTextFormat(_global.FORMAT01);
att2_txt.embedFonts = true;
att2_txt.setTextFormat(_global.FORMAT01);
att3_txt.embedFonts = true;
att3_txt.setTextFormat(_global.FORMAT01);
att4_txt.embedFonts = true;
att4_txt.setTextFormat(_global.FORMAT01);
desc1_txt.embedFonts = true;
desc1_txt.setTextFormat(_global.FORMAT01);
desc2_txt.embedFonts = true;
desc2_txt.setTextFormat(_global.FORMAT01);
desc3_txt.embedFonts = true;
desc3_txt.setTextFormat(_global.FORMAT01);
desc4_txt.embedFonts = true;
desc4_txt.setTextFormat(_global.FORMAT01);
att1_mc.INDEX = 1;
att1_mc.COSTS = [];
var i = 0;
while (i < _global.CGAME.CONSTLIST.length) {
att1_mc.COSTS.push(_global.CGAME.CONSTLIST[i][0]);
i++;
}
att2_mc.INDEX = 2;
att2_mc.COSTS = [];
var i = 0;
while (i < _global.CGAME.STRENGLIST.length) {
att2_mc.COSTS.push(_global.CGAME.STRENGLIST[i][0]);
i++;
}
att3_mc.INDEX = 3;
att3_mc.COSTS = [];
var i = 0;
while (i < _global.CGAME.WISDOMLIST.length) {
att3_mc.COSTS.push(_global.CGAME.WISDOMLIST[i][0]);
i++;
}
att4_mc.INDEX = 4;
att4_mc.COSTS = [];
var i = 0;
while (i < _global.CGAME.CONCENLIST.length) {
att4_mc.COSTS.push(_global.CGAME.CONCENLIST[i][0]);
i++;
}
Symbol 2964 MovieClip Frame 1 (511 B)
function refreshMana() {
bar_mc.gotoAndStop(101 - Math.round(_global.HERO.MANAPCT));
qty_txt.text = (String(Math.round((_global.HERO.MFACTOR * _global.HERO.MANAPCT) / 100)) + "/") + String(_global.HERO.MFACTOR);
potions_txt.text = "x " + String(_global.CGAME.MANAPOTIONS);
}
stop();
will_txt.embedFonts = true;
will_txt.setTextFormat(_global.FORMAT01);
qty_txt.embedFonts = true;
qty_txt.setTextFormat(_global.FORMAT01);
potions_txt.embedFonts = true;
potions_txt.setTextFormat(_global.FORMAT01);
Symbol 2969 MovieClip Frame 1 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2969 MovieClip Frame 2 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2969 MovieClip Frame 3 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2973 MovieClip Frame 1 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2973 MovieClip Frame 2 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2973 MovieClip Frame 3 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2977 MovieClip Frame 1 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2977 MovieClip Frame 2 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2977 MovieClip Frame 3 (82 B)
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 2990 MovieClip Frame 1 (9.08 KiB) ● ●
function refreshAttributes() {
att1_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[0] + 1;
att1_mc.reset();
att2_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[1] + 1;
att2_mc.reset();
att3_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[2] + 1;
att3_mc.reset();
att4_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[3] + 1;
att4_mc.reset();
att5_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[4] + 1;
att5_mc.reset();
att6_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[5] + 1;
att6_mc.reset();
att7_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[6] + 1;
att7_mc.reset();
att8_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[7] + 1;
att8_mc.reset();
att9_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[8] + 1;
att9_mc.reset();
}
function buyItem(_INDEX, _COST) {
if (_global.CGAME.MONEY < _COST) {
_parent.notEnoughMoney();
} else {
_global.CGAME.MONEY = _global.CGAME.MONEY - _COST;
_parent.refreshMoney();
switch (_INDEX) {
case 1 :
_global.CGAME.SPELLSCURLEVELS[0]++;
att1_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[0] + 1;
att1_mc.reset();
tempLevel = _global.CGAME.SPELLSCURLEVELS[0];
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.SPELLS[0][2] = true;
_global.CGAME.SPELLS[0][4] = _global.SPELLMANAGER.SPELLSCOSTS[0][tempLevel][1];
_global.SPELLMANAGER.SPELLS = _global.CGAME.SPELLS;
break;
case 2 :
_global.CGAME.SPELLSCURLEVELS[1]++;
att2_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[1] + 1;
att2_mc.reset();
tempLevel = _global.CGAME.SPELLSCURLEVELS[1];
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.SPELLS[1][2] = true;
_global.CGAME.SPELLS[1][4] = _global.SPELLMANAGER.SPELLSCOSTS[1][tempLevel][1];
_global.SPELLMANAGER.SPELLS = _global.CGAME.SPELLS;
break;
case 3 :
_global.CGAME.SPELLSCURLEVELS[2]++;
att3_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[2] + 1;
att3_mc.reset();
tempLevel = _global.CGAME.SPELLSCURLEVELS[2];
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.SPELLS[2][2] = true;
_global.CGAME.SPELLS[2][4] = _global.SPELLMANAGER.SPELLSCOSTS[2][tempLevel][1];
_global.SPELLMANAGER.SPELLS = _global.CGAME.SPELLS;
break;
case 4 :
_global.CGAME.SPELLSCURLEVELS[3]++;
att4_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[3] + 1;
att4_mc.reset();
tempLevel = _global.CGAME.SPELLSCURLEVELS[3];
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.SPELLS[3][2] = true;
_global.CGAME.SPELLS[3][4] = _global.SPELLMANAGER.SPELLSCOSTS[3][tempLevel][1];
_global.SPELLMANAGER.SPELLS = _global.CGAME.SPELLS;
break;
case 5 :
_global.CGAME.SPELLSCURLEVELS[4]++;
att5_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[4] + 1;
att5_mc.reset();
tempLevel = _global.CGAME.SPELLSCURLEVELS[4];
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.SPELLS[4][2] = true;
_global.CGAME.SPELLS[4][4] = _global.SPELLMANAGER.SPELLSCOSTS[4][tempLevel][1];
_global.SPELLMANAGER.SPELLS = _global.CGAME.SPELLS;
break;
case 6 :
_global.CGAME.SPELLSCURLEVELS[5]++;
att6_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[5] + 1;
att6_mc.reset();
tempLevel = _global.CGAME.SPELLSCURLEVELS[5];
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.SPELLS[5][2] = true;
_global.CGAME.SPELLS[5][5] = _global.SPELLMANAGER.SPELLSCOSTS[5][tempLevel][1];
_global.SPELLMANAGER.SPELLS = _global.CGAME.SPELLS;
break;
case 7 :
_global.CGAME.SPELLSCURLEVELS[6]++;
att7_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[6] + 1;
att7_mc.reset();
tempLevel = _global.CGAME.SPELLSCURLEVELS[6];
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.SPELLS[6][2] = true;
_global.CGAME.SPELLS[6][4] = _global.SPELLMANAGER.SPELLSCOSTS[6][tempLevel][1];
_global.SPELLMANAGER.SPELLS = _global.CGAME.SPELLS;
break;
case 8 :
_global.CGAME.SPELLSCURLEVELS[7]++;
att8_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[7] + 1;
att8_mc.reset();
tempLevel = _global.CGAME.SPELLSCURLEVELS[7];
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.SPELLS[7][2] = true;
_global.CGAME.SPELLS[7][4] = _global.SPELLMANAGER.SPELLSCOSTS[7][tempLevel][1];
_global.SPELLMANAGER.SPELLS = _global.CGAME.SPELLS;
break;
case 9 :
_global.CGAME.SPELLSCURLEVELS[8]++;
att9_mc.LEVEL = _global.CGAME.SPELLSCURLEVELS[8] + 1;
att9_mc.reset();
tempLevel = _global.CGAME.SPELLSCURLEVELS[8];
if (tempLevel == 5) {
tempLevel = 4;
}
_global.CGAME.SPELLS[8][2] = true;
_global.CGAME.SPELLS[8][3] = _global.SPELLMANAGER.SPELLSCOSTS[8][tempLevel][1];
_global.SPELLMANAGER.SPELLS = _global.CGAME.SPELLS;
}
_global.INTERFACE.refreshSpells();
}
}
function over(_INDEX) {
desc_txt.text = DESCRIPTIONS[_INDEX - 1];
}
function out(_INDEX) {
desc_txt.text = "";
}
stop();
spell1_txt.embedFonts = true;
spell1_txt.setTextFormat(_global.FORMAT01);
spell2_txt.embedFonts = true;
spell2_txt.setTextFormat(_global.FORMAT01);
spell3_txt.embedFonts = true;
spell3_txt.setTextFormat(_global.FORMAT01);
spell4_txt.embedFonts = true;
spell4_txt.setTextFormat(_global.FORMAT01);
spell5_txt.embedFonts = true;
spell5_txt.setTextFormat(_global.FORMAT01);
spell6_txt.embedFonts = true;
spell6_txt.setTextFormat(_global.FORMAT01);
spell7_txt.embedFonts = true;
spell7_txt.setTextFormat(_global.FORMAT01);
spell8_txt.embedFonts = true;
spell8_txt.setTextFormat(_global.FORMAT01);
spell9_txt.embedFonts = true;
spell9_txt.setTextFormat(_global.FORMAT01);
desc_txt.embedFonts = true;
desc_txt.setTextFormat(_global.FORMAT01);
DESCRIPTIONS = [];
DESCRIPTIONS.push("Fire Ball - this spell needs few mana and as it is upgraded causes more important damage on enemy. Next Level -> More damage.");
DESCRIPTIONS.push("Poison Ball - poisons the enemy causing damage for a certain time. Next Level -> More damage.");
DESCRIPTIONS.push("Ice Ball - freezes enemy causing it damage for a certain time. Next Level -> More damage.");
DESCRIPTIONS.push("Vampire Bat - damages enemy and increases your health. Next Level -> More damage (more health).");
DESCRIPTIONS.push("Firewall - damages every enemy that go through it. Will last for a certain time. Next Level -> More damage.");
DESCRIPTIONS.push("Lighting storm - great damage factor. The number of lightnings will increase as you master this spell. Next Level -> More lightnings.");
DESCRIPTIONS.push("Repair - use this spell to repair houses. . Next Level -> More repair.");
DESCRIPTIONS.push("Heal - use this spell to heal yourself or your crossbowmen. Next Level -> More health.");
DESCRIPTIONS.push("Teleportation - use this spell to move quickly from one side or the other off the city. Next Level -> Uses less mana.");
ZONES = [zone1_mc, zone2_mc, zone3_mc, zone4_mc, zone5_mc, zone6_mc, zone7_mc, zone8_mc, zone9_mc];
zone1_mc.onRollOver = function () {
over(1);
};
zone2_mc.onRollOver = function () {
over(2);
};
zone3_mc.onRollOver = function () {
over(3);
};
zone4_mc.onRollOver = function () {
over(4);
};
zone5_mc.onRollOver = function () {
over(5);
};
zone6_mc.onRollOver = function () {
over(6);
};
zone7_mc.onRollOver = function () {
over(7);
};
zone8_mc.onRollOver = function () {
over(8);
};
zone9_mc.onRollOver = function () {
over(9);
};
zone1_mc.onRollOut = function () {
out(1);
};
zone2_mc.onRollOut = function () {
out(2);
};
zone3_mc.onRollOut = function () {
out(3);
};
zone4_mc.onRollOut = function () {
out(4);
};
zone5_mc.onRollOut = function () {
out(5);
};
zone6_mc.onRollOut = function () {
out(6);
};
zone7_mc.onRollOut = function () {
out(7);
};
zone8_mc.onRollOut = function () {
out(8);
};
zone9_mc.onRollOut = function () {
out(9);
};
att1_mc.INDEX = 1;
att1_mc.COSTS = [];
var i = 0;
while (i < 5) {
att1_mc.COSTS.push(_global.SPELLMANAGER.SPELLSCOSTS[0][i][0]);
i++;
}
att2_mc.INDEX = 2;
att2_mc.COSTS = [];
var i = 0;
while (i < 5) {
att2_mc.COSTS.push(_global.SPELLMANAGER.SPELLSCOSTS[1][i][0]);
i++;
}
att3_mc.INDEX = 3;
att3_mc.COSTS = [];
var i = 0;
while (i < 5) {
att3_mc.COSTS.push(_global.SPELLMANAGER.SPELLSCOSTS[2][i][0]);
i++;
}
att4_mc.INDEX = 4;
att4_mc.COSTS = [];
var i = 0;
while (i < 5) {
att4_mc.COSTS.push(_global.SPELLMANAGER.SPELLSCOSTS[3][i][0]);
i++;
}
att5_mc.INDEX = 5;
att5_mc.COSTS = [];
var i = 0;
while (i < 5) {
att5_mc.COSTS.push(_global.SPELLMANAGER.SPELLSCOSTS[4][i][0]);
i++;
}
att6_mc.INDEX = 6;
att6_mc.COSTS = [];
var i = 0;
while (i < 5) {
att6_mc.COSTS.push(_global.SPELLMANAGER.SPELLSCOSTS[5][i][0]);
i++;
}
att7_mc.INDEX = 7;
att7_mc.COSTS = [];
var i = 0;
while (i < 5) {
att7_mc.COSTS.push(_global.SPELLMANAGER.SPELLSCOSTS[6][i][0]);
i++;
}
att8_mc.INDEX = 8;
att8_mc.COSTS = [];
var i = 0;
while (i < 5) {
att8_mc.COSTS.push(_global.SPELLMANAGER.SPELLSCOSTS[7][i][0]);
i++;
}
att9_mc.INDEX = 9;
att9_mc.COSTS = [];
var i = 0;
while (i < 5) {
att9_mc.COSTS.push(_global.SPELLMANAGER.SPELLSCOSTS[8][i][0]);
i++;
}
Symbol 2997 MovieClip Frame 1 (1.05 KiB) ●
function refreshPotions() {
qty1_txt.text = "x " + String(_global.CGAME.HEALPOTIONS);
qty2_txt.text = "x " + String(_global.CGAME.MANAPOTIONS);
}
stop();
qty1_txt.embedFonts = true;
qty1_txt.setTextFormat(_global.FORMAT01);
qty2_txt.embedFonts = true;
qty2_txt.setTextFormat(_global.FORMAT01);
cost1_txt.embedFonts = true;
cost1_txt.setTextFormat(_global.FORMAT01);
cost2_txt.embedFonts = true;
cost2_txt.setTextFormat(_global.FORMAT01);
COSTHEALING = 100;
COSTMANA = 100;
buy1_btn.onRelease = function () {
if (_global.CGAME.MONEY < COSTHEALING) {
_parent.notEnoughMoney();
} else {
_global.CGAME.HEALPOTIONS++;
_global.CGAME.MONEY = _global.CGAME.MONEY - COSTHEALING;
_parent.refreshMoney();
_parent.refreshHealing();
refreshPotions();
}
};
buy2_btn.onRelease = function () {
if (_global.CGAME.MONEY < COSTMANA) {
_parent.notEnoughMoney();
} else {
_global.CGAME.MANAPOTIONS++;
_global.CGAME.MONEY = _global.CGAME.MONEY - COSTMANA;
_parent.refreshMoney();
_parent.refreshMana();
refreshPotions();
}
};
Symbol 2999 MovieClip Frame 1 (8 B)
stop();
Symbol 2999 MovieClip Frame 2 (69 B)
msg_txt.embedFonts = true;
msg_txt.setTextFormat(_global.FORMAT01);
Symbol 3000 MovieClip Frame 1 (2.22 KiB) ●
function setTab(_INDEX) {
_global.JUKEBOX.playSound1("click");
var _local2;
_local2 = 1;
while (_local2 < 4) {
if (_local2 == _INDEX) {
BUTTONS[_local2 - 1].gotoAndStop(3);
UIS[_local2 - 1]._visible = true;
} else {
BUTTONS[_local2 - 1].gotoAndStop(1);
UIS[_local2 - 1]._visible = false;
}
_local2++;
}
SELECTEDINDEX = _INDEX;
}
function over(_INDEX) {
if (_INDEX != SELECTEDINDEX) {
BUTTONS[_INDEX - 1].gotoAndStop(2);
}
}
function out(_INDEX) {
if (_INDEX != SELECTEDINDEX) {
BUTTONS[_INDEX - 1].gotoAndStop(1);
}
}
function refreshMoney() {
money_mc.refreshMoney();
_global.INTERFACE.refreshMoney();
}
function notEnoughMoney() {
msgBox_mc._visible = true;
msgBox_mc.gotoAndPlay(2);
}
function refreshUi() {
attributes_mc.refreshAttributes();
spells_mc.refreshAttributes();
focus_ui.refreshMana();
health_ui.refreshHeal();
potions_mc.refreshPotions();
money_mc.refreshMoney();
}
function refreshHealing() {
health_ui.refreshHeal();
_global.INTERFACE.refreshHealPotions();
}
function refreshMana() {
focus_ui.refreshMana();
_global.INTERFACE.refreshManaPotions();
}
stop();
_global.CHARACTERSHEET = this;
header_txt.embedFonts = true;
header_txt.setTextFormat(_global.FORMAT01);
name_txt.embedFonts = true;
name_txt.setTextFormat(_global.FORMAT01);
name_txt.text = _global.CGAME.PLAYERNAME;
BUTTONS = [c1_mc, c2_mc, c3_mc];
UIS = [attributes_mc, spells_mc, potions_mc];
attributes_mc._visible = true;
spells_mc._visible = false;
potions_mc._visible = false;
msgBox_mc._visible = false;
ZONES = [zone1_mc, zone2_mc, zone3_mc];
zone1_mc.onRelease = function () {
setTab(1);
};
zone2_mc.onRelease = function () {
setTab(2);
};
zone3_mc.onRelease = function () {
setTab(3);
};
zone1_mc.onRollOver = function () {
over(1);
};
zone2_mc.onRollOver = function () {
over(2);
};
zone3_mc.onRollOver = function () {
over(3);
};
zone1_mc.onRollOut = function () {
out(1);
};
zone2_mc.onRollOut = function () {
out(2);
};
zone3_mc.onRollOut = function () {
out(3);
};
SELECTEDINDEX = 1;
BUTTONS[0].gotoAndStop(3);
ok_btn.onRelease = function () {
_global.CURSOR.questionMarkOff();
_global.INTERFACE.hideCharacterSheet();
};
Symbol 3007 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 3010 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 3012 MovieClip Frame 1 (2.34 KiB) ●
function setTower(_TOWERIND) {
msg_txt.text = "";
TOWERIND = _TOWERIND;
if (_global.CGAME.TOWERS[TOWERIND][1]) {
hire_btn._visible = false;
upgrade_btn._visible = true;
switch (_global.CGAME.TOWERS[TOWERIND][2]) {
case 1 :
cost_txt.text = "Cost: 400$";
desc1_txt.text = "Crossbowman Level 2";
COST = 400;
break;
case 2 :
cost_txt.text = "Cost: 600$";
desc1_txt.text = "Crossbowman Level 3";
COST = 600;
break;
case 3 :
cost_txt.text = "Cost: 1000$";
desc1_txt.text = "Crossbowman Level 4";
COST = 1000;
break;
case 4 :
cost_txt.text = "";
desc1_txt.text = "Crossbowman Level 4";
hire_btn._visible = false;
upgrade_btn._visible = false;
COST = 0;
}
} else {
hire_btn._visible = true;
upgrade_btn._visible = false;
cost_txt.text = "Cost: 600$";
desc1_txt.text = "Crossbowman Level 1";
COST = 600;
}
}
stop();
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
cost_txt.embedFonts = true;
cost_txt.setTextFormat(_global.FORMAT01);
desc1_txt.embedFonts = true;
desc1_txt.setTextFormat(_global.FORMAT01);
msg_txt.embedFonts = true;
msg_txt.setTextFormat(_global.FORMAT01);
hire_btn._visible = false;
upgrade_btn._visible = false;
ok_btn.onRelease = function () {
_global.INTERFACE.resumePlay();
_global.CURSOR.questionMarkOff();
_visible = false;
};
upgrade_btn.onRelease = function () {
if (_global.CGAME.MONEY < COST) {
msg_txt.text = "Not enough money!";
} else {
_global.CGAME.MONEY = _global.CGAME.MONEY - COST;
_global.INTERFACE.refreshMoney();
_global.CGAME.TOWERS[TOWERIND][1] = true;
_global.CGAME.TOWERS[TOWERIND][2]++;
if (_global.CGAME.TOWERS[TOWERIND][2] > 4) {
_global.CGAME.TOWERS[TOWERIND][2] = 4;
}
setTower(TOWERIND);
_global.SCENEMANAGER.refreshArcher(TOWERIND);
}
};
hire_btn.onRelease = function () {
if (_global.CGAME.MONEY < COST) {
msg_txt.text = "Not enough money!";
} else {
_global.CGAME.MONEY = _global.CGAME.MONEY - COST;
_global.INTERFACE.refreshMoney();
_global.CGAME.TOWERS[TOWERIND][1] = true;
_global.CGAME.TOWERS[TOWERIND][2] = 1;
if (_global.CGAME.TOWERS[TOWERIND][2] > 4) {
_global.CGAME.TOWERS[TOWERIND][2] = 4;
}
setTower(TOWERIND);
_global.SCENEMANAGER.refreshArcher(TOWERIND);
}
};
Symbol 3014 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 3017 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 3020 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 3022 MovieClip Frame 1 (375 B)
stop();
ok_btn.onRelease = function () {
_global.INTERFACE.resumePlay();
_visible = false;
};
resume_btn.onRelease = function () {
_global.INTERFACE.hidePause();
};
howtoplay_btn.onRelease = function () {
_global.INTERFACE.showInstructions();
_visible = false;
};
quit_btn.onRelease = function () {
_global.INTERFACE.quitGame();
_visible = false;
};
Symbol 3026 MovieClip Frame 1 (1.04 KiB) ●
function refreshUi() {
msg_txt.text = "";
code_txt.text = "";
}
stop();
_root.focusManager.setFocus(code_txt);
caption_txt.embedFonts = true;
caption_txt.setNewTextFormat(_global.FORMAT01);
code_txt.embedFonts = true;
code_txt.setNewTextFormat(_global.FORMAT01);
msg_txt.embedFonts = true;
msg_txt.setNewTextFormat(_global.FORMAT01);
resume_btn.onRelease = function () {
refreshUi();
_global.INTERFACE.hideCheat();
};
close_btn.onRelease = function () {
refreshUi();
_global.INTERFACE.hideCheat();
};
ok_btn.onRelease = function () {
CODE = code_txt.text;
switch (CODE) {
case "iwillnotdie" :
msg_txt.text = "So will it be! You will not die!";
_global.CGAME.NOTDIE = true;
break;
case "iamrich" :
msg_txt.text = "You are rich now!";
_global.CGAME.MONEY = 50000;
_global.INTERFACE.refreshMoney();
break;
case "iampowerful" :
msg_txt.text = "So will it be! Your mana will not decrease!";
_global.CGAME.POWERFUL = true;
break;
default :
msg_txt.text = "Invalid code!";
}
};
Symbol 3030 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 3032 MovieClip Frame 1 (385 B)
stop();
caption_txt.embedFonts = true;
caption_txt.setTextFormat(_global.FORMAT01);
msg1txt.embedFonts = true;
msg1txt.setTextFormat(_global.FORMAT01);
playnow_btn.onRelease = function () {
url = "http://www.playnow3dgames.com/index.php?refgame=" + _global.GAMEID;
getURL (url, "_blank", "POST");
};
backToMenu_btn.onRelease = function () {
_global.uiGAME.gotoMenu();
};
Symbol 3035 MovieClip Frame 1 (6.88 KiB) ● ●
function onKeyDown() {
if (GAMEPAUSED) {
return(undefined);
}
if (Key.isDown(67)) {
showCheat();
return(undefined);
}
if (Key.isDown(80)) {
showPause();
return(undefined);
}
}
function onKeyUp() {
if (GAMEPAUSED) {
return(undefined);
}
}
function onMouseUp() {
if (GAMEPAUSED) {
return(undefined);
}
if (_global.HERO.ONTRANSPORT) {
_global.HERO.endTransport();
return(undefined);
}
if ((_ymouse < 400) && (!_global.CURSOR.QUESTIONMARK)) {
_global.SPELLMANAGER.callSpell(_xmouse, _ymouse);
}
_global.CURSOR.QUESTIONMARK = false;
}
function pausePlay() {
GAMEPAUSED = true;
menu_btn._visible = false;
}
function resumePlay() {
GAMEPAUSED = false;
menu_btn._visible = true;
}
function showPause() {
pause_mc._visible = true;
gameTime_mc._visible = false;
spell_mc._visible = false;
healingPotions_mc._visible = false;
manaPotions_mc._visible = false;
pausePlay();
}
function hidePause() {
pause_mc._visible = false;
gameTime_mc._visible = true;
spell_mc._visible = true;
healingPotions_mc._visible = true;
manaPotions_mc._visible = true;
resumePlay();
}
function gameWin() {
win_mc._visible = true;
gameTime_mc._visible = false;
spell_mc._visible = false;
healingPotions_mc._visible = false;
manaPotions_mc._visible = false;
pausePlay();
}
function showCharacterSheet() {
gameTime_mc._visible = false;
spell_mc._visible = false;
healingPotions_mc._visible = false;
manaPotions_mc._visible = false;
sheet_mc._visible = true;
sheet_mc.refreshUi();
pausePlay();
}
function hideCharacterSheet() {
gameTime_mc._visible = true;
spell_mc._visible = true;
healingPotions_mc._visible = true;
manaPotions_mc._visible = true;
sheet_mc._visible = false;
resumePlay();
}
function showInstructions() {
pausePlay();
instructions_mc._visible = true;
gameTime_mc._visible = false;
spell_mc._visible = false;
healingPotions_mc._visible = false;
manaPotions_mc._visible = false;
}
function backFromInstructions() {
instructions_mc._visible = false;
gameTime_mc._visible = true;
spell_mc._visible = true;
healingPotions_mc._visible = true;
manaPotions_mc._visible = true;
resumePlay();
}
function quitGame() {
_global.CURSOR.menuMode();
_global.uiGAME.gotoMenu();
}
function gameOver(_TYPE) {
MISSIONFAILED = true;
gameOver_mc.setType(_TYPE);
_global.EVTMANAGER.evt(24, showMissionFailed, this);
}
function heroKilled() {
if (MISSIONFAILED || (MISSIONCOMPLETED)) {
return(undefined);
}
MISSIONFAILED = true;
}
function showMissionFailed(_TYPE) {
GAMEPAUSED = true;
_global.CURSOR.menuMode();
_global.JUKEBOX.playSound2("sound_gameOver");
gameOver_mc._visible = true;
}
function missionCompleted() {
SCENEMANAGER.stopCreation();
if (SCENEMANAGER.anyUnit()) {
timer120_mc.evt(120, missionCompleted2, this);
return(undefined);
}
if (MISSIONFAILED || (MISSIONCOMPLETED)) {
return(undefined);
}
MISSIONCOMPLETED = true;
SCENEMANAGER.stopCreation();
buttons_mc._visible = false;
score_mc._visible = false;
timer120_mc.evt(72, showMissionCompleted, this);
}
function missionCompleted2() {
if (MISSIONFAILED || (MISSIONCOMPLETED)) {
return(undefined);
}
MISSIONCOMPLETED = true;
buttons_mc._visible = false;
score_mc._visible = false;
showMissionCompleted();
}
function showMissionCompleted() {
missionCompleted_mc._visible = true;
}
function gotoMenu() {
Mouse.show();
Key.removeListener(this);
_global.uiGAME.gotoMenu();
}
function decreaseMana(_MANAQTY) {
var _local2 = (_global.HERO.MFACTOR * _global.HERO.MANAPCT) / 100;
if (_local2 >= _MANAQTY) {
_global.HERO.MANAPCT = _global.HERO.MANAPCT - ((_MANAQTY * 100) / _global.HERO.MFACTOR);
if (_global.HERO.MANAPCT < 0) {
_global.HERO.MANAPCT = 0;
}
return(true);
}
return(false);
}
function showRadar() {
radar_mc._visible = true;
}
function hideRadar() {
radar_mc._visible = false;
}
function showNightOverMsg(_POPBEF, _POPNOW, _MONEYEARNED, _POPBORN, _POPKILLED, _TOWERCONSTRUCTED) {
GAMEPAUSED = true;
_global.CURSOR.menuMode();
_global.SCENEMANAGER.HERO.ready();
nightOverMsg_mc._visible = true;
nightOverMsg_mc.setMsgs(_POPBEF, _POPNOW, _MONEYEARNED, _POPBORN, _POPKILLED, _TOWERCONSTRUCTED);
}
function hideNightOverMsg() {
GAMEPAUSED = false;
nightOverMsg_mc._visible = false;
gameTime_mc.goDay();
}
function refreshMoney() {
money_mc.refreshMoney();
}
function showTowerSheet(_TOWERIND) {
GAMEPAUSED = true;
towerSheet_mc._visible = true;
towerSheet_mc.setTower(_TOWERIND);
}
function refreshSpells() {
spell_mc.refreshSpells();
}
function refreshManaPotions() {
manaPotions_mc.refreshMana();
}
function refreshHealPotions() {
healingPotions_mc.refreshHealing();
}
function setMessage(_MSG) {
message_mc._visible = true;
message_mc.setMessage(_MSG);
}
function hideMessage() {
message_mc._visible = false;
}
function refreshPeople() {
people_mc.refreshPeople();
}
function showCheat() {
cheat_mc._visible = true;
cheat_mc.refreshUi();
gameTime_mc._visible = false;
spell_mc._visible = false;
healingPotions_mc._visible = false;
manaPotions_mc._visible = false;
pausePlay();
_global.CURSOR.menuMode();
}
function hideCheat() {
cheat_mc._visible = false;
gameTime_mc._visible = true;
spell_mc._visible = true;
healingPotions_mc._visible = true;
manaPotions_mc._visible = true;
resumePlay();
}
if (INIT == undefined) {
_global.INTERFACE = this;
playerName_txt.embedFonts = true;
playerName_txt.setTextFormat(_global.FORMAT01);
CGAME = _global.CGAME;
FRAMECOUNT = 1;
radar_mc._visible = false;
nightOverMsg_mc._visible = false;
towerSheet_mc._visible = false;
GAMEPLAY = _global.GAMEPLAY;
SPELLSELECTION = spell_mc;
gameOver_mc._visible = false;
INIT = true;
MOUSEDOWN = false;
GAMEPAUSED = false;
MISSIONFAILED = false;
MISSIONCOMPLETED = false;
lock_mc._visible = false;
missionFailed_mc._visible = false;
missionCompleted_mc._visible = false;
pause_mc._visible = false;
sheet_mc._visible = false;
instructions_mc._visible = false;
rage_mc._visible = false;
powermeter_mc._visible = false;
message_mc._visible = false;
win_mc._visible = false;
cheat_mc._visible = false;
playerName_txt.text = _global.CGAME.PLAYERNAME;
Key.addListener(this);
showInstructions();
}
this.onEnterFrame = function () {
if (GAMEPAUSED) {
_global.JUKEBOX.begin(1);
return(undefined);
}
if (_global.PLAYSOUND == 1) {
_global.JUKEBOX.begin(2);
} else {
_global.JUKEBOX.begin(3);
}
if (_ymouse < 400) {
_global.SPELLMANAGER.setCursor();
} else {
_global.CURSOR.menuMode();
}
FRAMECOUNT++;
_global.EVTMANAGER.nextState();
_global.SCENEMANAGER.nextState();
_global.SPELLMANAGER.nextState();
status_mc.nextState();
gameTime_mc.nextState();
radar_mc.nextState();
};
menu_btn.onRelease = function () {
showPause();
};
Symbol 3036 MovieClip Frame 1 (1.66 KiB) ●
stop();
SCENEMANAGER = new SceneManager(scene_mc);
_global.SCENEMANAGER = SCENEMANAGER;
_global.SCENEMANAGER.HOUSESMC = [scene_mc.house0_mc, scene_mc.house1_mc, scene_mc.house2_mc, scene_mc.house3_mc, scene_mc.house4_mc, scene_mc.house5_mc, scene_mc.house6_mc, scene_mc.house7_mc, scene_mc.house8_mc, scene_mc.house9_mc];
_global.SCENEMANAGER.TOWERSMC = [scene_mc.tower0_mc, scene_mc.tower1_mc, scene_mc.tower2_mc, scene_mc.tower3_mc, scene_mc.tower4_mc, scene_mc.tower5_mc, scene_mc.tower6_mc, scene_mc.tower7_mc];
var housesAvailable;
var j = (_global.CGAME.HOUSES.length - 1);
j = _global.CGAME.HOUSES.length - 1;
while (j >= 0) {
if (_global.CGAME.HOUSES[j][0]) {
housesAvailable = j;
break;
}
j--;
}
XMAX = 2910;
XMIN = 1450;
TEMPHOUSES = _global.SCENEMANAGER.HOUSESMC;
switch (housesAvailable) {
case 9 :
XMAX = TEMPHOUSES[8]._x + 560;
XMIN = TEMPHOUSES[9]._x - 350;
break;
case 8 :
XMAX = TEMPHOUSES[8]._x + 560;
XMIN = TEMPHOUSES[7]._x - 350;
break;
case 7 :
XMAX = TEMPHOUSES[6]._x + 560;
XMIN = TEMPHOUSES[7]._x - 350;
break;
case 6 :
XMAX = TEMPHOUSES[6]._x + 560;
XMIN = TEMPHOUSES[5]._x - 350;
break;
case 5 :
XMAX = TEMPHOUSES[4]._x + 560;
XMIN = TEMPHOUSES[5]._x - 350;
break;
case 4 :
XMAX = TEMPHOUSES[4]._x + 560;
XMIN = TEMPHOUSES[3]._x - 350;
break;
case 3 :
XMAX = TEMPHOUSES[2]._x + 560;
XMIN = TEMPHOUSES[3]._x - 350;
break;
case 2 :
XMAX = TEMPHOUSES[2]._x + 560;
XMIN = TEMPHOUSES[1]._x - 350;
break;
case 1 :
XMAX = TEMPHOUSES[0]._x + 560;
XMIN = TEMPHOUSES[1]._x - 350;
}
_global.SCENEMANAGER.XMAX = XMAX;
_global.SCENEMANAGER.XMIN = XMIN;
Symbol 3037 MovieClip Frame 1 (128 B)
function tryAgain() {
gotoAndStop (5);
}
stop();
_global.GAMEPLAY = this;
CGAME = _global.CGAME;
_global.GAMEPERIOD = 1;
Symbol 3037 MovieClip Frame 5 (17 B)
gotoAndStop (1);
Symbol 3044 MovieClip Frame 1 (73 B)
label_txt.embedFonts = true;
label_txt.setTextFormat(_global.FORMAT01);
Symbol 3046 MovieClip Frame 1 (455 B)
stop();
caption_txt.embedFonts = true;
caption_txt.setTextFormat(_global.FORMAT01);
msg1txt.embedFonts = true;
msg1txt.setTextFormat(_global.FORMAT01);
msg2txt.embedFonts = true;
msg2txt.setTextFormat(_global.FORMAT01);
playnow_btn.onRelease = function () {
url = "http://www.playnow3dgames.com/cheatcodes.php?id=" + _global.GAMEID;
getURL (url, "_blank", "POST");
};
backToMenu_btn.onRelease = function () {
_global.uiGAME.gotoMenu();
};
Symbol 3047 MovieClip Frame 1 (762 B)
function gotoMenu() {
gotoAndStop ("menu");
}
function gotoInstructions() {
gotoAndStop ("instructions");
}
function backFromInstructions() {
gotoAndStop(STATE);
}
function gotoCredits() {
gotoAndStop ("credits");
}
function gotoOptions() {
gotoAndStop ("options");
}
function gotoNewGame() {
gotoAndStop ("new game");
}
function gotoLoadGame() {
gotoAndStop ("load game");
}
function gotoSelect() {
gotoAndStop ("select");
}
function gotoLoading() {
gotoAndStop ("loading");
}
function gotoPlay() {
gotoAndStop ("play");
}
function gotoIntro() {
gotoAndStop ("intro");
}
function gotoCheatGame() {
gotoAndStop ("cheatgame");
}
_global.uiGAME = this;
STATE = "menu";
_global.CURLEVEL = 1;
lair_mc.hideWizard();
Symbol 3047 MovieClip Frame 2 (35 B)
stop();
_global.JUKEBOX.begin(1);
Symbol 3047 MovieClip Frame 10 (8 B)
stop();
Symbol 3047 MovieClip Frame 20 (8 B)
stop();
Symbol 3047 MovieClip Frame 40 (29 B)
stop();
STATE = "new game";
Symbol 3047 MovieClip Frame 47 (26 B)
stop();
STATE = "intro";
Symbol 3047 MovieClip Frame 50 (30 B)
stop();
STATE = "load game";
Symbol 3047 MovieClip Frame 58 (60 B)
STATE = "select";
lair_mc.showWizard();
gotoAndPlay (59);
Symbol 3047 MovieClip Frame 65 (8 B)
stop();
Symbol 3047 MovieClip Frame 70 (8 B)
stop();
Symbol 3047 MovieClip Frame 80 (25 B)
stop();
STATE = "play";
Symbol 3047 MovieClip Frame 90 (61 B)
stop();
gameData.copyGame(_global.TEMPGAME, _global.CGAME);