Frame 1
Stage.showMenu = false;
var MochiAd = {getVersion:function () {
return("2.5");
}, showPreGameAd:function (options) {
var DEFAULTS = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var ad_msec = 11000;
var ad_timeout = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var wh = MochiAd._getRes(options);
var w = wh[0];
var h = wh[1];
mc._x = w * 0.5;
mc._y = h * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = w * -0.5;
chk._y = h * -0.5;
var bar = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
bar._visible = false;
delete options.no_progress_bar;
} else {
bar._x = 10;
bar._y = h - 20;
}
var bar_color = options.color;
delete options.color;
var bar_background = options.background;
delete options.background;
var bar_outline = options.outline;
delete options.outline;
var backing = bar.createEmptyMovieClip("_outline", 1);
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(w - 20, 0);
backing.lineTo(w - 20, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside = bar.createEmptyMovieClip("_inside", 2);
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(w - 20, 0);
inside.lineTo(w - 20, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside._xscale = 0;
var outline = bar.createEmptyMovieClip("_outline", 3);
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(w - 20, 0);
outline.lineTo(w - 20, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var p = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0) {
this._parent._alpha = p;
} else {
var _clip = this._parent._parent;
MochiAd.unload(_clip);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _chk = this.mc._mochiad_wait;
_chk.server_control = true;
_chk.started = getTimer();
_chk.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _clip = this._parent._parent;
var ad_clip = this._parent._mochiad_ctr;
var elapsed = (getTimer() - this.started);
var finished = false;
var clip_total = _clip.getBytesTotal();
var clip_loaded = _clip.getBytesLoaded();
var clip_pcnt = ((100 * clip_loaded) / clip_total);
var ad_pcnt = ((100 * elapsed) / chk.ad_msec);
var _inside = this._mochiad_bar._inside;
var pcnt = Math.min(100, Math.min(clip_pcnt || 0, ad_pcnt));
pcnt = Math.max(this.last_pcnt, pcnt);
this.last_pcnt = pcnt;
_inside._xscale = pcnt;
options.ad_progress(pcnt);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:clip_pcnt});
if (clip_pcnt == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var total = ad_clip.getBytesTotal();
if ((total > 0) || (typeof(total) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((elapsed > chk.ad_timeout) && (clip_pcnt == 100)) {
options.ad_failed();
finished = true;
}
}
if (elapsed > chk.ad_msec) {
finished = true;
}
if (((clip_total > 0) && (clip_loaded >= clip_total)) && (finished)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}, showClickAwayAd:function (options) {
var DEFAULTS = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = MochiAd._parseOptions(options, DEFAULTS);
var clip = options.clip;
var ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var wh = MochiAd._getRes(options);
var w = wh[0];
var h = wh[1];
mc._x = w * 0.5;
mc._y = h * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var sendHostProgress = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var ad_clip = this._parent._mochiad_ctr;
var elapsed = (getTimer() - this.started);
var finished = false;
if (!chk.showing) {
var total = ad_clip.getBytesTotal();
if ((total > 0) || (typeof(total) == "undefined")) {
finished = true;
chk.showing = true;
chk.started = getTimer();
} else if (elapsed > chk.ad_timeout) {
options.ad_failed();
finished = true;
}
}
if (finished) {
delete this.onEnterFrame;
}
};
}, showInterLevelAd:function (options) {
var DEFAULTS = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = MochiAd._parseOptions(options, DEFAULTS);
var clip = options.clip;
var ad_msec = 11000;
var ad_timeout = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var wh = MochiAd._getRes(options);
var w = wh[0];
var h = wh[1];
mc._x = w * 0.5;
mc._y = h * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var p = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0) {
this._parent._alpha = p;
} else {
var _clip = this._parent._parent;
MochiAd.unload(_clip);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _chk = this.mc._mochiad_wait;
_chk.server_control = true;
_chk.started = getTimer();
_chk.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var ad_clip = this._parent._mochiad_ctr;
var elapsed = (getTimer() - this.started);
var finished = false;
if (!chk.showing) {
var total = ad_clip.getBytesTotal();
if ((total > 0) || (typeof(total) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (elapsed > chk.ad_timeout) {
options.ad_failed();
finished = true;
}
}
if (elapsed > chk.ad_msec) {
finished = true;
}
if (finished) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}, showPreloaderAd:function (options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(options);
}, showTimedAd:function (options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(options);
}, _allowDomains:function (server) {
var hostname = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(hostname);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(hostname);
}
}
return(hostname);
}, load:function (options) {
var DEFAULTS = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = MochiAd.getVersion();
var clip = options.clip;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (clip._mochiad_loaded) {
return(null);
}
var depth = options.depth;
delete options.depth;
var mc = clip.createEmptyMovieClip("_mochiad", depth);
var wh = MochiAd._getRes(options);
options.res = (wh[0] + "x") + wh[1];
options.server = options.server + options.id;
delete options.id;
clip._mochiad_loaded = true;
var lv = mc.createEmptyMovieClip("_mochiad_ctr", 1);
for (var k in options) {
lv[k] = options[k];
}
var server = lv.server;
delete lv.server;
var hostname = MochiAd._allowDomains(server);
mc.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var lc = new LocalConnection();
var name = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
lc.mc = mc;
lc.name = name;
lc.hostname = hostname;
lc.allowDomain = function (d) {
return(true);
};
lc.allowInsecureDomain = lc.allowDomain;
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
lv.loadMovie(server + ".swf", "POST");
return(mc);
}, unload:function (clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}, _isNetworkAvailable:function () {
if (System.security) {
var o = System.security;
if (o.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}, _getRes:function (options) {
var b = options.clip.getBounds();
var w = 0;
var h = 0;
if (typeof(options.res) != "undefined") {
var xy = options.res.split("x");
w = parseFloat(xy[0]);
h = parseFloat(xy[1]);
} else {
w = b.xMax - b.xMin;
h = b.yMax - b.yMin;
}
if ((w == 0) || (h == 0)) {
w = Stage.width;
h = Stage.height;
}
return([w, h]);
}, _parseOptions:function (options, defaults) {
var optcopy = {};
for (var k in defaults) {
optcopy[k] = defaults[k];
}
if (options) {
for (var k in options) {
optcopy[k] = options[k];
}
}
if (_root.mochiad_options) {
var pairs = _root.mochiad_options.split("&");
var i = 0;
while (i < pairs.length) {
var kv = pairs[i].split("=");
optcopy[unescape(kv[0])] = unescape(kv[1]);
i++;
}
}
if (optcopy.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(optcopy);
}, rpc:function (clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
MochiAd.setValue(clip, arg.objectName, arg.value);
return;
case "getValue" :
var val = MochiAd.getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, val);
return;
case "runMethod" :
var ret = MochiAd.runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, ret);
return;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}, setValue:function (base, objectName, value) {
var nameArray:Array = objectName.split(".");
var i;
i = 0;
while (i < (nameArray.length - 1)) {
if ((base[nameArray[i]] == undefined) || (base[nameArray[i]] == null)) {
return(undefined);
}
base = base[nameArray[i]];
i++;
}
base[nameArray[i]] = value;
}, getValue:function (base, objectName) {
var nameArray:Array = objectName.split(".");
var i;
i = 0;
while (i < (nameArray.length - 1)) {
if ((base[nameArray[i]] == undefined) || (base[nameArray[i]] == null)) {
return(undefined);
}
base = base[nameArray[i]];
i++;
}
return(base[nameArray[i]]);
}, runMethod:function (base, methodName, argsArray:Array) {
var nameArray:Array = methodName.split(".");
var i;
i = 0;
while (i < (nameArray.length - 1)) {
if ((base[nameArray[i]] == undefined) || (base[nameArray[i]] == null)) {
return(undefined);
}
base = base[nameArray[i]];
i++;
}
if (typeof(base[nameArray[i]]) == "function") {
return(base[nameArray[i]].apply(base, argsArray));
}
return(undefined);
}, _:null};
stop();
Instance of Symbol 236 MovieClip in Frame 1
//component parameters
onClipEvent (initialize) {
customCircleColor = 16711680 /* 0xFF0000 */;
customcirclemessagemc = "Loading... Please wait";
customtxtColor = 65280;
customRotation = 3;
}
Frame 2
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("3fe0e863", this, 10301, true);
if ((((url_username == null) and (url_editor == null)) and (url_options == null)) and (url_ID == null)) {
stop();
}
Frame 3
function editorMode(showFileMenu, newDocument) {
gotoAndStop (5);
campaignMode = false;
gallery.removeMovieClip();
if (fpsCounter == undefined) {
toggleFPScounter();
}
attachMovie("editor.library", "library", d_library);
library._x = (STAGE_W - library._width) - 10;
library._y = 0;
with (library) {
bar.onPress = function () {
startDrag();
};
com.boundingBox_mc._alpha = 0;
com.onLoad = function () {
for (var i in com.tmp_mc) {
com.tmp_mc[i].onEnterFrame = function () {
this.__proto__ = _root["e_" + this.link].prototype;
this.init();
this.onEnterFrame = null;
};
com.tmp_mc[i].onPress = function () {
_root.editor_attachPart(this.link);
};
com.tmp_mc[i].onRollOver = function () {
var nameTxt = ((this.niceName != undefined) ? (this.niceName) : (this.link));
_root.ideHelpTxt.setTxt(nameTxt);
};
com.tmp_mc[i].onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
}
};
com.advancedView = function () {
for (var i in com.tmp_mc) {
com.tmp_mc[i].onPress = function () {
_root.editor_attachPart(this.link);
};
com.tmp_mc[i].onRollOver = function () {
var nameTxt = ("Name: " + this.link);
_root.ideHelpTxt.setTxt(nameTxt);
};
com.tmp_mc[i].onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
}
_root.library.com.advancedViewEnabled = true;
};
}
attachMovie("editor.tools", "tools", d_tools);
tools._x = 10;
tools._y = 0;
with (tools) {
bar.onPress = function () {
startDrag();
};
playBtn.onPress = function () {
_root.editor_convertToGame();
};
playBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt(("<b>[" + _root.codeName[_root.key_pause]) + "]</b> Play your creation. You can always come back here later");
};
playBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
helperBtn.onPress = function () {
_root.editor_toggleHelper();
};
helperBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt(("<b>[?]</b> (Forward slash key)\nToggle helper to see how/where parts are linked (parent part)\n<font color=\"#FFCC33\">Orange</font> lines snap to closest part\n<font color=\"#FF1111\">Red</font> lines are locked (toggle lock with [" + _root.codeName[_root.key_ed_lock]) + "])");
};
helperBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
editor_viewHierarchy();
tools.helperMC.gotoAndStop(2);
coreAIBtn.onPress = function () {
_root.editor_toggleCoreAIwindow();
};
coreAIBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[F2]</b> Set the core's AI");
};
coreAIBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
loginBtn.onPress = function () {
_root.editor_toggleLoginWin();
};
loginBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[L]</b> Login. This will allow you to save your level");
};
loginBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
saveAsBtn.onPress = function () {
_root.editor_toggleSaveAsWin();
};
saveAsBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[CTRL s]</b> Save your masterpiece!");
};
saveAsBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
tutorialBtn.onPress = function () {
attachMovie("editor.tutorial", "tutorial", d_edTutorial);
};
tutorialBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[F1]</b> View the default controls for this editor.\nControls can be changed in the options menu");
};
tutorialBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
textEditBtn.onPress = function () {
_root.editor_toggleTextEdit();
};
textEditBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[F3]</b> Manually edit pieces in text");
};
textEditBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
menuBtn.onPress = function () {
_root.editor_toggleFileMenuWin();
};
menuBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[M]</b> Open Menu");
};
menuBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
}
attachMovie("editor.properties", "properties", d_properties);
properties._x = 0;
properties._y = tools._y + tools._height;
with (properties) {
bar.onPress = function () {
startDrag();
};
xBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Selection's X coordinate");
};
xBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
yBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Selection's Y coordinate");
};
yBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
angleBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Selection's angle in degrees");
};
angleBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
widthBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Selection's width");
};
widthBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
heightBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Selection's height");
};
heightBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
parentBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Selection's link (parent part)");
};
parentBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
mirrorHorizBtn.onRelease = function () {
_root.editor_mirror(true, false);
};
mirrorHorizBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[z]</b> Mirror selection along the vertical axis");
};
mirrorHorizBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
mirrorVertBtn.onRelease = function () {
_root.editor_mirror(false, true);
};
mirrorVertBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[x]</b> Mirror selecion along the horizontal axis");
};
mirrorVertBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
mirrorBothBtn.onRelease = function () {
_root.editor_mirror(true, true);
};
mirrorBothBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[c]</b> Mirror selection along both axis");
};
mirrorBothBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
duplicateBtn.onRelease = function () {
_root.editor_duplicate();
};
duplicateBtn.onRollOver = function () {
var str = "<b>[CTRL d]</b> Duplicate the selection";
if (_root.key_ed_duplicate == undefined) {
str = str + "\n(Can set an alternate key in the options menu)";
} else {
str = str + (("\n<b>[" + _root.codeName[_root.key_ed_duplicate]) + "]</b> Alternate key for above");
}
_root.ideHelpTxt.setTxt(str);
};
duplicateBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
selectAllBtn.onRelease = function () {
_root.editor_selectAll();
};
selectAllBtn.onRollOver = function () {
var str = "<b>[CTRL a]</b> Select (or deselect) all pieces";
if (_root.key_ed_selAll == undefined) {
str = str + "\n(Can set an alternate key in the options menu)";
} else {
str = str + (("\n<b>[" + _root.codeName[_root.key_ed_selAll]) + "]</b> Alternate key for above");
}
_root.ideHelpTxt.setTxt(str);
};
selectAllBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
selectCoreBtn.onRelease = function () {
_root.editor_selectOb(_root.core);
};
selectCoreBtn.onRollOver = function () {
var str = "<b>[CTRL h]</b> Select the core";
if (_root.key_ed_selCore == undefined) {
str = str + "\n(Can set an alternate key in the options menu)";
} else {
str = str + (("\n <b>[" + _root.codeName[_root.key_ed_selCore]) + "]</b> Alternate key for above");
}
_root.ideHelpTxt.setTxt(str);
};
selectCoreBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
colourPicker.color_main.onRollOver = function () {
var str = "Pick a color to apply to the selected parts.";
_root.ideHelpTxt.setTxt(str);
};
colourPicker.color_main.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
}
if (loginOb.loggedIn) {
enableLogin();
} else if (login_so.data.username != null) {
editor_login(login_so.data.username, login_so.data.pw, false, true);
}
createEmptyMovieClip("enemies", d_allEnemies);
if (showFileMenu) {
editor_toggleFileMenuWin();
}
if (newDocument) {
var newcore = editor_attachPart("core", 400, 300, 0, 1, 1, null, d_e++);
editor_setCore(newcore);
currentLvlObject = {};
ed_levelOpen = true;
} else if ((loginOb.loggedIn and (loginOb.username == currentLvlObject.username)) or ((currentLvlObject.username == undefined) and (currentLvlObject.ID == undefined))) {
var i = 0;
while (i < currentLvlObject.code.length) {
if (currentLvlObject.code[i][7] == 0) {
var newcore = editor_attachPart.apply(_root, currentLvlObject.code[i]);
editor_setCore(newcore);
} else {
editor_attachPart.apply(_root, currentLvlObject.code[i]);
}
i++;
}
currentLvlObject.editor_gun = currentLvlObject.AI.shift();
currentLvlObject.editor_ai = currentLvlObject.AI;
currentLvlObject.editor_gun = currentLvlObject.editor_gun.substr(3);
var j = 0;
while (j < currentLvlObject.editor_ai.length) {
if (currentLvlObject.editor_ai[j][0] == undefined) {
currentLvlObject.editor_ai[j] = [currentLvlObject.editor_ai[j].substr(3)];
} else {
currentLvlObject.editor_ai[j][0] = currentLvlObject.editor_ai[j][0].substr(3);
}
j++;
}
ed_levelOpen = true;
} else if (!loginOb.loggedIn) {
messageTrace("You can only edit your own levels. If this is your level then try logging in now");
}
keyListener.onKeyDown = editor_detectKeys;
this.onEnterFrame = editorLoop;
this.onMouseUp = function () {
stopDrag();
library.selected[0]._x = Math.round(library.selected[0]._x);
library.selected[0]._y = Math.round(library.selected[0]._y);
};
ed_autoBackup_intervalID = setInterval(editor_localSave, 30000);
}
function editorLoop() {
editor_selectionFollow();
editor_refreshHierarchy();
}
function clearEditorMode() {
codeCount = 0;
removeMovieClip(enemies);
removeMovieClip(library);
removeMovieClip(output);
removeMovieClip(tools);
removeMovieClip(coreAIwindow);
removeMovieClip(hierarchyLine);
removeMovieClip(properties);
removeMovieClip(gallery);
removeMovieClip(messageWin);
removeMovieClip(saveAsWin);
removeMovieClip(textEdit);
keyListener.onKeyDown = null;
this.onEnterFrame = null;
this.onMouseDown = null;
this.onKeyDown = null;
this.onMouseMove = null;
d_e = 0;
ideHelpTxt.setTxt();
clearInterval(ed_autoBackup_intervalID);
ed_autoBackup_intervalID = null;
}
function editor_toMenu() {
getURL ("http://zetaflow.skylogic.ca", "_self");
}
function editor_attachPart(type, x, y, rotation, xscale, yscale, parent, me, colour) {
if (arguments.length == 1) {
var ob;
ob = _root.attachPart(type, 0, 0, 0, 1, 1, null, d_e++);
ob._x = _root._xmouse;
ob._y = _root._ymouse;
editor_click(ob);
ob.permaParent = false;
} else {
var ob;
if (me >= d_e) {
d_e = me + 1;
}
ob = _root.attachPart(type, x, y, rotation, xscale, yscale, parent, me, colour);
ob.permaParent = true;
}
ob.onPress = function () {
editor_click(this);
};
ob.onRelease = function () {
_x = Math.round(_x);
_y = Math.round(_y);
};
ob.onRollOver = function () {
if (library.com.advancedViewEnabled) {
var nameTxt = (("Name: " + this.link) + newline);
var parent = (this.parent + "");
parent = parent.substr(16);
nameTxt = nameTxt + ("Parent: " + parent);
} else {
var nameTxt = ((this.niceName != undefined) ? (this.niceName) : (this.link));
}
_root.ideHelpTxt.setTxt((nameTxt + "\nPart #") + this.me);
};
ob.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
return(ob);
}
function editor_click(btn) {
if (Key.isDown(16)) {
editor_selectOb(btn, true);
} else {
editor_selectOb(btn);
btn.startDrag();
}
}
function editor_selectionFollow() {
var deltaX = (library.selected[0]._x - ed_prevSelection[0]);
var deltaY = (library.selected[0]._y - ed_prevSelection[1]);
var deltaAngle = (library.selected[0]._rotation - ed_prevSelection[2]);
if (ed_prevSelection[3] == 0) {
var deltaXScale = 0;
} else if (ed_prevSelection[3] == undefined) {
var deltaXScale = 1;
} else {
var deltaXScale = (library.selected[0]._xscale / ed_prevSelection[3]);
}
if (ed_prevSelection[4] == 0) {
var deltaYScale = 1;
} else if (ed_prevSelection[4] == undefined) {
var deltaYScale = 1;
} else {
var deltaYScale = (library.selected[0]._yscale / ed_prevSelection[4]);
}
var deltaPermaParent = (ed_prevSelection[5] != library.selected[0].permaParent);
var deltaParent = (ed_prevSelection[6] != library.selected[0].parent);
var deltaTargetSelection = (ed_prevSelection[7] != library.selected[0]);
var i = 1;
while (i < library.selected.length) {
var ob = library.selected[i];
ob._x = ob._x + deltaX;
ob._y = ob._y + deltaY;
if (deltaAngle != 0) {
ob._rotation = ob._rotation + deltaAngle;
var xDist = (ob._x - library.selected[0]._x);
var yDist = (ob._y - library.selected[0]._y);
var angleInitial = Math.atan2(yDist, xDist);
var angleNew = (angleInitial + (deltaAngle * PI_180));
if (ob.ed_c == undefined) {
ob.ed_c = Math.sqrt((xDist * xDist) + (yDist * yDist));
}
var x = (Math.cos(angleNew) * ob.ed_c);
var y = (Math.sin(angleNew) * ob.ed_c);
ob._x = x + library.selected[0]._x;
ob._y = y + library.selected[0]._y;
}
ob._xscale = ob._xscale * deltaXScale;
ob._yscale = ob._yscale * deltaYScale;
if (deltaPermaParent) {
ob.permaParent = library.selected[0].permaParent;
}
if (((deltaParent and library.selected[0].permaParent) and (!existsInArray(library.selected[0].parent, library.selected))) and (!deltaTargetSelection)) {
ob.parent = library.selected[0].parent;
}
i++;
}
ed_prevSelection = [library.selected[0]._x, library.selected[0]._y, library.selected[0]._rotation, library.selected[0]._xscale, library.selected[0]._yscale, library.selected[0].permaParent, library.selected[0].parent, library.selected[0]];
}
function editor_selectOb(ob, addToGroup) {
if (addToGroup) {
if (!existsInArray(ob, library.selected)) {
library.selected.push(ob);
editor_highlight(ob, 0);
} else {
var i = 0;
while (i < library.selected.length) {
if (ob == library.selected[i]) {
if (i == 0) {
if (library.selected.length > 1) {
editor_selectOb(library.selected[1], false);
i = 1;
}
}
editor_unhighlight(ob);
library.selected.splice(i, 1);
}
i++;
}
}
} else if (existsInArray(ob, library.selected)) {
if (ob != library.selected[0]) {
var i = 1;
while (i < library.selected.length) {
library.selected[i].ed_c = undefined;
if (ob == library.selected[i]) {
var ii = i;
}
i++;
}
library.selected[ii] = library.selected[0];
library.selected[0] = ob;
ed_prevSelection = [library.selected[0]._x, library.selected[0]._y, library.selected[0]._rotation, library.selected._xscale[0], library.selected._yscale[0], library.selected[0].permaParent, library.selected[0]];
editor_highlight(library.selected[ii], 0);
editor_highlight(ob, 1);
}
} else {
var i = 0;
while (i < library.selected.length) {
library.selected[i].ed_c = undefined;
library.selected[i].dragging = null;
editor_unhighlight(library.selected[i]);
i++;
}
library.selected = [];
library.selected.push(ob);
editor_highlight(ob, 1);
ed_prevSelection = [library.selected[0]._x, library.selected[0]._y, library.selected[0]._rotation, library.selected._xscale[0], library.selected._yscale[0], library.selected[0].permaParent, library.selected[0]];
}
}
function editor_convertToGame() {
editor_make_AI_code();
clearEditorMode();
if (currentLvlObject.name == undefined) {
currentLvlObject.name = "ZetaFlow-untitled";
}
gameMode(currentLvlObject);
}
function editor_detectKeys() {
if (Key.isDown(16)) {
if (Key.isDown(key_ed_rotateLeft1)) {
library.selected[0]._rotation = library.selected[0]._rotation - 45;
}
if (Key.isDown(key_ed_rotateRight1)) {
library.selected[0]._rotation = library.selected[0]._rotation + 45;
}
if (Key.isDown(key_ed_left) or Key.isDown(37)) {
library.selected[0]._x = library.selected[0]._x - 10;
}
if (Key.isDown(key_ed_right) or Key.isDown(39)) {
library.selected[0]._x = library.selected[0]._x + 10;
}
if (Key.isDown(key_ed_up) or Key.isDown(38)) {
library.selected[0]._y = library.selected[0]._y - 10;
}
if (Key.isDown(key_ed_down) or Key.isDown(40)) {
library.selected[0]._y = library.selected[0]._y + 10;
}
} else {
if (Key.isDown(17) and Key.isDown(83)) {
tools.saveAsBtn.onPress();
return(undefined);
}
if (Key.isDown(17) and Key.isDown(192)) {
attachMovie("editor.output", "output", d_output);
output._x = 250;
output._y = 250;
with (output) {
bar.onPress = function () {
startDrag();
};
close.onRelease = function () {
this._parent._visible = false;
};
refresh.onRelease = function () {
_root.editor_showOutput();
};
}
_root.editor_showOutput();
return(undefined);
}
if ((Key.isDown(17) and Key.isDown(68)) or Key.isDown(key_ed_duplicate)) {
editor_duplicate();
return(undefined);
}
if ((Key.isDown(17) and Key.isDown(72)) or Key.isDown(key_ed_selCore)) {
editor_selectOb(_root.core);
return(undefined);
}
if ((Key.isDown(17) and Key.isDown(65)) or Key.isDown(key_ed_selAll)) {
editor_selectAll();
return(undefined);
}
if (Key.isDown(key_ed_delete) or Key.isDown(46)) {
editor_deleteSelection();
return(undefined);
}
if (Key.isDown(key_ed_lock)) {
if (library.selected[0].permaParent) {
library.selected[0].permaParent = false;
} else {
library.selected[0].permaParent = true;
}
return(undefined);
}
if (Key.isDown(191)) {
editor_toggleHelper();
}
if (Key.isDown(key_ed_nextParent)) {
editor_tabToParent(1);
}
if (Key.isDown(key_ed_prevParent)) {
editor_tabToParent(-1);
}
if (Key.isDown(key_ed_xscale)) {
editor_mirror(true, false);
}
if (Key.isDown(key_ed_yscale)) {
editor_mirror(false, true);
}
if (Key.isDown(key_ed_xyscale)) {
editor_mirror(true, true);
}
if (Key.isDown(key_pause)) {
editor_convertToGame();
}
if (Key.isDown(112)) {
tools.tutorialBtn.onPress();
}
if (Key.isDown(113)) {
tools.coreAIBtn.onPress();
}
if (Key.isDown(114)) {
tools.textEditBtn.onPress();
}
if (Key.isDown(76)) {
tools.loginBtn.onPress();
}
if (Key.isDown(key_ed_rotateLeft1)) {
library.selected[0]._rotation = library.selected[0]._rotation - 1;
}
if (Key.isDown(key_ed_rotateRight1)) {
library.selected[0]._rotation = library.selected[0]._rotation + 1;
}
if (Key.isDown(key_ed_rotateLeft45)) {
library.selected[0]._rotation = library.selected[0]._rotation - 45;
}
if (Key.isDown(key_ed_rotateRight45)) {
library.selected[0]._rotation = library.selected[0]._rotation + 45;
}
if (Key.isDown(key_ed_left) or Key.isDown(37)) {
library.selected[0]._x = library.selected[0]._x - 1;
}
if (Key.isDown(key_ed_right) or Key.isDown(39)) {
library.selected[0]._x = library.selected[0]._x + 1;
}
if (Key.isDown(key_ed_up) or Key.isDown(38)) {
library.selected[0]._y = library.selected[0]._y - 1;
}
if (Key.isDown(key_ed_down) or Key.isDown(40)) {
library.selected[0]._y = library.selected[0]._y + 1;
}
if (Key.isDown(77)) {
editor_toggleFileMenuWin();
}
}
}
function editor_make_AI_code() {
currentLvlObject.AI = [];
currentLvlObject.AI[0] = currentLvlObject.editor_gun;
currentLvlObject.AI = currentLvlObject.AI.concat(removeWhitespace(currentLvlObject.editor_ai));
var j = 0;
while (j < currentLvlObject.AI.length) {
if (((currentLvlObject.AI[j] != undefined) and (currentLvlObject.AI[j] != "")) and (currentLvlObject[j] != newline)) {
if (currentLvlObject.AI[j][0] == undefined) {
if (currentLvlObject.AI[j].substr(0, 3) != "AI_") {
currentLvlObject.AI[j] = "AI_" + currentLvlObject.AI[j];
}
} else if (currentLvlObject.AI[j][0].substr(0, 3) != "AI_") {
currentLvlObject.AI[j][0] = "AI_" + currentLvlObject.AI[j][0];
}
}
j++;
}
_root.codeCount = 0;
currentLvlObject.code = [];
currentLvlObject.code[0] = ["core", core._x, core._y, core._rotation, core._xscale / 100, core._yscale / 100, -1, 0, (core.colR + core.colG) + core.colB];
editor_createChildList();
loopThrough(core, editor_getCode);
currentLvlObject.code = removeWhitespace(currentLvlObject.code);
_root.codeCount = null;
}
function editor_createChildList() {
for (var h in enemies) {
enemies[h].children = [];
}
for (var i in enemies) {
var ob = enemies[i];
ob.parent.children.push(ob);
}
}
function editor_getCode(ob) {
var parent = ob.parent;
var x = (ob._x - parent._x);
var y = (ob._y - parent._y);
parent = parent + "";
parent = parent.substr(16);
codeCount++;
currentLvlObject.code[codeCount] = [ob.link, x, y, ob._rotation, ob._xscale / 100, ob._yscale / 100, parent, ob.me, (ob.colR + ob.colG) + ob.colB];
}
function editor_viewHierarchy() {
createEmptyMovieClip("hierarchyLine", d_hierarchyLines);
for (var i in enemies) {
var ob = enemies[i];
if (ob.parent != null) {
if (!ob.permaParent) {
hierarchyLine.lineStyle(1, "0xFFCC33", 90);
} else {
hierarchyLine.lineStyle(1, "0xFF1111", 90);
}
hierarchyLine.moveTo(ob._x, ob._y);
hierarchyLine.lineTo(ob.parent._x, ob.parent._y);
hierarchyLine.d++;
hierarchyLine.attachMovie("b.round", "end_" + hierarchyLine.d, hierarchyLine.d);
hierarchyLine["end_" + hierarchyLine.d]._alpha = 20;
hierarchyLine["end_" + hierarchyLine.d]._x = ob._x;
hierarchyLine["end_" + hierarchyLine.d]._y = ob._y;
hierarchyLine.d++;
hierarchyLine.attachMovie("b.square", "start_" + hierarchyLine.d, hierarchyLine.d);
hierarchyLine["start_" + hierarchyLine.d]._alpha = 30;
hierarchyLine["start_" + hierarchyLine.d]._x = ob.parent._x;
hierarchyLine["start_" + hierarchyLine.d]._y = ob.parent._y;
hierarchyLine["start_" + hierarchyLine.d]._rotation = (Math.atan2(ob.parent._y - ob._y, ob.parent._x - ob._x) / PI_180) + 180;
}
}
}
function editor_toggleHelper() {
if (hierarchyLine == null) {
editor_viewHierarchy();
tools.helperMC.gotoAndStop(2);
} else {
hierarchyLine.removeMovieClip();
tools.helperMC.gotoAndStop(1);
}
}
function editor_createHierarchy(selectedOb) {
if (!selectedOb.permaParent) {
var closestDist = 999999;
var closestOb = null;
for (var i in enemies) {
var ob = enemies[i];
var isGun = false;
var k = 0;
while (k < gunArray.length) {
if (gunArray[k] == ob) {
isGun = true;
}
k++;
}
if ((ob != selectedOb) and (selectedOb != core)) {
var xDist = (ob._x - selectedOb._x);
var yDist = (ob._y - selectedOb._y);
var dist = Math.sqrt((xDist * xDist) + (yDist * yDist));
if (dist < closestDist) {
var linked = false;
if (ob == core) {
linked = true;
} else {
var theparent = ob.parent;
var loop = true;
while (loop) {
if (theparent == selectedOb) {
linked = false;
loop = false;
break;
}
if (theparent != undefined) {
if (theparent == core) {
linked = true;
loop = false;
}
} else {
linked = false;
loop = false;
}
theparent = theparent.parent;
}
}
if (linked and (!isGun)) {
closestDist = dist;
closestOb = ob;
}
}
}
}
if ((selectedOb != core) and (closestOb != null)) {
selectedOb.parent = closestOb;
}
}
}
function editor_tabToParent(dir, selectedOb) {
if (selectedOb == undefined) {
var selectedOb = library.selected[0];
}
if (selectedOb != core) {
var prevOb = null;
var getNextOb = false;
for (var i in enemies) {
if (selectedOb.parent == enemies[i]) {
if (dir == -1) {
getNextOb = true;
continue;
}
if (dir == 1) {
if (prevOb == null) {
waitForLast = true;
continue;
}
selectedOb.parent = prevOb;
selectedOb.permaParent = true;
if (!editor_checkCoreInAncestry(selectedOb.parent, selectedOb)) {
editor_tabToParent(dir, selectedOb);
}
return(undefined);
}
} else {
if (getNextOb) {
if (selectedOb == enemies[i]) {
continue;
}
selectedOb.parent = enemies[i];
selectedOb.permaParent = true;
getNextOb = false;
if (!editor_checkCoreInAncestry(selectedOb.parent, selectedOb)) {
editor_tabToParent(dir, selectedOb);
}
return(undefined);
}
if (enemies[i] != selectedOb) {
prevOb = enemies[i];
}
}
}
if (getNextOb) {
for (var i in enemies) {
if (selectedOb == enemies[i]) {
// unexpected jump
}
selectedOb.parent = enemies[i];
selectedOb.permaParent = true;
if (!editor_checkCoreInAncestry(selectedOb.parent, selectedOb)) {
editor_tabToParent(dir, selectedOb);
}
return(undefined);
}
}
if (waitForLast) {
if (prevOb != null) {
selectedOb.parent = prevOb;
selectedOb.permaParent = true;
if (!editor_checkCoreInAncestry(selectedOb.parent, selectedOb)) {
editor_tabToParent(dir, selectedOb);
}
return(undefined);
}
}
selectedOb.parent = core;
selectedOb.permaParent = true;
}
}
function editor_checkCoreInAncestry(ob, startOb) {
if (ob == core) {
return(true);
}
if ((ob == startOb) or (ob == undefined)) {
return(false);
}
return(editor_checkCoreInAncestry(ob.parent, startOb));
}
function editor_getStringFromLevel() {
editor_make_AI_code();
var saveStr = "";
saveStr = saveStr + currentLvlObject.AI[0];
var i = 1;
while (i < currentLvlObject.AI.length) {
if (((((((currentLvlObject.AI[i] != undefined) and (currentLvlObject.AI[i] != "")) and (currentLvlObject.AI[i][0] != "")) and (currentLvlObject.AI[i] != newline)) and (currentLvlObject.AI[i][0] != newline)) and (currentLvlObject.AI[i] != "\t")) and (currentLvlObject.AI[i][0] != "\t")) {
saveStr = saveStr + "|";
var j = 0;
while (j < currentLvlObject.AI[i].length) {
if (currentLvlObject.AI[i][j] != undefined) {
saveStr = saveStr + currentLvlObject.AI[i][j];
if (j < (currentLvlObject.AI[i].length - 1)) {
saveStr = saveStr + ",";
}
}
j++;
}
}
i++;
}
saveStr = saveStr + "<>";
var k = 0;
while (k < currentLvlObject.code.length) {
if (currentLvlObject.code[k] != undefined) {
if (k != 0) {
saveStr = saveStr + "|";
}
var l = 0;
while (l < currentLvlObject.code[k].length) {
saveStr = saveStr + currentLvlObject.code[k][l];
if (l < (currentLvlObject.code[k].length - 1)) {
saveStr = saveStr + ",";
}
l++;
}
}
k++;
}
return(saveStr);
}
function editor_getLevelFromString(str) {
str = removeWhitespace(str);
var strArray = str.split("<>");
var levelAI = strArray[0].split("|");
var levelCode = strArray[1].split("|");
var i = 0;
while (i < levelAI.length) {
if (levelAI[i].indexOf(",") != -1) {
levelAI[i] = levelAI[i].split(",");
}
i++;
}
var i = 0;
while (i < levelCode.length) {
levelCode[i] = levelCode[i].split(",");
i++;
}
level = {AI:levelAI, code:levelCode};
return(level);
}
function removeWhitespace(arr) {
if (typeof(arr) == "object") {
var i = 0;
while (i < arr.length) {
arr[i] = removeWhitespace(arr[i], canDelete);
if ((arr[i] == "") or (arr[i].length == 0)) {
arr.splice(i, 1);
}
i++;
}
} else if (typeof(arr) == "string") {
arr = removeStringWhitespace(arr);
}
return(arr);
}
function removeStringWhitespace(str) {
var strArray = [];
strArray = str.split(String.fromCharCode(13));
var newStr = "";
var i = 0;
while (i < strArray.length) {
newStr = newStr + strArray[i];
i++;
}
str = newStr;
newStr = "";
strArray = [];
strArray = str.split(newline);
var newStr;
var i = 0;
while (i < strArray.length) {
newStr = newStr + strArray[i];
i++;
}
str = newStr;
newStr = "";
strArray = [];
strArray = str.split(newline);
var newStr;
var i = 0;
while (i < strArray.length) {
newStr = newStr + strArray[i];
i++;
}
str = newStr;
newStr = "";
strArray = [];
strArray = str.split(" ");
var newStr;
var i = 0;
while (i < strArray.length) {
newStr = newStr + strArray[i];
i++;
}
str = newStr;
newStr = "";
strArray = [];
strArray = str.split("\t");
var newStr;
var i = 0;
while (i < strArray.length) {
newStr = newStr + strArray[i];
i++;
}
str = newStr;
newStr = "";
strArray = [];
strArray = str.split("\t");
var newStr;
var i = 0;
while (i < strArray.length) {
newStr = newStr + strArray[i];
i++;
}
return(newStr);
}
function editor_save(nameInput, typeData, linkInput, hidden) {
if (loginOb.loggedIn and (loginOb.username != null)) {
saveAsWin.gotoAndStop(2);
varsIn = new LoadVars();
varsOut = new LoadVars();
varsOut.username = loginOb.username;
varsOut.pw = loginOb.pw;
if ((nameInput.length == 0) or (nameInput.length == undefined)) {
saveAsWin.gotoAndStop(1);
saveAsWin.outputTxt = "You must provide a name.";
return(undefined);
}
if (linkInput < 0) {
saveAsWin.gotoAndStop(1);
saveAsWin.outputTxt = "Invalid link ID";
return(undefined);
}
varsOut.link = (currentLvlObject.link = linkInput);
varsOut.hidden = (currentLvlObject.hidden = hidden);
varsOut.name = (currentLvlObject.name = nameInput);
varsOut.type = (currentLvlObject.type = typeData);
varsOut.level = _root.editor_getStringFromLevel();
if (currentLvlObject.lives >= -1) {
varsOut.lives = currentLvlObject.lives;
} else {
varsOut.lives = -1;
}
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/saveLevel.php", varsIn, "POST");
varsIn.onLoad = function (success) {
if (success) {
if (varsIn.success == "true") {
messageTrace(varsIn.result, "0x00FF00");
saveAsWin.close.onRelease();
} else {
saveAsWin.gotoAndStop(1);
saveAsWin.outputTxt = varsIn.result;
}
} else {
saveAsWin.gotoAndStop(1);
saveAsWin.outputTxt = "Something didn't work :( Perhaps try again.";
}
};
} else {
saveAsWin.outputTxt = "Please login first";
}
}
function editor_localSave() {
if (!fileMenuWin._visible) {
editorBackup_so.data.level = _root.editor_getStringFromLevel();
editorBackup_so.data.username = currentLvlObject.username;
editorBackup_so.data.name = currentLvlObject.name;
editorBackup_so.data.ID = currentLvlObject.ID;
editorBackup_so.data.lives = currentLvlObject.lives;
editorBackup_so.data.rating = currentLvlObject.rating;
editorBackup_so.data.link = currentLvlObject.link;
editorBackup_so.data.type = currentLvlObject.type;
editorBackup_so.data.hidden = currentLvlObject.hidden;
editorBackup_so.flush();
}
}
function editor_localLoad() {
var tempLvlOb = editor_getLevelFromString(editorBackup_so.data.level);
tempLvlOb.username = editorBackup_so.data.username;
tempLvlOb.name = editorBackup_so.data.name;
tempLvlOb.ID = editorBackup_so.data.ID;
tempLvlOb.lives = editorBackup_so.data.lives;
tempLvlOb.rating = editorBackup_so.data.rating;
tempLvlOb.link = editorBackup_so.data.link;
tempLvlOb.type = editorBackup_so.data.type;
tempLvlOb.hidden = editorBackup_so.data.hidden;
_root.currentLvlObject = tempLvlOb;
clearEditorMode();
editorMode(false, false);
}
function editor_register(usernameInput, pwInput, emailInput) {
if (registerWin._currentframe != 2) {
registerWin.gotoAndStop(2);
varsIn = new LoadVars();
varsOut = new LoadVars();
if ((usernameInput.length == 0) or (usernameInput.length == undefined)) {
registerWin.gotoAndStop(4);
registerWin.outputTxt = "You must provide a name for yourself.";
return(undefined);
}
varsOut.username = usernameInput;
varsOut.pw = pwInput;
varsOut.email = emailInput;
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/newAccount.php", varsIn, "POST");
varsIn.onLoad = function (success) {
if (success) {
if (varsIn.success == "true") {
loginOb.username = varsOut.username;
loginOb.pw = varsOut.pw;
loginWin.usernameInput = loginOb.username;
loginWin.pwInput = loginOb.pw;
loginWin.outputTxt = "Success! You now exist. Click login to login with your new account";
registerWin.removeMovieClip();
} else {
registerWin.gotoAndStop(4);
registerWin.outputTxt = varsIn.result;
}
} else {
registerWin.gotoAndStop(4);
registerWin.outputTxt = "Something didn't work :( Perhaps try again.";
}
};
}
}
function editor_login(usernameInput, pwInput, rememberMe, fromSave) {
varsIn = new LoadVars();
varsOut = new LoadVars();
if ((usernameInput.length == 0) or (usernameInput.length == undefined)) {
loginWin.outputTxt = "You must login (click register if you don't have a username yet)";
return(undefined);
}
varsOut.username = usernameInput;
varsOut.pw = pwInput;
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/login.php", varsIn, "POST");
varsIn.onLoad = function (success) {
if (success) {
if (varsIn.success == "true") {
if (!fromSave) {
messageTrace("Welcome. You can now save, edit, and delete your levels", "0x00FF00");
}
loginOb.username = varsOut.username;
loginOb.pw = varsOut.pw;
loginOb.loggedIn = true;
loginWin._visible = false;
loginWin.removeMovieClip();
editor_autoKeyListener();
enableLogin();
if (rememberMe) {
login_so.data.username = loginOb.username;
login_so.data.pw = loginOb.pw;
}
if (!ed_levelOpen) {
if (currentLvlObject.username == loginOb.username) {
clearEditorMode();
editorMode(false, false);
}
} else {
currentLvlObject.username = loginOb.username;
}
} else {
_root.loginWin.outputTxt = "Login failed. Click register if you don't have an username yet";
}
} else {
_root.loginWin.outputTxt = "Something didn't work :( Perhaps try again.";
}
};
}
function enableLogin() {
with (tools) {
loginMC.gotoAndStop(2);
loginBtn.onPress = function () {
_root.editor_openGallery();
};
loginBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[L]</b> View, edit, or delete your Levels.");
};
loginBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
}
if (fileMenuWin._visible) {
with (fileMenuWin) {
loginMC.gotoAndStop(2);
loginBtn.onPress = function () {
_root.editor_openGallery();
};
loginBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("View, edit, or delete your Levels.");
};
loginBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
}
}
}
function editor_mirror(horiz, vert, ob) {
if (ob == undefined) {
var i = 0;
while (i < library.selected.length) {
editor_mirror(horiz, vert, library.selected[i]);
i++;
}
} else {
oldob = {};
oldob._x = ob._x;
oldob._y = ob._y;
oldob._xscale = ob._xscale;
oldob._yscale = ob._yscale;
oldob._rotation = ob._rotation;
if (!ob.isGun) {
ob._rotation = -oldob._rotation;
if (horiz) {
ob._x = (core._x * 2) - oldob._x;
ob._xscale = oldob._xscale * -1;
} else {
ob._x = oldob._x;
ob._xscale = oldob._xscale;
}
if (vert) {
ob._y = (core._y * 2) - oldob._y;
ob._yscale = oldob._yscale * -1;
} else {
ob._y = oldob._y;
ob._yscale = oldob._yscale;
}
} else {
ob._xscale = oldob._xscale;
ob._yscale = oldob._yscale;
if (horiz and vert) {
ob._rotation = oldob._rotation + 180;
} else if (horiz) {
ob._rotation = -oldob._rotation;
} else if (vert) {
ob._rotation = 180 - oldob._rotation;
}
if (horiz) {
ob._x = (core._x * 2) - oldob._x;
} else {
ob._x = oldob._x;
}
if (vert) {
ob._y = (core._y * 2) - oldob._y;
} else {
ob._y = oldob._y;
}
}
ob.permaParent = false;
ed_prevSelection = [library.selected[0]._x, library.selected[0]._y, library.selected[0]._rotation, library.selected[0]._xscale, library.selected[0]._yscale, library.selected[0].permaParent, library.selected[0].parent, library.selected[0]];
this.onMouseUp();
}
}
function editor_duplicate(ob) {
if ((library.selected != null) and (ob == undefined)) {
var i = 0;
while (i < library.selected.length) {
editor_duplicate(library.selected[i]);
i++;
}
} else if (ob != undefined) {
var newob = editor_attachPart(ob.link, ob._x, ob._y, ob._rotation, ob._xscale / 100, ob._yscale / 100, null, d_e++, (ob.colR + ob.colG) + ob.colB);
newob.permaParent = false;
editor_createHierarchy(newob);
this.onMouseUp();
}
}
function editor_attachRegister() {
_root.ideHelpTxt.setTxt();
attachMovie("editor.register", "registerWin", d_register);
registerWin._x = (STAGE_W / 2) - (registerWin._width / 2);
registerWin._y = 400;
with (registerWin) {
bar.onPress = function () {
startDrag();
};
close.onRelease = function () {
this._parent._visible = false;
_root.keyListener.onKeyDown = _root.editor_detectKeys;
};
ok.onRelease = function () {
_root.editor_register(usernameInput, pwInput, emailInput);
};
}
}
function editor_showOutput() {
editor_make_AI_code();
output.txt = "";
output.txt = output.txt + "var level# = new Object();";
output.txt = output.txt + "\nlevel#.init = function () {";
output.txt = output.txt + (("\n\tlives=" + currentLvlObject.lives) + ";");
output.txt = output.txt + "\n\tlifeCount.update();";
output.txt = output.txt + "\n}";
output.txt = output.txt + "\nLevel#.AI = [\n";
output.txt = output.txt + (("\t\"" + currentLvlObject.AI[0]) + "\"");
var i = 1;
while (i < currentLvlObject.AI.length) {
if (((currentLvlObject.AI[i] != undefined) and (currentLvlObject.AI[i] != "")) and (currentLvlObject.AI[i][0] != "")) {
output.txt = output.txt + ",\n\t[";
var j = 0;
while (j < currentLvlObject.AI[i].length) {
if (currentLvlObject.AI[i][j] != undefined) {
var str = (isNaN(Number(currentLvlObject.AI[i][j])) ? true : false);
if (str) {
output.txt = output.txt + "\"";
}
output.txt = output.txt + currentLvlObject.AI[i][j];
if (str) {
output.txt = output.txt + "\"";
}
if (j < (currentLvlObject.AI[i].length - 1)) {
output.txt = output.txt + ", ";
}
}
j++;
}
output.txt = output.txt + "]";
}
i++;
}
output.txt = output.txt + "\n];\n\n";
output.txt = output.txt + "level#.code = [\n\t[";
var k = 0;
while (k < currentLvlObject.code.length) {
if (currentLvlObject.code[k] != undefined) {
if (k != 0) {
output.txt = output.txt + ",\n\t[";
}
var l = 0;
while (l < currentLvlObject.code[k].length) {
var str = ((typeof(currentLvlObject.code[k][l]) == "string") ? true : false);
if (str) {
output.txt = output.txt + "\"";
}
output.txt = output.txt + currentLvlObject.code[k][l];
if (str) {
output.txt = output.txt + "\"";
}
if (l < (currentLvlObject.code[k].length - 1)) {
output.txt = output.txt + ", ";
}
l++;
}
output.txt = output.txt + "]";
}
k++;
}
output.txt = output.txt + "\n];";
}
function editor_toggleCoreAIwindow() {
if (coreAIwindow == undefined) {
attachMovie("editor.coreAI", "coreAIwindow", d_coreAIwindow);
coreAIwindow._visible = false;
coreAIwindow._x = 300;
coreAIwindow._y = 200;
coreAIwindow.onLoad = function () {
this.comboboxHandler = function () {
_root.currentLvlObject.editor_gun = this.coreGunAI_combobox.getValue();
};
this.applyChanges = function () {
var lineArray = [];
var elementArray = [];
var txt = this.inputTxt;
while (txt.indexOf(" ") != -1) {
var n = txt.indexOf(" ");
var front = txt.substring(0, n);
var back = txt.substring(n + 1);
txt = front + back;
}
lineArray = txt.split(String.fromCharCode(13));
var temptxt;
var a = 0;
while (a < lineArray.length) {
temptxt = temptxt + (lineArray[a] + newline);
a++;
}
lineArray = temptxt.split(newline);
var b = 0;
while (b < lineArray.length) {
if (lineArray[b] == "") {
lineArray.splice(b, 1);
}
b++;
}
var i = 0;
while (i < lineArray.length) {
elementArray[i] = lineArray[i].split(",");
i++;
}
_root.currentLvlObject.editor_ai = elementArray;
_root.currentLvlObject.lives = this.livesInput;
};
this.insert = function (str) {
this.inputTxt = this.inputTxt + str;
this.scrollBar.onTextChanged();
this.scrollBar.setScrollPosition(this.scrollBar.maxPos);
};
this.dummy.useHandCursor = false;
var n = 0;
while (n < this.coreGunAI_combobox.getLength()) {
if (this.coreGunAI_combobox.getItemAt(n).data == _root.currentLvlObject.editor_gun) {
this.coreGunAI_combobox.setSelectedIndex(n);
break;
}
n++;
}
this.livesInput = _root.currentLvlObject.lives;
this.inputTxt = "";
var i = 0;
while (i < _root.currentLvlObject.editor_ai.length) {
this.inputTxt = this.inputTxt + (_root.currentLvlObject.editor_ai[i] + newline);
i++;
}
this.scrollBar.onTextChanged();
this.scrollBar.setScrollPosition(this.scrollBar.maxPos);
this.bar.onPress = function () {
this._parent.startDrag();
};
this.close.onRelease = function () {
this._parent._visible = false;
_root.editor_autoKeyListener();
this._parent.applyChanges();
};
this.attachMenuList = function (x, y) {
if (this._parent.commandList_list == undefined) {
var c = this.attachMovie("FListBoxSymbol", "commandList_list", 4);
c._y = y;
c._x = x;
c.onMouseUp = function () {
if ((((this._xmouse < 0) || (this._ymouse < 0)) || (this._xmouse > this._width)) || (this._ymouse > this._height)) {
removeMovieClip(this);
}
};
c.setChangeHandler("menuHandler", this);
return(true);
}
removeMovieClip(this.commandList_list);
return(false);
};
this.commandListCoreBtn.onRelease = function () {
var added = this._parent.attachMenuList(this._x, this._y + this._height);
if (added) {
with (this._parent.commandList_list) {
setRowCount(9);
setWidth(200);
setAutoHideScrollBar(true);
addItem("Random Waypoints", "randomWaypoints, [SPEED]");
addItem("Waypoints", "waypoints, LOOP(1 or 0), SPEED, X, Y, [X, Y]");
addItem("Follow Ship", "followShip, [SPEED]");
addItem("Random Rotate", "randomRotate, [SPEED]");
addItem("Rotate toward ship", "rotateToShip, [SPEED]");
addItem("Gun: Double", "coreGun_double");
addItem("Gun: Spread", "coreGun_spread");
addItem("Gun: 4 Way, 2 Shot", "coreGun_4way_2shot");
addItem("Gun: Twin Rapid", "coreGun_twinRapid");
}
}
};
this.commandListPartsBtn.onRelease = function () {
var added = this._parent.attachMenuList(this._x, this._y + this._height);
if (added) {
with (this._parent.commandList_list) {
setRowCount(8);
setWidth(200);
setAutoHideScrollBar(true);
addItem("Rotate", "rotatePart, PART#, SPEED, [MIN_ANGLE], [MAX_ANGLE], [START_ANGLE]");
addItem("Rotate to ship", "rotatePartToShip, PART#, [MORE_PART#]");
addItem("Invincible", "makeInvincible, PART#, [MORE_PART#]");
addItem("Vulnerable", "makeVulnerable, PART#, [MORE_PART#]");
addItem("Disable Gun", "disableGun, PART#, [MORE_PART#]");
addItem("Enable Gun", "enableGun, PART#, [MORE_PART#]");
addItem("Destroy", "destroy, PART#, [MORE_PART#]");
addItem("Change colour", "col, HEX_COLOUR, PART#, [MORE_PART#]");
}
}
};
this.commandListAdvancedBtn.onRelease = function () {
var added = this._parent.attachMenuList(this._x, this._y + this._height);
if (added) {
with (this._parent.commandList_list) {
setRowCount(4);
setWidth(200);
setAutoHideScrollBar(true);
addItem("Death Trigger > Any Command", "makeTrigger, death, SOURCE_PART#, ANY_COMMAND");
addItem("Time Trigger > Any Command", "makeTrigger, time, START_FRAME, ANY_COMMAND");
addItem("Repeating Trigger > Any Command", "makeTrigger, timeRepeat, START_FRAME, REPEAT_AFTER_FRAMES, ANY_COMMAND");
addItem("Stop > Repeating Command", "stop, ANY_REPEATING_COMMAND");
}
}
};
this.menuHandler = function (c) {
this.insert(newline + c.getValue());
c.removeMovieClip();
};
};
}
if (coreAIwindow._visible) {
coreAIwindow._visible = false;
} else {
_root.ideHelpTxt.setTxt();
coreAIwindow._visible = true;
}
editor_autoKeyListener();
}
function editor_toggleSaveAsWin() {
if (saveAsWin == undefined) {
attachMovie("editor.saveAs", "saveAsWin", d_saveAs);
saveAsWin._visible = false;
saveAsWin._x = (STAGE_W / 2) - (saveAsWin._width / 2);
saveAsWin._y = (STAGE_H / 2) - (saveAsWin._height / 2);
saveAsWin.outputTxt = "Offensive text/graphics are not allowed and will be removed.";
with (saveAsWin) {
bar.onPress = function () {
startDrag();
};
close.onRelease = function () {
this._parent._visible = false;
_root.keyListener.onKeyDown = _root.editor_detectKeys;
};
saveBtn.onRelease = function () {
_root.editor_save(nameInput, typeData, linkInput, hidden);
};
browseBtn.onRelease = function () {
_root.editor_toggleGetIDWin();
};
}
}
if (_root.saveAsWin._visible) {
_root.saveAsWin._visible = false;
} else if (loginOb.loggedIn) {
saveAsWin.gotoAndStop(1);
saveAsWin.nameInput = _root.currentLvlObject.name;
saveAsWin.linkInput = _root.currentLvlObject.link;
if (currentLvlObject.type != undefined) {
saveAsWin["radio_" + currentLvlObject.type].setState(true);
} else {
saveAsWin.radio_.setState(true);
}
saveAsWin.typeData = saveAsWin.radioGroup.getData();
if (currentLvlObject.hidden == "1") {
saveAsWin.visibilityGroup_1.setState(true);
} else {
saveAsWin.visibilityGroup_0.setState(true);
}
saveAsWin.hidden = saveAsWin.visibilityGroup.getData();
saveAsWin._visible = true;
_root.ideHelpTxt.setTxt();
} else {
editor_toggleLoginWin();
messageTrace("Please login here before saving your level");
messageWin._y = (loginWin._y - messageWin._height) - 20;
}
editor_autoKeyListener();
}
function editor_toggleLoginWin() {
if (loginWin == undefined) {
attachMovie("editor.login", "loginWin", d_login);
loginWin._visible = false;
loginWin._x = (STAGE_W / 2) - (loginWin._width / 2);
loginWin._y = (STAGE_H / 2) - (loginWin._height / 2);
with (loginWin) {
bar.onPress = function () {
startDrag();
};
close.onRelease = function () {
_root.editor_toggleLoginWin();
};
loginBtn.onRelease = function () {
outputTxt = "Communicating, please wait...";
_root.editor_login(usernameInput, pwInput, rememberMe);
};
registerBtn.onRelease = function () {
_root.editor_attachRegister();
};
registerBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Free registration is required to save levels.");
};
registerBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
}
}
if (loginWin._visible) {
loginWin._visible = false;
} else {
_root.ideHelpTxt.setTxt();
loginWin._visible = true;
}
editor_autoKeyListener();
}
function editor_setCore(ob) {
_root.core = ob;
}
function editor_refreshHierarchy(ob) {
if (hierarchyLine != null) {
editor_viewHierarchy();
}
if (ob == undefined) {
var ob = library.selected[0];
}
editor_createHierarchy(ob);
}
function editor_deleteSelection() {
var i = 0;
while (i < library.selected.length) {
if (library.selected[i] != core) {
editor_createChildList();
var childrenTemp = library.selected[i].children;
var parentTemp = library.selected[i].parent;
removeMovieClip(library.selected[i]);
var j = 0;
while (j < childrenTemp.length) {
if (childrenTemp[j].permaParent) {
childrenTemp[j].parent = parentTemp;
} else {
editor_refreshHierarchy(childrenTemp[j]);
}
j++;
}
} else {
resetcol = new Color(library.selected[i]);
resetColorTransform = {ra:"100", ga:"100", ba:"100", aa:"100"};
resetcol.setTransform(resetColorTransform);
}
i++;
}
ed_prevSelection = [];
library.selected = [];
editor_selectOb(core);
}
function editor_selectAll() {
editor_selectOb(core);
for (var i in enemies) {
if (enemies[i] != core) {
editor_selectOb(enemies[i], true);
}
}
}
function editor_openGallery() {
if ((loginOb.username != undefined) and loginOb.loggedIn) {
if (gallery == undefined) {
attachMovie("editor.gallery", "gallery", d_gallery);
gallery._x = (STAGE_W / 2) - (gallery._width / 2);
gallery._y = (STAGE_H / 2) - (gallery._height / 2);
gallery.xmlData = [];
ideHelpTxt.setTxt();
with (gallery) {
var levelsXML = new XML();
var varsOut = new LoadVars();
varsOut.username = loginOb.username;
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/getLevelsList.php", levelsXML);
levelsXML.ignoreWhitespace = true;
levelsXML.onLoad = function (success) {
if (success) {
_root.gallery.levelsListBox.removeAll();
var levels = this.firstChild;
var i = 0;
while (i < levels.childNodes.length) {
var level = levels.childNodes[i];
_root.gallery.xmlData.push([level.childNodes[0].firstChild.nodeValue]);
var label = level.childNodes[0].firstChild.nodeValue;
label = label + ((level.childNodes[1].firstChild.nodeValue != undefined) ? (" -- TYPE " + level.childNodes[1].firstChild.nodeValue) : "");
label = label + (" -- PLAYS " + level.childNodes[2].firstChild.nodeValue);
label = label + (", WINS " + level.childNodes[3].firstChild.nodeValue);
label = label + (" -- " + level.childNodes[4].firstChild.nodeValue);
label = label + ((level.childNodes[7].firstChild.nodeValue == 1) ? " -- HIDDEN" : " -- PUBLIC");
_root.gallery.levelsListBox.addItem(label, i);
i++;
}
} else {
_root.gallery.levelsListBox.addItem("Error Connecting.");
_root.gallery.levelsListBox.addItem("Are you sure your internet is working?");
}
};
bar.onPress = function () {
startDrag();
};
bar.onRelease = function () {
stopDrag();
};
close.onRelease = function () {
_root.editor_openGallery();
};
editBtn.onRelease = function () {
var username = _root.loginOb.username;
var name = xmlData[levelsListBox.getSelectedIndex()][0];
_root.getLevel({username:username, name:name}, 2);
};
delBtn.onRelease = function () {
if ((_root.loginOb.username != undefined) and _root.loginOb.loggedIn) {
var varsOut = new LoadVars();
var varsIn = new LoadVars();
varsOut.username = _root.loginOb.username;
varsOut.name = xmlData[levelsListBox.getSelectedIndex()][0];
varsOut.pw = _root.loginOb.pw;
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/deleteLevel.php", varsIn);
_root.messageTrace(("Level \"" + varsOut.name) + "\" has been deleted");
_root.gallery.removeMovieClip();
} else {
_root.messageTrace("Error! You must log in first...wait a second! you shouldn't even see the \"my levels\" button if you're not logged in already...very strange...", "0xFF0000");
}
};
renameBtn.onRelease = function () {
if ((_root.loginOb.username != undefined) and _root.loginOb.loggedIn) {
_root.editor_openGalleryRename(xmlData[levelsListBox.getSelectedIndex()][0]);
}
};
}
} else if (!gallery._visible) {
_root.ideHelpTxt.setTxt();
gallery._visible = true;
} else if (gallery._visible) {
gallery.removeMovieClip();
}
} else {
messageTrace("You must log in first...wait a second! you shouldn't even see the \"my levels\" button if you're not logged in already...very strange...", "0xFF0000");
}
editor_autoKeyListener();
}
function editor_openGalleryRename(oldname) {
_root.ideHelpTxt.setTxt();
attachMovie("editor.gallery.rename", "renameWin", d_renameWin);
renameWin._x = (STAGE_W / 2) - (renameWin._width / 2);
renameWin._y = (STAGE_H / 2) - (renameWin._height / 2);
with (renameWin) {
bar.onPress = function () {
startDrag();
};
bar.onRelease = function () {
stopDrag();
};
close.onRelease = function () {
this._parent.removeMovieClip();
_root.editor_autoKeyListener();
};
ok.onRelease = function () {
var varsOut = new LoadVars();
var varsIn = new LoadVars();
varsOut.username = _root.loginOb.username;
varsOut.name = oldname;
varsOut.newName = newnameInput;
varsOut.pw = _root.loginOb.pw;
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/renameLevel.php", varsIn);
varsIn.onLoad = function (success) {
if (success) {
if (varsIn.success == "true") {
_root.messageTrace(((("Level \"" + varsOut.name) + "\" has been renamed \"") + varsOut.newName) + "\"", "0x00FF00");
} else {
_root.messageTrace("Error receiving confirmation. Level may or may not be renamed. ~", "0xFF0000");
}
} else {
_root.messageTrace("Error receiving confirmation. Level may or may not be renamed. ~~", "0xFF0000");
}
_root.gallery.removeMovieClip();
_root.renameWin.removeMovieClip();
};
};
}
editor_autoKeyListener();
}
function editor_toggleGetIDWin() {
if ((loginOb.username != undefined) and loginOb.loggedIn) {
if (getIDWin == undefined) {
attachMovie("editor.gallery_getID", "getIDWin", d_gallery_getID);
getIDWin._x = (STAGE_W / 2) - (getIDWin._width / 2);
getIDWin._y = (STAGE_H / 2) - (getIDWin._height / 2);
getIDWin.xmlData = [];
ideHelpTxt.setTxt();
with (getIDWin) {
var levelsXML = new XML();
var varsOut = new LoadVars();
varsOut.username = loginOb.username;
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/getLevelsList.php", levelsXML);
levelsXML.ignoreWhitespace = true;
levelsXML.onLoad = function (success) {
if (success) {
_root.getIDWin.levelsListBox.removeAll();
var levels = this.firstChild;
var i = 0;
while (i < levels.childNodes.length) {
var level = levels.childNodes[i];
_root.getIDWin.xmlData.push([level.childNodes[5].firstChild.nodeValue, level.childNodes[6].firstChild.nodeValue]);
var label = level.childNodes[0].firstChild.nodeValue;
label = label + (" -- ID " + level.childNodes[5].firstChild.nodeValue);
label = label + ((level.childNodes[6].firstChild.nodeValue != 0) ? (" -- Linked to " + level.childNodes[6].firstChild.nodeValue) : " -- No link");
_root.getIDWin.levelsListBox.addItem(label, i);
i++;
}
} else {
_root.getIDWin.levelsListBox.addItem("Error Connecting.");
_root.getIDWin.levelsListBox.addItem("Are you sure your internet is working?");
}
};
bar.onPress = function () {
startDrag();
};
bar.onRelease = function () {
stopDrag();
};
close.onRelease = function () {
this._parent.removeMovieClip();
};
getIDBtn.onRelease = function () {
var i = this._parent.levelsListBox.getSelectedIndex();
_root.saveAsWin.linkInput = this._parent.xmlData[i][0];
this._parent.removeMovieClip();
};
}
} else if (!getIDWin._visible) {
_root.ideHelpTxt.setTxt();
getIDWin._visible = true;
} else if (getIDWin._visible) {
getIDWin.removeMovieClip();
}
} else {
messageTrace("You must log in first", "0xFF0000");
}
}
function editor_toggleTextEdit() {
if (textEdit == undefined) {
attachMovie("editor.textEdit", "textEdit", d_textEdit);
textEdit._visible = false;
textEdit._x = 250;
textEdit._y = 250;
with (textEdit) {
bar.onPress = function () {
startDrag();
};
close.onRelease = function () {
this._parent.applyChanges();
this._parent._visible = false;
_root.editor_autoKeyListener();
};
close.onRollOver = function () {
_root.ideHelpTxt.setTxt("Editor will reload with any changes you make here.\nIf you make a mistake here, you may cause the level to not load properly, so be sure to save before editing the code manually");
};
close.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
refresh.onRelease = function () {
this._parent.update();
};
cancel.onRelease = function () {
this._parent.update();
this._parent._visible = false;
_root.editor_autoKeyListener();
};
advancedView.onRelease = function () {
_root.library.com.advancedView();
this._parent.advancedTxt = "advanced: on";
};
advancedView.onRollOver = function () {
_root.ideHelpTxt.setTxt("Enable advanced view.\nWhen rolling your mouse over a part, the actual name and parent will be shown.\n(Actual name is sometimes different from the displayed name)");
};
advancedView.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
}
textEdit.update = function () {
editor_make_AI_code();
this.txt = "";
var k = 0;
while (k < currentLvlObject.code.length) {
if (currentLvlObject.code[k] != undefined) {
if (k != 0) {
this.txt = this.txt + newline;
}
var l = 0;
while (l < currentLvlObject.code[k].length) {
this.txt = this.txt + currentLvlObject.code[k][l];
if (l < (currentLvlObject.code[k].length - 1)) {
this.txt = this.txt + ", ";
}
l++;
}
}
k++;
}
};
textEdit.update();
textEdit.applyChanges = function () {
var lineArray = [];
var elementArray = [];
var txt = this.txt;
while (txt.indexOf(" ") != -1) {
var n = txt.indexOf(" ");
var front = txt.substring(0, n);
var back = txt.substring(n + 1);
txt = front + back;
}
lineArray = txt.split(String.fromCharCode(13));
var temptxt;
var a = 0;
while (a < lineArray.length) {
temptxt = temptxt + (lineArray[a] + newline);
a++;
}
lineArray = temptxt.split(newline);
var b = 0;
while (b < lineArray.length) {
if (_root.removeStringWhitespace(lineArray[b]) == "") {
lineArray.splice(b, 1);
b--;
}
b++;
}
var i = 0;
while (i < lineArray.length) {
lineArray[i] = _root.removeStringWhitespace(lineArray[i]);
elementArray[i] = lineArray[i].split(",");
i++;
}
var i = 0;
while (i < elementArray.length) {
elementArray[i][1] = Number(elementArray[i][1]);
elementArray[i][2] = Number(elementArray[i][2]);
elementArray[i][3] = Number(elementArray[i][3]);
elementArray[i][4] = Number(elementArray[i][4]);
elementArray[i][5] = Number(elementArray[i][5]);
elementArray[i][7] = Number(elementArray[i][7]);
i++;
}
_root.currentLvlObject.code = elementArray;
_root.clearEditorMode();
_root.editorMode(false, false);
};
}
if (textEdit._visible) {
textEdit._visible = false;
editor_autoKeyListener();
} else {
_root.ideHelpTxt.setTxt();
textEdit._visible = true;
textEdit.update();
editor_autoKeyListener();
}
}
function editor_autoKeyListener() {
if (((((((((((!loginWin._visible) and (!saveAsWin._visible)) and (!registerWin._visible)) and (!coreAIwindow._visible)) and (!textEdit._visible)) and (!gallery._visible)) and (!renameWin._visible)) and (!fileMenuWin._visible)) and (!keySettings._visible)) and (!fileMenuWin._visible)) and (!properties.colourPicker.pick_mc._visible)) {
keyListener.onKeyDown = editor_detectKeys;
} else {
keyListener.onKeyDown = null;
}
}
function editor_setColour(col) {
_root.editor_autoKeyListener();
var i = 0;
while (i < library.selected.length) {
setColour(library.selected[i], col);
editor_highlight(library.selected[i], 0);
i++;
}
editor_highlight(library.selected[0], 1);
}
function editor_highlight(ob, mag) {
var r = ob.colR;
var g = ob.colG;
var b = ob.colB;
r = parseInt("0x" + r);
g = parseInt("0x" + g);
b = parseInt("0x" + b);
ob.dr = Math.round((200 - r) / 10);
ob.dg = Math.round((200 - g) / 10);
ob.db = Math.round((200 - b) / 10);
var col = new Color(ob);
col.setRGB("0xC8C8C8");
ob.tempcolR = (ob.tempcolG = (ob.tempcolB = "C8"));
ob.highlightDir = 1;
ob.onEnterFrame = function () {
this.t++;
if (this.t == 11) {
this.highlightDir = -1;
var colOb = new Color(this);
colOb.setRGB((("0x" + this.colR) + this.colG) + this.colB);
this.tempcolR = this.colR;
this.tempcolG = this.colG;
this.tempcolB = this.colB;
return(undefined);
}
if (this.t == 22) {
this.t = 0;
var colOb = new Color(this);
colOb.setRGB("0xC8C8C8");
this.ob.tempcolR = (this.ob.tempcolG = (this.ob.tempcolB = "C8"));
this.highlightDir = 1;
return(undefined);
}
var r = this.tempcolR;
var g = this.tempcolG;
var b = this.tempcolB;
r = parseInt("0x" + r);
g = parseInt("0x" + g);
b = parseInt("0x" + b);
r = r - (this.dr * this.highlightDir);
g = g - (this.dg * this.highlightDir);
b = b - (this.db * this.highlightDir);
if (r < 0) {
r = 0;
}
if (g < 0) {
g = 0;
}
if (b < 0) {
b = 0;
}
if (r > 255) {
r = 255;
}
if (g > 255) {
g = 255;
}
if (b > 255) {
b = 255;
}
this.tempcolR = r.toString(16);
this.tempcolG = g.toString(16);
this.tempcolB = b.toString(16);
if (this.tempcolR.length == 1) {
this.tempcolR = "0" + this.tempcolR;
}
if (this.tempcolG.length == 1) {
this.tempcolG = "0" + this.tempcolG;
}
if (this.tempcolB.length == 1) {
this.tempcolB = "0" + this.tempcolB;
}
var colOb = new Color(this);
colOb.setRGB((("0x" + this.tempcolR) + this.tempcolG) + this.tempcolB);
};
}
function editor_unhighlight(ob) {
ob.onEnterFrame = null;
setColour(ob, ob.colR, ob.colG, ob.colB);
}
function editor_toggleFileMenuWin() {
if (fileMenuWin == undefined) {
attachMovie("editor.fileMenuWin", "fileMenuWin", d_fileMenuWin);
fileMenuWin._x = (STAGE_W / 2) - (fileMenuWin._width / 2);
fileMenuWin._y = (STAGE_H / 2) - (fileMenuWin._height / 2);
with (fileMenuWin) {
bar.onPress = function () {
startDrag();
};
loginBtn.onPress = function () {
_root.ideHelpTxt.setTxt();
_root.editor_toggleLoginWin();
_root.editor_toggleFileMenuWin();
};
loginBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Login so you can save and edit your levels");
};
loginBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
newBtn.onPress = function () {
_root.ideHelpTxt.setTxt();
_root.clearEditorMode();
_root.editorMode(false, true);
_root.editor_toggleFileMenuWin();
};
newBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Start a new level");
};
newBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
recoverBtn.onPress = function () {
_root.ideHelpTxt.setTxt();
_root.editor_localLoad();
_root.editor_toggleFileMenuWin();
};
recoverBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Recover an autosave. Autosave occurs every 30 seconds.");
};
recoverBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
tutorialBtn.onPress = function () {
_root.editor_openTutorial();
_root.editor_toggleFileMenuWin();
};
tutorialBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[F1]</b> View the default controls for this editor.\nControls can be changed in the options menu");
};
tutorialBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
optionsBtn.onPress = function () {
_root.openKeySettings();
_root.keySettings.customFunction = function () {
_root.editor_autoKeyListener();
};
_root.editor_toggleFileMenuWin();
};
optionsBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Show the default keys for editing");
};
optionsBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
exitBtn.onPress = function () {
_root.fileMenuWin._visible = false;
_root.editor_localSave();
_root.editor_toMenu();
};
exitBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Autosave and exit to main menu\n(Do NOT rely on the autosave though, save your level properly)");
};
exitBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
closeBtn.onPress = function () {
_root.editor_toggleFileMenuWin();
};
}
} else {
fileMenuWin._visible = false;
fileMenuWin.removeMovieClip();
}
editor_autoKeyListener();
_root.ideHelpTxt.setTxt();
}
function editor_openTutorial() {
attachMovie("editor.tutorial", "tutorial", d_edTutorial);
}
function setDefaultControls() {
op_volume = 100;
key_aim = "auto";
key_move = "mouse";
detectKeys_function = detectKeys_auto_mouse;
key_left = 37;
key_right = 39;
key_up = 38;
key_down = 40;
key_aimUp = 69;
key_aimDown = 68;
key_aimLeft = 83;
key_aimRight = 70;
key_shoot = 90;
key_pause = 80;
key_ed_up = 69;
key_ed_down = 68;
key_ed_left = 83;
key_ed_right = 70;
key_ed_rotateLeft1 = 87;
key_ed_rotateRight1 = 82;
key_ed_rotateLeft45 = 81;
key_ed_rotateRight45 = 84;
key_ed_delete = 32;
key_ed_lock = 86;
key_ed_nextParent = 71;
key_ed_prevParent = 65;
key_ed_xscale = 90;
key_ed_yscale = 88;
key_ed_xyscale = 67;
key_ed_duplicate = undefined;
key_ed_selAll = undefined;
key_ed_selCore = undefined;
}
function gameLoop() {
detectKeys();
updateEnemies();
updateBullets();
coreAI();
}
function gameMode(lvl) {
if (lvl.username != undefined) {
varsOut = new LoadVars();
varsIn = new LoadVars();
varsOut.username = lvl.username;
varsOut.name = lvl.name;
varsOut.ID = lvl.ID;
varsOut.m = 1;
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/updateCount.php", varsIn, "POST");
}
attachMovie("levelMsg", "levelMsg", d_levelMsgWin);
if (!campaignMode) {
if (lvl.name == "ZetaFlow-untitled") {
var x = random(4);
switch (x) {
case 0 :
levelMsg.txt = "Your masterpiece awaits...";
break;
case 1 :
levelMsg.txt = "Get ready...";
break;
case 2 :
levelMsg.txt = "Your enemy is ready, are you?";
break;
case 3 :
levelMsg.txt = "Attack!!";
}
} else {
levelMsg.txt = lvl.name;
}
lives = lvl.lives;
lifeCount.update();
} else {
levelMsg.txt = "Level " + currentLvl;
if (currentLvl == 0) {
lives = startingLives;
}
}
currentLvlObject = lvl;
gotoAndStop (5);
createEmptyMovieClip("enemies", d_allEnemies);
createEmptyMovieClip("bullets", d_allBullets);
createEmptyMovieClip("enemy_pixelBullets", d_allEnemyBullets);
createEmptyMovieClip("enemy_shapeBullets", d_allEnemyBullets2);
createEmptyMovieClip("enemy_destroyableBullets", d_allEnemyBullets3);
createEmptyMovieClip("explosions", d_allExp);
this.onMouseDown = function () {
this.onKeyDown();
};
this.onKeyDown = function () {
this.onKeyDown = null;
this.onMouseDown = null;
removeMovieClip(levelMsg);
gunArray = [];
attachShip();
lvl.init();
var code = lvl.code;
var i = 0;
while (i < code.length) {
attachPart.apply(_root, code[i]);
i++;
}
var lvlAI_clone = [];
lvlAI_clone = lvlAI_clone.concat(lvl.AI);
currentLvl_coreGunAI = _root[lvlAI_clone.shift()];
if (gunArray.length == 0) {
gunArray.push(ai_ob);
}
currentLvl_coreAIfunctions = [];
var i = 0;
while (i < lvlAI_clone.length) {
if (lvlAI_clone[i][0] == undefined) {
var tempElement = lvlAI_clone[i];
lvlAI_clone[i] = [];
lvlAI_clone[i].push(tempElement);
}
var tempReturnParamArray = [];
var j = 1;
while (j < lvlAI_clone[i].length) {
tempReturnParamArray.push(lvlAI_clone[i][j]);
j++;
}
tempReturnParamArray = _root[lvlAI_clone[i][0] + "_init"](tempReturnParamArray);
if (tempReturnParamArray == "initOnly") {
} else {
addToCoreAIFunctions(_root[lvlAI_clone[i][0]], tempReturnParamArray);
}
i++;
}
calculateHP(enemies.e0);
enemies.e0.hp = enemies.e0.hp * 2;
loopThrough(enemies.e0, calculateHP);
if (key_aim == "expert") {
detectKeys_function = _root["detectKeys_aimExpert_move_" + key_move];
} else if (key_aim == "auto") {
if (key_move == "keyboard") {
detectKeys_function = function () {
detectKeys_aim_auto();
detectKeys_move_keyboard();
};
} else if (key_move == "mouse") {
detectKeys_function = function () {
detectKeys_aim_auto();
detectKeys_move_mouse();
};
}
} else if (key_aim == "keyboard") {
if (key_move == "keyboard") {
detectKeys_function = function () {
detectKeys_aim_keyboard();
detectKeys_move_keyboard();
};
} else if (key_move == "mouse") {
detectKeys_function = function () {
detectKeys_aim_keyboard();
detectKeys_move_mouse();
};
}
} else if (key_aim == "mouse") {
if (key_move == "keyboard") {
detectKeys_function = function () {
detectKeys_aim_mouse();
detectKeys_move_keyboard();
};
} else if (key_move == "mouse") {
detectKeys_function = function () {
detectKeys_aim_mouse();
detectKeys_move_mouse();
};
}
}
detectKeys_moving = _root["detectKeys_move" + key_move];
detectKeys_aiming = _root["detectKeys_aim" + key_aim];
this.onMouseDown = function () {
mouseDown = true;
};
this.onMouseUp = function () {
stopDrag();
mouseDown = false;
};
mouseDown = false;
this.onEnterFrame = gameLoop;
_root.ideHelpTxt.setTxt();
};
}
function attachShip() {
attachMovie("ship", "ship", d_ship);
ship.speed = SHIP_SPEED;
ship._x = 400;
ship._y = 500;
ship.defaultDamage = SHIP_GUN_DAMAGE;
ship.invincible = true;
ship.autoAimerTarget = null;
ship.autoAimerDist = 9999;
attachMovie("aimer", "aimer", d_shipAimer);
aimer._rotation = (ship.turret._rotation = 270);
ship._x = 400;
ship._y = 500;
ship.gotoAndPlay(2);
createEmptyMovieClip("lifeCount", d_lifeCount);
lifeCount.x = (lifeCount.y = 30);
lifeCount.update = function () {
this.createEmptyMovieClip("shipHolder", 1);
if (_root.lives <= -1) {
this.shipHolder.attachMovie("infiniteLives", "infinite", 1);
this.shipHolder.infinite._x = this.x;
this.shipHolder.infinite._y = this.y;
} else if (_root.lives > 5) {
this.shipHolder.attachMovie("livesNum", "livesNum", 1);
this.shipHolder.livesNum.txt = _root.lives;
this.shipHolder.livesNum._x = -10;
this.shipHolder.livesNum._y = 15;
this.shipHolder.livesNum._alpha = 50;
} else {
var i = 0;
while (i < _root.lives) {
this.shipHolder.attachMovie("ship", "ship" + i, i);
var ob = this.shipHolder["ship" + i];
ob._x = this.x + (i * ob._width);
ob._y = this.y;
ob._alpha = 50;
var col = new Color(ob);
col.setRGB(10066329);
i++;
}
}
};
lifeCount.update();
}
function clearGameMode() {
ai_ob = null;
destroyChildrenArray = [];
currentLvl_coreAIfunctions = null;
removeMovieClip(enemies);
removeMovieClip(bullets);
removeMovieClip(explosions);
removeMovieClip(ship);
removeMovieClip(enemy_pixelBullets);
removeMovieClip(enemy_shapeBullets);
removeMovieClip(enemy_destroyableBullets);
removeMovieClip(aimer);
removeMovieClip(tutorial);
removeMovieClip(countdown);
removeMovieClip(lifeCount);
this.onEnterFrame = null;
this.onMouseDown = null;
this.onKeyDown = null;
code = [];
gunArray = [];
timeArray = [];
coreVars = new Object();
ideHelpTxt.setTxt();
tinyShot2Snd.stop("tinyShot2Snd");
}
function detectKeys() {
detectKeys_moving();
if (Key.isDown(key_pause)) {
openPauseMenu();
}
}
function detectKeys_moveKeyboard() {
var left = Key.isDown(key_left);
var right = Key.isDown(key_right);
var up = Key.isDown(key_up);
var down = Key.isDown(key_down);
if (left) {
ship._x = ship._x - ship.speed;
if (ship._x < 0) {
ship._x = 0;
}
} else if (right) {
ship._x = ship._x + ship.speed;
if (ship._x > STAGE_W) {
ship._x = STAGE_W;
}
}
if (up) {
ship._y = ship._y - ship.speed;
if (ship._y < 0) {
ship._y = 0;
}
} else if (down) {
ship._y = ship._y + ship.speed;
if (ship._y > STAGE_H) {
ship._y = STAGE_H;
}
}
detectKeys_aiming(up, down, left, right);
aimer._x = ship._x;
aimer._y = ship._y;
ship.delay++;
if (Key.isDown(key_shoot) or mouseDown) {
aimer.gotoAndStop(2);
ship_fireBullet(ship.defaultDamage);
} else {
aimer.gotoAndStop(1);
_root.tinyShot2Snd.stop();
}
}
function detectKeys_moveMouse() {
var left = (_xmouse < ship._x);
var right = (_xmouse > ship._x);
var up = (_ymouse < ship._y);
var down = (_ymouse > ship._y);
var xDist = (_xmouse - ship._x);
var yDist = (_ymouse - ship._y);
var dist = Math.sqrt((xDist * xDist) + (yDist * yDist));
if (dist < ship.speed) {
var speed = dist;
} else {
var speed = ship.speed;
}
var px = (xDist / dist);
var py = (yDist / dist);
ship._x = ship._x + (px * speed);
ship._y = ship._y + (py * speed);
if (ship._x < 0) {
ship._x = 0;
}
if (ship._x > STAGE_W) {
ship._x = STAGE_W;
}
if (ship._y > STAGE_H) {
ship._y = STAGE_H;
}
if (ship._y < 0) {
ship._y = 0;
}
detectKeys_aiming(up, down, left, right);
aimer._x = ship._x;
aimer._y = ship._y;
ship.delay++;
if (Key.isDown(key_shoot) or mouseDown) {
aimer.gotoAndStop(2);
ship_fireBullet(ship.defaultDamage);
} else {
aimer.gotoAndStop(1);
_root.tinyShot2Snd.stop();
}
}
function detectKeys_aimExpert(u, d, l, r) {
if (l) {
if (u) {
ship_adjustAimer(45);
} else if (d) {
ship_adjustAimer(-45);
} else {
ship_adjustAimer(0);
}
} else if (r) {
if (u) {
ship_adjustAimer(135);
} else if (d) {
ship_adjustAimer(-135);
} else {
ship_adjustAimer(180);
}
}
if (u) {
if ((!l) and (!r)) {
ship_adjustAimer(90);
}
} else if (d) {
if ((!l) and (!r)) {
ship_adjustAimer(-90);
}
}
}
function detectKeys_aimAuto(u, d, l, r, shoot) {
var ob = ship.autoAimerTarget;
if (ob._x == undefined) {
ship.autoAimerDist = 9999;
} else {
var dx = (ob._x - ship._x);
var dy = (ob._y - ship._y);
var dz = Math.sqrt((dx * dx) + (dy * dy));
ship.autoAimerDist = dz;
}
for (var i in enemies) {
var ob = enemies[i];
if (!ob.invincible) {
var dx = (ob._x - ship._x);
var dy = (ob._y - ship._y);
var dz = Math.sqrt((dx * dx) + (dy * dy));
if (dz < ship.autoAimerDist) {
ship.autoAimerTarget = ob;
ship.autoAimerDist = dz;
}
}
}
for (var e in enemy_destroyableBullets) {
var ob = enemy_destroyableBullets[e];
var dx = (ob._x - ship._x);
var dy = (ob._y - ship._y);
var dz = Math.sqrt((dx * dx) + (dy * dy));
if (dz < ship.autoAimerDist) {
ship.autoAimerTarget = ob;
ship.autoAimerDist = dz;
}
}
ob = ship.autoAimerTarget;
var dx = (ob._x - ship._x);
var dy = (ob._y - ship._y);
var angle = (Math.atan2(dy, dx) / PI_180);
var oldangle = aimer._rotation;
var dist = (oldangle - angle);
if (dist < -180) {
angle = angle - 360;
} else if (dist > 180) {
angle = angle + 360;
}
if (oldangle > (angle + 2)) {
aimer._rotation = (ship.turret._rotation = oldangle - 2);
} else if (oldangle < (angle - 2)) {
aimer._rotation = (ship.turret._rotation = oldangle + 2);
}
}
function detectKeys_aimManKeyboard(u, d, l, r, shoot) {
var left = Key.isDown(key_aimLeft);
var right = Key.isDown(key_aimRight);
var up = Key.isDown(key_aimUp);
var down = Key.isDown(key_aimDown);
if (left) {
if (up) {
aimer._rotation = (ship.turret._rotation = -135);
} else if (down) {
aimer._rotation = (ship.turret._rotation = 135);
} else {
aimer._rotation = (ship.turret._rotation = 180);
}
} else if (right) {
if (up) {
aimer._rotation = (ship.turret._rotation = -45);
} else if (down) {
aimer._rotation = (ship.turret._rotation = 45);
} else {
aimer._rotation = (ship.turret._rotation = 0);
}
} else if (up) {
aimer._rotation = (ship.turret._rotation = -90);
} else if (down) {
aimer._rotation = (ship.turret._rotation = 90);
}
}
function detectKeys_aimManMouse() {
var dx = (_xmouse - ship._x);
var dy = (_ymouse - ship._y);
aimer._rotation = (ship.turret._rotation = Math.atan2(dy, dx) / PI_180);
}
function ship_adjustAimer(angle) {
if ((!Key.isDown(key_shoot)) and (!mouseDown)) {
aimer._rotation = (ship.turret._rotation = Math.round(aimer._rotation));
var oldangle = aimer._rotation;
var dist = (oldangle - angle);
if (dist == 0) {
return(undefined);
}
if (dist < -180) {
angle = angle - 360;
} else if (dist > 180) {
angle = angle + 360;
}
if (oldangle > angle) {
newangle = oldangle - 5;
} else if (oldangle < angle) {
newangle = oldangle + 5;
}
newangle = Math.round(newangle);
aimer._rotation = (ship.turret._rotation = newangle);
}
}
function attachPart(type, x, y, rotation, xscale, yscale, parent, me, colour) {
x = Number(x);
y = Number(y);
rotation = Number(rotation);
me = Number(me);
parent = _root.enemies[parent];
enemies.attachMovie("e." + type, "e" + me, me);
var ob = enemies["e" + me];
ob.__proto__ = _root["e_" + type].prototype;
ob.init();
ob.HPin = ob.hp / 3;
ob.link = type;
ob.me = me;
ob._rotation = (ob.origRotation = rotation);
ob.rotation = 0;
ob.c = Math.sqrt((x * x) + (y * y));
ob.rotationFromParent = Math.atan2(y, x);
ob._x = parent._x + x;
ob._y = parent._y + y;
ob._xscale = xscale * 100;
ob._yscale = yscale * 100;
ob.parent = parent;
ob.me = me;
ob.children = [];
ob.deathTrigger = [];
parent.children.push(ob);
if (parent == undefined) {
ai_ob = ob;
}
if (colour.length == 6) {
setColour(ob, colour);
}
return(ob);
}
function updateEnemies() {
if (ai_ob.hitTest(ship._x, ship._y, true)) {
hitShip();
}
loopThrough(ai_ob, updateChildren);
var i = 0;
while (i < gunArray.length) {
gunArray[i].gunAI();
i++;
}
damageInd_count++;
if (damageInd_count == 3) {
damageInd_count = 0;
loopThrough(ai_ob, damageIndicators);
if (ai_ob.hp < 3000) {
ai_ob.mc.gotoAndStop(2);
}
}
}
function updateChildren(ob) {
ob._rotation = ((ob.parent._rotation - ob.parent.origRotation) + ob.origRotation) + ob.rotation;
var parentAngleRadians = ((ob.parent._rotation - ob.parent.origRotation) * PI_180);
var angle = (parentAngleRadians + ob.rotationFromParent);
var x = (Math.cos(angle) * ob.c);
var y = (Math.sin(angle) * ob.c);
ob._x = x + ob.parent._x;
ob._y = y + ob.parent._y;
if (ob.hitTest(ship._x, ship._y, true)) {
hitShip(ob);
}
}
function damageIndicators(ob) {
if (ob.hp < ob.HPin) {
ob.mc.gotoAndStop(2);
}
}
function loopThrough(child, func, param) {
var i = 0;
while (i < child.children.length) {
var ob = child.children[i];
func(ob, param);
loopThrough(ob, func, param);
i++;
}
}
function coreAI() {
var i = 0;
while (i < currentLvl_coreAIfunctions.length) {
currentLvl_coreAIfunctions[i][0](currentLvl_coreAIfunctions[i][1]);
i++;
}
}
function addToCoreAIFunctions(func, params) {
var newElement = [];
newElement[0] = func;
newElement[1] = params;
currentLvl_coreAIfunctions.push(newElement);
}
function delFromCoreAIFunctions(func, justOne, paramArray) {
var i = 0;
while (i < currentLvl_coreAIfunctions.length) {
if (currentLvl_coreAIfunctions[i][0] == func) {
if (paramArray != undefined) {
var equal = true;
var a = 0;
while (a < paramArray.length) {
if ((String(paramArray[a]) != String(currentLvl_coreAIfunctions[i][1][a])) and (currentLvl_coreAIfunctions[i][1][a] != undefined)) {
equal = false;
}
a++;
}
if (equal) {
currentLvl_coreAIfunctions.splice(i, 1);
if (justOne) {
return(undefined);
}
}
} else {
currentLvl_coreAIfunctions.splice(i, 1);
if (justOne) {
return(undefined);
}
}
}
i++;
}
}
function ship_fireBullet(damage) {
if (ship.delay >= SHIP_GUN_DELAY) {
if (d_bullets >= d_maxBullets) {
d_bullets = 0;
}
d_bullets++;
bullets.attachMovie("b.z", "b" + d_bullets, d_bullets);
var ob = bullets["b" + d_bullets];
ob._x = ship._x;
ob._y = ship._y;
ob.v = 10;
var angle = aimer._rotation;
angle = angle + ((random(20) - 10) / 2);
ob.a = angle * PI_180;
ob._rotation = angle + 90;
ob.vx = Math.cos(ob.a) * ob.v;
ob.vy = Math.sin(ob.a) * ob.v;
ob.damage = damage;
ob.gotoAndStop(Math.ceil(damage / SHIP_GUN_DAMAGE));
ship.delay = 0;
}
}
function updateBullets() {
for (var i in bullets) {
var ob = bullets[i];
if ((ob._x < 0) or (ob._x > STAGE_W)) {
ob.removeMovieClip();
continue;
}
if ((ob._y < 0) or (ob._y > STAGE_H)) {
ob.removeMovieClip();
continue;
}
ob._x = ob._x + ob.vx;
ob._y = ob._y + ob.vy;
if (ob.hitTest(enemies)) {
for (var i in enemies) {
var ob2 = enemies[i];
if (ob2.hitTest(ob._x, ob._y, true)) {
var ob2invinc = ob2.invincible;
removeHP(ob2, ob.damage, false);
checkHP(ob2);
destroyOb_bullet(ob, ob2invinc);
continue;
}
}
}
for (var e in enemy_destroyableBullets) {
var ob3 = enemy_destroyableBullets[e];
if (ob.hitTest(ob3)) {
var obinvinc = ob.invincible;
var ob3invinc = ob3.invincible;
destroyOb_bullet(ob, ob3invinc);
destroyOb_bullet(ob3, obinvinc);
continue;
}
}
}
for (var j in enemy_pixelBullets) {
var ob = enemy_pixelBullets[j];
if ((ob._x < 0) or (ob._x > STAGE_W)) {
ob.removeMovieClip();
continue;
}
if ((ob._y < 0) or (ob._y > STAGE_H)) {
ob.removeMovieClip();
continue;
}
ob.a();
ob._x = ob._x + ob.vx;
ob._y = ob._y + ob.vy;
if (ship.hitTest(ob._x, ob._y, true)) {
destroyOb_bullet(ob, ship.invincible);
hitShip();
continue;
}
}
for (var k in enemy_shapeBullets) {
var ob = enemy_shapeBullets[k];
if ((ob._x < 0) or (ob._x > STAGE_W)) {
ob.removeMovieClip();
continue;
}
if ((ob._y < 0) or (ob._y > STAGE_H)) {
ob.removeMovieClip();
continue;
}
ob.a();
ob._x = ob._x + ob.vx;
ob._y = ob._y + ob.vy;
if (ob.hitTest(ship._x, ship._y, true)) {
ob.removeMovieClip();
hitShip();
continue;
}
}
for (var k in enemy_destroyableBullets) {
var ob = enemy_destroyableBullets[k];
if ((ob._x < 0) or (ob._x > STAGE_W)) {
ob.removeMovieClip();
}
if ((ob._y < 0) or (ob._y > STAGE_H)) {
ob.removeMovieClip();
}
ob.a();
ob._x = ob._x + ob.vx;
ob._y = ob._y + ob.vy;
if (ship.hitTest(ob._x, ob._y, true)) {
ob.removeMovieClip();
hitShip();
continue;
}
}
}
function planDestroyOb(ob, arr) {
arr.push(ob);
}
function destroyOb(ob, expType) {
d_exp++;
if (d_exp > 200) {
d_exp = 0;
}
explosions.attachMovie(expType, "exp" + d_exp, d_exp);
var exp = explosions["exp" + d_exp];
exp._x = ob._x;
exp._y = ob._y;
exp._width = (exp._height = ((ob._width < ob._height) ? (ob._width) : (ob._height)));
exp._rotation = random(360);
var t = 0;
while (t < ob.deathTrigger.length) {
var thisAICommand = ob.deathTrigger[t];
var action = thisAICommand.shift();
var tempReturnParamArray = [];
tempReturnParamArray = _root[("AI_" + action) + "_init"](thisAICommand);
if (tempReturnParamArray == "initOnly") {
} else {
addToCoreAIFunctions(_root["AI_" + action], tempReturnParamArray);
}
t++;
}
ob.removeMovieClip();
}
function destroyOb_bullet(ob, invincible) {
if (!invincible) {
destroyOb(ob, "bulletExp");
} else {
destroyOb(ob, "invincibleBulletExp");
}
}
function toggleFPScounter() {
if (fpsCounter == undefined) {
attachMovie("fpsCounter", "fpsCounter", d_fpsCounter);
fpsCounter._y = STAGE_H - fpsCounter._height;
fpsCounter.onEnterFrame = function () {
FPStime = getTimer() / 1000;
FPSthistime = FPStime - FPSoldtime;
if (FPSthistime >= 1) {
this.fpsTxt = FPSframes;
FPSframes = 0;
FPSoldtime++;
} else {
FPSframes++;
}
};
} else {
fpsCounter.removeMovieClip();
}
}
function removeHP(ob, amount, forceKill) {
if ((!ob.invincible) or forceKill) {
animateHit(ob);
var percentDamage = ((ob.hp - amount) / ob.hp);
ob.hp = ob.hp - amount;
var i = 0;
while (i < ob.children.length) {
var ob2 = ob.children[i];
var newAmount = (ob2.hp - (percentDamage * ob2.hp));
removeHP(ob2, newAmount, false);
i++;
}
}
}
function removeBonusHP(ob, num) {
ob.parent.hp = ob.parent.hp - (num * bonusHP);
if (ob.parent.parent != null) {
removeBonusHP(ob.parent, num);
}
}
function checkHP(ob) {
if (ob.hp <= 0) {
if (ai_ob == ob) {
if (currentLvlObject.username != undefined) {
var varsOut = new LoadVars();
var varsIn = new LoadVars();
varsOut.username = currentLvlObject.username;
varsOut.name = currentLvlObject.name;
varsOut.ID = currentLvlObject.ID;
varsOut.m = 2;
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/updateCount.php", varsIn, "POST");
}
attachMovie("e.core", "coreTemp", d_coreTemp);
coreTemp._x = ai_ob._x;
coreTemp._y = ai_ob._y;
coreTemp._rotation = ai_ob._rotation;
coreTemp._xscale = ai_ob._xscale;
coreTemp._yscale = ai_ob._yscale;
setColour(coreTemp, ai_ob.colR, ai_ob.colG, ai_ob.colB);
temp2 = 30;
this.onEnterFrame = coreExplode;
ship.gotoAndStop(3);
ship.invincible = true;
ship.endGame = true;
_root.tinyShot2Snd.stop();
}
var unique = ob.getDepth();
_root["destroyChildrenArray" + unique] = [];
var dca = _root["destroyChildrenArray" + unique];
planDestroyOb(ob, dca);
loopThrough(ob, planDestroyOb, dca);
removeFromArray(ob, ob.parent.children);
removeBonusHP(ob, dca.length);
var i = 0;
while (i < dca.length) {
var child = dca[i];
var k = 0;
while (k < gunArray.length) {
if (gunArray[k] == child) {
gunArray.splice(k, 1);
}
k++;
}
destroyOb(child, "exp");
i++;
}
delete dca;
delete _root["destroyChildrenArray" + unique];
if (gunArray.length == 0) {
gunArray.push(ai_ob);
}
}
}
function calculateHP(ob) {
var count = 0;
ob.hp = ob.hp + (bonusHP * countChildren(ob, count));
}
function countChildren(ob, count) {
var i = 0;
while (i < ob.children.length) {
var ob2 = ob.children[i];
count++;
count = countChildren(ob2, count);
i++;
}
return(count);
}
function enemy_fireBullet(shooter, type, angle, box, mute) {
if (d_bullets >= d_maxBullets) {
d_bullets = 0;
}
d_bullets++;
box.attachMovie("b." + type, "b" + d_bullets, d_bullets);
var ob = box["b" + d_bullets];
ob.__proto__ = _root["b_" + type].prototype;
ob.init(angle);
ob.vx = Math.cos(ob.angleRad) * ob.v;
ob.vy = Math.sin(ob.angleRad) * ob.v;
ob._x = shooter._x;
ob._y = shooter._y;
ob._rotation = angle;
ob.shooter = shooter;
if (!mute) {
_root[type + "Snd"].start(0, 0);
}
}
function hitShip(ob) {
if ((!ship.invincible) and (ship != undefined)) {
aimer._x = 2000;
var x = ship._x;
var y = ship._y;
destroyOb(ship, "exp");
_root.tinyShot2Snd.stop();
if (lives == 0) {
if (!campaignMode) {
this.onEnterFrame = null;
attachMovie("Ship.deathAnim", "ShipDeathAnim", d_ship);
ShipDeathAnim._x = x;
ShipDeathAnim._y = y;
} else {
clearGameMode();
attachMovie("gameover", "gameover", 3575);
gotoAndStop (4);
}
} else {
attachMovie("shipRespawnCountdown", "countdown", d_countdown);
lives--;
lifeCount.update();
}
} else {
ship.gotoAndPlay(3);
var angle = Math.atan2(ai_ob._y - ship._y, ai_ob._x - ship._x);
ship._x = ship._x - (Math.cos(angle) * SHIP_SPEED);
ship._y = ship._y - (Math.sin(angle) * SHIP_SPEED);
if (ship._x > STAGE_W) {
ship._x = STAGE_W;
} else if (ship._x < 0) {
ship._x = 0;
}
if (ship._y > STAGE_H) {
ship._y = STAGE_H;
} else if (ship._y < 0) {
ship._y = 0;
}
}
}
function coreExplode() {
temp++;
updateBullets();
if (((temp % temp2) == (temp2 - 1)) and (temp < 150)) {
temp2 = temp2 - 5;
if (temp2 <= 0) {
temp2 = 2;
}
var ob = attachMovie("invisibleShape", "emptyMC", 4000);
ob._x = (coreTemp._x + random(60)) - 30;
ob._y = (coreTemp._y + random(60)) - 30;
ob._width = (ob._height = 50 + random(30));
destroyOb(ob, "exp");
}
if (temp == 150) {
var c = attachMovie("coreExplosion", "coreExplosion", d_coreExplosion);
c._x = coreTemp._x;
c._y = coreTemp._y;
c._rotation = coreTemp._rotation;
c._xscale = coreTemp._xscale;
c._yscale = coreTemp._yscale;
setColour(c, coreTemp.colR, coreTemp.colG, coreTemp.colB);
destroyOb(coreTemp, "expShockwave");
}
if (temp == 185) {
temp = null;
this.onEnterFrame = null;
clearGameMode();
onLevelComplete(true);
}
}
function traceArray(MDarray) {
var tracer = "[\n";
var m = 0;
while (m < MDarray.length) {
tracer = tracer + ((" [" + MDarray[m]) + "]\n");
m++;
}
tracer = tracer + "]";
trace(tracer);
}
function openKeySettings() {
_root.ideHelpTxt.setTxt();
if (keySettings == undefined) {
attachMovie("keySettings", "keySettings", d_keySettings);
keySettings._x = (STAGE_W / 2) - (keySettings._width / 2);
keySettings._y = (STAGE_H / 2) - (keySettings._height / 2);
with (keySettings) {
bar.onPress = function () {
startDrag();
};
bar.onRelease = function () {
stopDrag();
};
_root.keySettings.closeFunction = function () {
with (_root) {
userSettings_so.data.volume = _root.volumeMasterSnd.getVolume();
userSettings_so.data.qual = _quality;
userSettings_so.data.showFPS = _root.fpsCounter != undefined;
userSettings_so.data.aim = key_aim;
userSettings_so.data.move = key_move;
userSettings_so.data.left = key_left;
userSettings_so.data.right = key_right;
userSettings_so.data.up = key_up;
userSettings_so.data.down = key_down;
userSettings_so.data.aimLeft = key_aimLeft;
userSettings_so.data.aimRight = key_aimRight;
userSettings_so.data.aimUp = key_aimUp;
userSettings_so.data.aimDown = key_aimDown;
userSettings_so.data.shoot = key_shoot;
userSettings_so.data.pause = key_pause;
userSettings_so.data.ed_up = key_ed_up;
userSettings_so.data.ed_down = key_ed_down;
userSettings_so.data.ed_left = key_ed_left;
userSettings_so.data.ed_right = key_ed_right;
userSettings_so.data.ed_rotateLeft1 = key_ed_rotateLeft1;
userSettings_so.data.ed_rotateRight1 = key_ed_rotateRight1;
userSettings_so.data.ed_rotateLeft45 = key_ed_rotateLeft45;
userSettings_so.data.ed_rotateRight45 = key_ed_rotateRight45;
userSettings_so.data.ed_delete = key_ed_delete;
userSettings_so.data.ed_lock = key_ed_lock;
userSettings_so.data.ed_nextParent = key_ed_nextParent;
userSettings_so.data.ed_prevParent = key_ed_prevParent;
userSettings_so.data.ed_xscale = key_ed_xscale;
userSettings_so.data.ed_yscale = key_ed_yscale;
userSettings_so.data.ed_xyscale = key_ed_xyscale;
userSettings_so.data.ed_duplicate = key_ed_duplicate;
userSettings_so.data.ed_selAll = key_ed_selAll;
userSettings_so.data.ed_selCore = key_ed_selCore;
userSettings_so.flush();
detectKeys_moving = _root["detectKeys_move" + key_move];
detectKeys_aiming = _root["detectKeys_aim" + key_aim];
}
this._visible = false;
removeMovieClip(this);
};
close.onRelease = function () {
_root.keySettings.closeFunction();
_root.keySettings.customFunction();
};
_root.keySettings.deleteFunction = function () {
with (_root) {
delete userSettings_so.data.volume;
delete userSettings_so.data.qual;
delete userSettings_so.data.showFPS;
delete userSettings_so.data.aim;
delete userSettings_so.data.move;
delete userSettings_so.data.left;
delete userSettings_so.data.right;
delete userSettings_so.data.up;
delete userSettings_so.data.down;
delete userSettings_so.data.aimUp;
delete userSettings_so.data.aimDown;
delete userSettings_so.data.aimLeft;
delete userSettings_so.data.aimRight;
delete userSettings_so.data.shoot;
delete userSettings_so.data.pause;
delete userSettings_so.data.ed_up;
delete userSettings_so.data.ed_down;
delete userSettings_so.data.ed_left;
delete userSettings_so.data.ed_right;
delete userSettings_so.data.ed_rotateLeft1;
delete userSettings_so.data.ed_rotateRight1;
delete userSettings_so.data.ed_rotateLeft45;
delete userSettings_so.data.ed_rotateRight45;
delete userSettings_so.data.ed_delete;
delete userSettings_so.data.ed_lock;
delete userSettings_so.data.ed_nextParent;
delete userSettings_so.data.ed_prevParent;
delete userSettings_so.data.ed_xscale;
delete userSettings_so.data.ed_yscale;
delete userSettings_so.data.ed_xyscale;
userSettings_so.flush();
setDefaultControls();
}
this._visible = false;
removeMovieClip(this);
};
deleteSave.onRelease = function () {
_root.keySettings.deleteFunction();
_root.keySettings.customFunction();
};
volumeSlider.btn.onPress = function () {
this._parent.onEnterFrame = function () {
this._x = this._parent._xmouse;
if (this._x < this._parent.volumeSliderBG._x) {
this._x = this._parent.volumeSliderBG._x;
} else if (this._x > (this._parent.volumeSliderBG._x + this._parent.volumeSliderBG._width)) {
this._x = this._parent.volumeSliderBG._x + this._parent.volumeSliderBG._width;
}
this.txt = int(((this._x - this._parent.volumeSliderBG._x) / this._parent.volumeSliderBG._width) * 100);
};
this._parent.onMouseUp = function () {
this.onEnterFrame = null;
_root.volumeMasterSnd.setVolume(int(((this._x - this._parent.volumeSliderBG._x) / this._parent.volumeSliderBG._width) * 100));
this.txt = "";
};
};
volumeSlider._x = ((_root.volumeMasterSnd.getVolume() / 100) * volumeSliderBG._width) + volumeSliderBG._x;
qualityBtn.onRelease = function () {
toggleHighQuality();
};
fpsBtn.onRelease = function () {
_root.toggleFPScounter();
};
}
} else if (!keySettings._visible) {
keySettings._visible = true;
}
}
function openPauseMenu(isMini) {
if (pauseMenu == undefined) {
stopAllSounds();
stopAllIn(enemy_shapeBullets);
stopAllIn(enemies);
attachMovie("pauseMenu", "pauseMenu", d_pauseMenu);
_root.createEmptyMovieClip("mochiad_mc", d_mochiad);
_root.mochiad_mc._x = 470;
_root.mochiad_mc._y = 320;
_root.MochiAd.showClickAwayAd({id:"22b632805117fda4", clip:_root.mochiad_mc});
with (pauseMenu) {
resumeBtn.onRelease = function () {
_root.MochiAd.unload(_root.mochiad_mc);
this.customOnRelease();
};
resumeBtn.customOnRelease = function () {
_root.unpause();
};
resumeBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt(("<b>[" + _root.codeName[_root.key_pause]) + "]</b>");
};
resumeBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
optionsBtn.onRelease = function () {
_root.MochiAd.unload(_root.mochiad_mc);
_root.openKeySettings();
_root.keySettings.customFunction = function () {
_root.openPauseMenu();
_root.onMouseDown = function () {
_root.mouseDown = true;
};
_root.keyListener.onKeyDown = null;
};
this._parent.removeMovieClip();
};
optionsBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[O]</b>");
};
optionsBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
editorBtn.onRelease = function () {
_root.MochiAd.unload(_root.mochiad_mc);
with (_root) {
_root.ideHelpTxt.setTxt();
clearGameMode();
editorMode(false, false);
}
this._parent.removeMovieClip();
};
editorBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[E]</b>");
};
editorBtn.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
menuBtn.onRelease = function () {
_root.MochiAd.unload(_root.mochiad_mc);
_root.clearGameMode();
getURL("http://zetaflow.skylogic.ca/", "_top");
};
miniBtn.onRelease = function () {
_root.ideHelpTxt.setTxt();
_root.MochiAd.unload(_root.mochiad_mc);
_root.pauseMenu._visible = false;
_root.attachMovie("miniPauseMenu", "miniPauseMenu", d_miniPauseMenu);
_root.center(_root.miniPauseMenu);
_root.miniPauseMenu.onEnterFrame = function () {
if (this._alpha > 1) {
this._alpha--;
} else {
this._alpha = 0;
this.onEnterFrame = null;
}
};
_root.miniPauseMenu.onMouseUp = function () {
this.removeMovieClip();
_root.unpause();
};
};
miniBtn.onRollOver = function () {
_root.ideHelpTxt.setTxt("Minimize. Good for taking screenshots");
};
miniBtn.onRollUp = function () {
_root.ideHelpTxt.setTxt();
};
}
this.onEnterFrame = function () {
if (!Key.isDown(key_pause)) {
keyPause_released = true;
}
if ((Key.isDown(key_pause) or Key.isDown(13)) and keyPause_released) {
keyPause_released = false;
this.onEnterFrame = function () {
if ((!Key.isDown(key_pause)) and (!Key.isDown(13))) {
pauseMenu.resumeBtn.onRelease();
}
};
}
if (Key.isDown(70)) {
keyFPS_down = true;
} else if (keyFPS_down) {
keyFPS_down = false;
pauseMenu.fpsBtn.onRelease();
}
if (Key.isDown(81)) {
keyQ_down = true;
} else if (keyQ_down) {
keyQ_down = false;
pauseMenu.qualityBtn.onRelease();
}
if (Key.isDown(69)) {
pauseMenu.editorBtn.onRelease();
}
if (Key.isDown(79)) {
pauseMenu.optionsBtn.onRelease();
}
if (Key.isDown(187)) {
if (campaignMode) {
clearGameMode();
currentLvl++;
gameMode(_root["level" + currentLvl]);
}
}
};
}
}
function unpause() {
resumeAllIn(enemy_shapeBullets);
resumeAllIn(enemies);
ideHelpTxt.setTxt();
pauseMenu.removeMovieClip();
_root.onEnterFrame = _root.gameLoop;
createEmptyMovieClip("onEnterFrameFix", d_onEnterFrameFix);
onEnterFrameFix.onEnterFrame = function () {
if (_root.onEnterFrame == undefined) {
_root.onEnterFrame = _root.gameLoop;
} else {
this.onEnterFrame = null;
this.removeMovieClip();
}
};
}
function stopAllIn(ob) {
for (i in ob) {
if (typeof(ob[i] == "object") or (typeof(ob[i]) == "movieclip")) {
ob[i].stop();
stopAllIn(ob[i]);
}
}
}
function resumeAllIn(ob) {
for (i in ob) {
if (typeof(ob[i] == "object") or (typeof(ob[i]) == "movieclip")) {
if (!ob[i].antiPause) {
ob[i].play();
}
resumeAllIn(ob[i]);
}
}
}
function getLevel(vars, mode) {
var varsIn = new LoadVars();
var varsOut = new LoadVars();
if (vars.ID != undefined) {
varsOut.ID = vars.ID;
} else {
varsOut.username = vars.username;
varsOut.name = vars.name;
}
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/getLevel.php", varsIn, "POST");
varsIn.onLoad = function (success) {
if (success) {
_root.clearEditorMode();
_root.clearGameMode();
var tempLvlOb = editor_getLevelFromString(unescape(this.level));
tempLvlOb.username = ((this.username != undefined) ? (this.username) : (varsOut.username));
tempLvlOb.name = ((this.name != undefined) ? (this.name) : (varsOut.name));
tempLvlOb.ID = ((this.ID != undefined) ? (this.ID) : (varsOut.ID));
tempLvlOb.lives = this.lives;
tempLvlOb.rating = this.rating;
tempLvlOb.link = this.link;
tempLvlOb.type = this.type;
tempLvlOb.hidden = this.hidden;
if (mode == 1) {
gameMode(tempLvlOb);
} else if (mode == 2) {
_root.currentLvlObject = tempLvlOb;
editorMode(false, false);
}
} else {
trace((("~error loading level from getLevel.php using user:" + _root.varsOut.username) + " and name:") + _root.varsOut.name);
messageTrace("Error loading level");
}
};
}
function onLevelComplete(beaten) {
if (beaten) {
currentLvlObject.beaten = true;
} else {
currentLvlObject.beaten = false;
}
clearGameMode();
if (campaignMode) {
campaign_mochiad();
} else {
custom_mochiad();
}
}
function campaign_onAdComplete() {
currentLvl++;
if (currentLvl > endLevel) {
clearGameMode();
attachMovie("victory", "victory", 3575);
} else {
lives++;
lifeCount.update();
gameMode(_root["level" + currentLvl]);
}
}
function custom_onAdComplete() {
openPauseMenu();
if (((currentLvlObject.link != "") and (currentLvlObject.link > 0)) and currentLvlObject.beaten) {
pauseMenu.playTxt = "Play Next Level";
pauseMenu.resumeBtn.customOnRelease = function () {
getLevel({ID:currentLvlObject.link}, 1);
this._parent.removeMovieClip();
};
} else {
pauseMenu.playTxt = "Retry";
pauseMenu.resumeBtn.customOnRelease = function () {
gameMode(currentLvlObject, currentLvlObject.name);
this._parent.removeMovieClip();
};
}
pauseMenu.optionsBtn.onRelease = function () {
_root.openKeySettings();
_root.keySettings.close.onRelease = function () {
closeFunction();
_root.custom_onAdComplete();
_root.keySettings.removeMovieClip();
};
};
}
function campaign_mochiad() {
campaign_onAdComplete();
}
function custom_mochiad() {
custom_onAdComplete();
}
function messageTrace(txt, col) {
attachMovie("message", "messageWin", d_messageWin);
messageWin.outputTxt = txt;
messageWin._x = (STAGE_W / 2) - (messageWin._width / 2);
messageWin._y = (STAGE_H / 2) - (messageWin._height / 2);
with (messageWin) {
bar.onPress = function () {
startDrag();
};
close.onRelease = function () {
_root.ideHelpTxt.setTxt();
this._parent.removeMovieClip();
};
close.onRollOver = function () {
_root.ideHelpTxt.setTxt("<b>[ENTER]</b>");
};
close.onRollOut = function () {
_root.ideHelpTxt.setTxt();
};
myformat = new TextFormat();
myformat.color = col;
output.setTextFormat(myformat);
}
}
function setScale(ob, xscale, yscale) {
ob._xscale = xscale;
ob._yscale = yscale;
}
function setColour(ob, a, b, c) {
if (arguments.length == 2) {
var colOb = new Color(ob);
colOb.setRGB("0x" + a);
ob.colR = a.substr(0, 2);
ob.colG = a.substr(2, 2);
ob.colB = a.substr(4, 2);
} else {
var col = new Color(ob);
col.setRGB((("0x" + a) + b) + c);
ob.colR = a;
ob.colG = b;
ob.colB = c;
}
}
function animateHit(ob) {
if (!ob.invincible) {
ob.t = 0;
var r = ob.colR;
var g = ob.colG;
var b = ob.colB;
r = parseInt("0x" + r);
g = parseInt("0x" + g);
b = parseInt("0x" + b);
ob.dr = (255 - r) / 6;
ob.dg = (255 - g) / 6;
ob.db = (255 - b) / 6;
var col = new Color(ob);
ob.tempcolR = (255 - (ob.dr * 2)).toString(16);
ob.tempcolG = (255 - (ob.dg * 2)).toString(16);
ob.tempcolB = (255 - (ob.db * 2)).toString(16);
col.setRGB((("0x" + ob.tempcolR) + ob.tempcolG) + ob.tempcolB);
ob.onEnterFrame = function () {
this.t++;
if (this.t == 4) {
this.t = 0;
this.onEnterFrame = null;
var colOb = new Color(this);
colOb.setRGB((("0x" + this.colR) + this.colG) + this.colB);
return(undefined);
}
var r = this.tempcolR;
var g = this.tempcolG;
var b = this.tempcolB;
r = parseInt("0x" + r);
g = parseInt("0x" + g);
b = parseInt("0x" + b);
r = r - this.dr;
g = g - this.dg;
b = b - this.db;
this.tempcolR = r.toString(16);
this.tempcolG = g.toString(16);
this.tempcolB = b.toString(16);
if (this.tempcolR.length == 1) {
this.tempcolR = "0" + this.tempcolR;
}
if (this.tempcolG.length == 1) {
this.tempcolG = "0" + this.tempcolG;
}
if (this.tempcolB.length == 1) {
this.tempcolB = "0" + this.tempcolB;
}
var colOb = new Color(this);
colOb.setRGB((("0x" + this.tempcolR) + this.tempcolG) + this.tempcolB);
};
}
}
function setGunEnable(ob, en) {
removeFromArray(ob, gunArray);
if (en) {
gunArray.push(ob);
}
}
function removeFromArray(item, arr) {
var i = 0;
while (i < arr.length) {
if (arr[i] == item) {
arr.splice(i, 1);
}
i++;
}
}
function existsInArray(item, arr) {
var i = 0;
while (i < arr.length) {
if (arr[i] == item) {
return(true);
}
i++;
}
return(false);
}
function timeTriggerCheck() {
curFrame++;
if (timeArray[curFrame] != undefined) {
var i = 0;
while (i < timeArray[curFrame].length) {
var params = timeArray[curFrame][i];
timeTriggerExecute(params);
delete timeArray[curFrame][i];
i++;
}
delete timeArray[curFrame];
}
}
function timeTriggerExecute(params) {
var repeat = int(params.shift());
if (repeat) {
var repeatInterval = int(params.shift());
var frameNum = (curFrame + repeatInterval);
if (timeArray[frameNum] == undefined) {
timeArray[frameNum] = [];
}
timeArray[frameNum].push([1, repeatInterval].concat(params));
}
var tempReturnParamArray = [];
var j = 1;
while (j < params.length) {
tempReturnParamArray.push(params[j]);
j++;
}
tempReturnParamArray = _root[("AI_" + params[0]) + "_init"](tempReturnParamArray);
if (tempReturnParamArray == "initOnly") {
}
addToCoreAIFunctions(_root["AI_" + params[0]], tempReturnParamArray);
}
function center(ob) {
ob._x = (STAGE_W / 2) - (ob._width / 2);
ob._y = (STAGE_H / 2) - (ob._height / 2);
}
function level_custom() {
return(_root.code);
}
function AI_randomRotate_init(paramArray) {
delFromCoreAIFunctions(AI_randomRotate, false);
if (paramArray[0] == undefined) {
var speed = 15;
} else {
var speed = Number(paramArray[0]);
}
coreVars.randomRotateTime = 100 + random(200);
coreVars.rotateV = (random(speed) + 1) / 10;
return([speed]);
}
function AI_randomRotate(paramArray) {
var speed = paramArray[0];
coreVars.count++;
if (coreVars.AI_rotateCW) {
ai_ob._rotation = ai_ob._rotation + coreVars.rotateV;
} else if (coreVars.AI_rotateCCW) {
ai_ob._rotation = ai_ob._rotation - coreVars.rotateV;
}
if (coreVars.count >= coreVars.randomRotateTime) {
coreVars.count = 0;
coreVars.randomRotateTime = 100 + random(200);
coreVars.rotateV = (random(speed) + 1) / 10;
if (random(2) == 0) {
coreVars.AI_rotateCW = random(2);
coreVars.AI_rotateCCW = ((coreVars.AI_rotateCW == 1) ? 0 : 1);
} else {
coreVars.AI_rotateCCW = random(2);
coreVars.AI_rotateCW = ((coreVars.AI_rotateCCW == 1) ? 0 : 1);
}
return(true);
}
return(false);
}
function AI_rotateToShip_init(paramArray) {
if (paramArray[0] == undefined) {
var speed = 1;
} else {
var speed = Number(paramArray[0]);
}
return([speed]);
}
function AI_rotateToShip(paramArray) {
var speed = paramArray[0];
var angle = (Math.atan2(ai_ob._y - ship._y, ai_ob._x - ship._x) / (PI / 180));
angle = angle - 90;
var oldangle = ai_ob._rotation;
var dist = (oldangle - angle);
if (dist < -180) {
angle = angle - 360;
} else if (dist > 180) {
angle = angle + 360;
}
if (Math.abs(oldangle - angle) < 20) {
return(undefined);
}
if (oldangle > angle) {
newangle = oldangle - speed;
} else if (oldangle < angle) {
newangle = oldangle + speed;
}
ai_ob._rotation = newangle;
}
function AI_followShip_init(paramArray) {
delFromCoreAIFunctions(AI_followShip, false);
if (paramArray[0] == undefined) {
var speed = 1;
} else {
var speed = Number(paramArray[0]);
}
return([speed]);
}
function AI_followShip(paramArray) {
var speed = paramArray[0];
var xDist = (ai_ob._x - ship._x);
var yDist = (ai_ob._y - ship._y);
if (Math.abs(xDist) > 50) {
if (xDist > 0) {
ai_ob._x = ai_ob._x - speed;
} else {
ai_ob._x = ai_ob._x + paramArray[0];
}
}
if (Math.abs(yDist) > 50) {
if (yDist > 0) {
ai_ob._y = ai_ob._y - speed;
} else {
ai_ob._y = ai_ob._y + paramArray[0];
}
}
}
function AI_randomWaypoints_init(paramArray) {
coreVars.randomWaypoints_wp = [random(STAGE_W), random(STAGE_H)];
delFromCoreAIFunctions(AI_randomWaypoints, false);
if (paramArray[0] == undefined) {
var speed = 1;
} else {
var speed = Number(paramArray[0]);
}
return([speed]);
}
function AI_randomWaypoints(paramArray) {
var speed = paramArray[0];
var x = (ai_ob._x - coreVars.randomWaypoints_wp[0]);
var y = (ai_ob._y - coreVars.randomWaypoints_wp[1]);
var dist = ((x * x) + (y * y));
if (Math.abs(dist) < 100) {
coreVars.randomWaypoints_wp = [random(STAGE_W - 400) + 200, random(STAGE_H - 300) + 150];
}
if (x > 0) {
ai_ob._x = ai_ob._x - speed;
} else if (x < 0) {
ai_ob._x = ai_ob._x + speed;
}
if (y > 0) {
ai_ob._y = ai_ob._y - speed;
} else if (y < 0) {
ai_ob._y = ai_ob._y + speed;
}
}
function AI_rotatePart_init(paramArray) {
var partNum = paramArray[0];
var rotateV = Number(paramArray[1]);
if (paramArray[2] == undefined) {
var min = 0;
} else {
var min = Number(paramArray[2]);
}
if (paramArray[3] == undefined) {
var max = 0;
} else {
var max = Number(paramArray[3]);
}
if (paramArray[4] != undefined) {
var initial = Number(paramArray[4]);
enemies["e" + partNum].rotation = initial;
}
if (min > max) {
var temp = min;
min = max;
max = temp;
}
return([partNum, rotateV, min, max]);
}
function AI_rotatePart(paramArray) {
var partNum = paramArray[0];
var rotateV = paramArray[1];
var min = paramArray[2];
var max = paramArray[3];
var ob = enemies["e" + partNum];
ob.rotation = ob.rotation + rotateV;
ob._rotation = ob._rotation + rotateV;
if (min != max) {
if (ob.rotation >= max) {
paramArray[1] = -Math.abs(rotateV);
} else if (ob.rotation <= min) {
paramArray[1] = Math.abs(rotateV);
}
}
}
function AI_rotatePartToShip_init(paramArray) {
return(paramArray);
}
function AI_rotatePartToShip(paramArray) {
var i = 0;
while (i < paramArray.length) {
if (ship != undefined) {
var ob = enemies["e" + paramArray[i]];
var angle = (Math.atan2(ob._y - ship._y, ob._x - ship._x) / (PI / 180));
angle = angle - 90;
var oldangle = ob.rotation;
var dist = (oldangle - angle);
if (dist < -180) {
angle = angle - 360;
} else if (dist > 180) {
angle = angle + 360;
}
ob.rotation = (-(ob.parent._rotation - ob.parent.origRotation)) + angle;
}
i++;
}
}
function AI_makeInvincible_init(paramArray) {
var i = 0;
while (i < paramArray.length) {
var ob = enemies["e" + paramArray[i]];
ob.hp = 99999999 /* 0x5F5E0FF */;
ob.invincible = true;
if ((((ob.colR == "00") and (ob.colG == "66")) and (ob.colB == "FF")) and (!ob.isGun)) {
_root.setColour(ob, "8C", "B1", "FF");
} else if ((((ob.colR == "66") and (ob.colG == "66")) and (ob.colB == "66")) and ob.isGun) {
_root.setColour(ob, "FC", "B7", "F4");
}
i++;
}
return("initOnly");
}
function AI_makeVulnerable_init(paramArray) {
var i = 0;
while (i < paramArray.length) {
var ob = enemies["e" + paramArray[i]];
ob.__proto__ = _root["e_" + ob.link].prototype;
ob.init();
ob.invincible = false;
i++;
}
return("initOnly");
}
function AI_makeSwitch_init(paramArray) {
var ob = enemies["e" + paramArray.shift()];
ob.deathTrigger.push(["destroy"].concat(paramArray));
return("initOnly");
}
function AI_makeTrigger_init(paramArray) {
var trigger = paramArray.shift();
if (trigger == "death") {
if (paramArray[0] == int(paramArray[0])) {
var sourceOb = enemies["e" + paramArray.shift()];
sourceOb.deathTrigger.push(paramArray);
} else {
var action = paramArray.shift();
if (action == "col") {
var col = paramArray.shift();
var ob = enemies["e" + paramArray.shift()];
ob.deathTrigger.push([action].concat([col].concat(paramArray)));
} else {
var ob = enemies["e" + paramArray.shift()];
ob.deathTrigger.push([action].concat(paramArray));
}
}
} else if (trigger == "time") {
var alreadyAdded = false;
var i = 0;
while (i < currentLvl_coreAIfunctions.length) {
if (currentLvl_coreAIfunctions[i][0] == timeTriggerCheck) {
alreadyAdded = true;
}
i++;
}
if (!alreadyAdded) {
addToCoreAIFunctions(timeTriggerCheck, null);
curFrame = 0;
}
var frameNum = paramArray.shift();
if (frameNum > 0) {
frameNum = int(frameNum) + curFrame;
if (timeArray[frameNum] == undefined) {
timeArray[frameNum] = [];
}
timeArray[frameNum].push([0].concat(paramArray));
} else {
timeTriggerExecute([0].concat(paramArray));
}
} else if (trigger == "timeRepeat") {
var alreadyAdded = false;
var i = 0;
while (i < currentLvl_coreAIfunctions.length) {
if (currentLvl_coreAIfunctions[i][0] == timeTriggerCheck) {
alreadyAdded = true;
}
i++;
}
if (!alreadyAdded) {
addToCoreAIFunctions(timeTriggerCheck, null);
curFrame = 0;
}
var frameNum = int(paramArray.shift());
var repeatInterval = int(paramArray.shift());
var totalFrameNum = (frameNum + curFrame);
if (repeatInterval < 1) {
messageTrace((((("Infinite loops are a bad idea:\nREPEAT_AFTER_FRAMES must be > 0\n\nHere's the guilty command:\nmakeTrigger,timeRepeat," + frameNum) + ",") + repeatInterval) + ",") + paramArray);
return(undefined);
}
if (frameNum > 0) {
if (timeArray[totalFrameNum] == undefined) {
timeArray[totalFrameNum] = [];
}
timeArray[totalFrameNum].push([1, repeatInterval].concat(paramArray));
} else {
timeTriggerExecute([1, repeatInterval].concat(paramArray));
}
}
return("initOnly");
}
function AI_disableGun_init(paramArray) {
var i = 0;
while (i < paramArray.length) {
var ob = enemies["e" + paramArray[i]];
setGunEnable(ob, false);
i++;
}
return("initOnly");
}
function AI_enableGun_init(paramArray) {
var i = 0;
while (i < paramArray.length) {
var ob = enemies["e" + paramArray[i]];
setGunEnable(ob, true);
i++;
}
return("initOnly");
}
function AI_destroy_init(paramArray) {
var i = 0;
while (i < paramArray.length) {
var ob = enemies["e" + paramArray[i]];
removeHP(ob, ob.hp, true);
checkHP(ob);
i++;
}
return("initOnly");
}
function AI_col_init(paramArray) {
var col = paramArray.shift();
var i = 0;
while (i < paramArray.length) {
var ob = enemies["e" + paramArray[i]];
setColour(ob, col);
i++;
}
return("initOnly");
}
function AI_waypoints_init(paramArray) {
delFromCoreAIFunctions(AI_waypoints, false);
var i = 0;
while (i < paramArray.length) {
paramArray[i] = Number(paramArray[i]);
i++;
}
coreVars.waypoints_count = 2;
return(paramArray);
}
function AI_waypoints(paramArray) {
var speed = paramArray[1];
var x = paramArray[coreVars.waypoints_count];
var y = paramArray[coreVars.waypoints_count + 1];
var xDist = (x - ai_ob._x);
var yDist = (y - ai_ob._y);
var dist = Math.sqrt((xDist * xDist) + (yDist * yDist));
if (dist < speed) {
ai_ob._x = x;
ai_ob._y = y;
} else {
var px = (xDist / dist);
var py = (yDist / dist);
ai_ob._x = ai_ob._x + (px * speed);
ai_ob._y = ai_ob._y + (py * speed);
}
if ((ai_ob._x == x) && (ai_ob._y == y)) {
if (coreVars.waypoints_count < (paramArray.length - 2)) {
coreVars.waypoints_count = coreVars.waypoints_count + 2;
} else if (paramArray[0]) {
coreVars.waypoints_count = 2;
} else {
delFromCoreAIFunctions(waypoints, false);
}
}
}
function AI_stop_init(paramArray) {
var funcStr = paramArray.shift();
var func = _root["AI_" + funcStr];
if (func != undefined) {
delFromCoreAIFunctions(func, true, paramArray);
} else if (funcStr == "makeTrigger") {
var trigger = paramArray.shift();
if (trigger == "timeRepeat") {
var frameNum = paramArray.shift();
var repeatInterval = paramArray.shift();
var lookingForThese = [1, repeatInterval].concat(paramArray);
var maxFramesAway = (int(frameNum) + int(repeatInterval));
var i = 0;
while (i <= maxFramesAway) {
if (timeArray[curFrame + i] != undefined) {
var j = 0;
while (j < timeArray[curFrame + i].length) {
var eventParams = timeArray[curFrame + i][j];
var equal = true;
var k = 0;
while (k < lookingForThese.length) {
if ((lookingForThese[k] != eventParams[k]) and (eventParams[k] != undefined)) {
equal = false;
}
k++;
}
if (equal) {
delete timeArray[curFrame + i][j];
return(undefined);
}
j++;
}
}
i++;
}
}
}
return("initOnly");
}
function AI_4_init() {
coreVars.waypoint = [random(STAGE_W), random(STAGE_H)];
coreVars.randomTime = random(240) + 90;
}
function AI_4() {
coreVars.aiCount++;
if (coreVars.aiCount == coreVars.randomTime) {
coreVars.randomTime = random(240) + 90;
coreVars.aiCount = 0;
if (random(100) < 80) {
coreVars.AIrotateMode = AI_randomRotate;
} else {
coreVars.AIrotateMode = AI_rotateToShip;
}
if (random(100) < 80) {
coreVars.AImoveMode = AI_randomWaypoints;
} else {
coreVars.AImoveMode = AI_followShip;
}
}
coreVars.AImoveMode();
coreVars.AIrotateMode();
}
function AI_coreGun_spread() {
ai_ob.delay++;
if (ai_ob.delay == 100) {
roundSnd.start(0, 0);
var g = 0;
while (g < 25) {
enemy_fireBullet(ai_ob, "round", g * 14.4, enemy_pixelBullets, true);
g++;
}
ai_ob.gun_a = random(25);
}
if (ai_ob.delay >= 180) {
ai_ob.gun_a++;
enemy_fireBullet(ai_ob, "round", ai_ob.gun_a * 14.4, enemy_pixelBullets, true);
if (ai_ob.delay % 2) {
roundSnd.start(0, 0);
}
}
if (ai_ob.delay >= 186) {
ai_ob.gun_a = 0;
ai_ob.delay = 0;
}
}
function AI_coreGun_4way_2shot() {
ai_ob.delay++;
if (ai_ob.delay == 50) {
roundSnd.start(0, 0);
var g = 0;
while (g < 4) {
enemy_fireBullet(ai_ob, "round", ((g * 90) - 5) + ai_ob.gun_a, enemy_pixelBullets, true);
enemy_fireBullet(ai_ob, "round", ((g * 90) + 5) + ai_ob.gun_a, enemy_pixelBullets, true);
g++;
}
ai_ob.gun_a = random(360);
ai_ob.delay = 0;
}
}
function AI_coreGun_double() {
ai_ob.delay++;
if (ai_ob.delay == 90) {
var a = random(360);
enemy_fireBullet(ai_ob, "spike", a, enemy_pixelBullets, true);
enemy_fireBullet(ai_ob, "spike", a + 10, enemy_pixelBullets, false);
ai_ob.delay = 0;
}
}
function AI_coreGun_twinRapid() {
ai_ob.delay++;
if (ai_ob.delay >= 90) {
ai_ob.delay2++;
if (ai_ob.delay2 == 3) {
enemy_fireBullet(ai_ob, "spike", ai_ob.gun_a, enemy_pixelBullets, true);
enemy_fireBullet(ai_ob, "spike", 180 - ai_ob.gun_a, enemy_pixelBullets, false);
ai_ob.gun_a = ai_ob.gun_a + 8;
ai_ob.delay2 = 0;
if (ai_ob.delay >= 158) {
ai_ob.delay = 0;
ai_ob.gun_a = random(360);
}
}
}
}
var $amd;
var $bmd;
var $cmd;
$amd = _url.substr(0, _url.indexOf(":"));
if ($amd == "http") {
$bmd = _url.indexOf("//");
$cmd = _url.substr($bmd + 2, (_url.indexOf("/", $bmd + 2) - $bmd) - 2);
$cmd = $cmd.toLowerCase();
if ($cmd.indexOf("www.mochiads.com") != -1) {
$cmd = $cmd.substr($cmd.indexOf("www.mochiads.com") + 4, $cmd.length);
}
if ($cmd.indexOf("mochiads.com") == -1) {
gotoAndStop (7);
return(undefined);
}
} else {
gotoAndStop (7);
urlTxt = _url;
return(undefined);
}
var codeWithFormatting = [];
var codeCount;
var core;
var ed_levelOpen = false;
var ed_prevSelection = [];
var ed_autoBackup_intervalID;
var d_ship = 1;
var d_shipAimer = 2;
var d_lifeCount = 3;
var d_fpsCounter = 4;
var d_allEnemies = 100;
var d_allEnemyBullets = 101;
var d_allEnemyBullets2 = 102;
var d_allEnemyBullets3 = 103;
var d_allBullets = 104;
var d_coreExplosion = 108;
var d_coreTemp = 109;
var d_allExp = 110;
var d_tutorial = 300;
var d_hierarchyLines = 499;
var d_library = 500;
var d_output = 501;
var d_tools = 502;
var d_coreAIwindow = 503;
var d_saveAs = 504;
var d_register = 505;
var d_gallery = 506;
var d_edTutorial = 507;
var d_pauseMenu = 508;
var d_miniPauseMenu = 509;
var d_countdown = 510;
var d_properties = 511;
var d_login = 512;
var d_renameWin = 513;
var d_gallery_getID = 514;
var d_textEdit = 515;
var d_fileMenuWin = 516;
var d_mochiad = 517;
var d_keySettings = 518;
var d_bullets = 0;
var d_maxBullets = 1000;
var d_bulletsDestroyable = (d_maxBullets + 1);
var d_e = 0;
var d_exp = 0;
var d_levelMsgWin = 200;
var d_ideHelpTxt = 604;
var d_messageWin = 605;
var d_onEnterFrameFix = 606;
var startingLives = 1;
var mouseDown = false;
var lives;
var currentLvl = 0;
var endLevel = 10;
var currentLvl_coreGunAI;
var currentLvl_coreAIfunctions = [];
var coreVars = new Object();
var ai_ob;
var currentLvlObject = {};
var campaignMode;
var STAGE_W = 800;
var STAGE_H = 600;
var SHIP_GUN_DELAY = 3;
var SHIP_GUN_DAMAGE = 100;
var SHIP_SPEED = 8;
var keyReleased = false;
var PI = Math.PI;
var PI_180 = (Math.PI/180);
var bulletSpeed = 10;
var destroyChildrenArray = [];
var gunArray = [];
var bonusHP = 300;
var temp;
var temp2;
var loginOb = {};
var curFrame;
var timeArray = [];
var keyListener = new Object();
Key.addListener(keyListener);
var userSettings_so = SharedObject.getLocal("userSettings");
var login_so = SharedObject.getLocal("zfsave");
var editorBackup_so = SharedObject.getLocal("editorBackup");
var key_aim;
var key_move;
var detectKeys_function;
var key_left;
var key_right;
var key_up;
var key_down;
var key_aimLeft;
var key_aimRight;
var key_aimDown;
var key_aimUp;
var key_shoot;
var key_pause;
var key_ed_up;
var key_ed_down;
var key_ed_left;
var key_ed_right;
var key_ed_rotateLeft1;
var key_ed_rotateRight1;
var key_ed_rotateLeft45;
var key_ed_rotateRight45;
var key_ed_delete;
var key_ed_lock;
var key_ed_nextParent;
var key_ed_prevParent;
var key_ed_xscale;
var key_ed_yscale;
var key_ed_xyscale;
var key_ed_duplicate;
var key_ed_selAll;
var key_ed_selCore;
codeName = [];
codeName[3] = "break";
codeName[8] = "backspace";
codeName[9] = "tab";
codeName[12] = "clear";
codeName[13] = "enter";
codeName[16] = "shift";
codeName[17] = "control";
codeName[18] = "alt";
codeName[19] = "pause";
codeName[20] = "capslock";
codeName[27] = "escape";
codeName[32] = "spacebar";
codeName[33] = "pageup";
codeName[34] = "pagedown";
codeName[35] = "end";
codeName[36] = "home";
codeName[37] = "left";
codeName[38] = "up";
codeName[39] = "right";
codeName[40] = "down";
codeName[45] = "insert";
codeName[46] = "delete";
codeName[47] = "help";
codeName[48] = "0";
codeName[49] = "1";
codeName[50] = "2";
codeName[51] = "3";
codeName[52] = "4";
codeName[53] = "5";
codeName[54] = "6";
codeName[55] = "7";
codeName[56] = "8";
codeName[57] = "9";
codeName[65] = "A";
codeName[66] = "B";
codeName[67] = "C";
codeName[68] = "D";
codeName[69] = "E";
codeName[70] = "F";
codeName[71] = "G";
codeName[72] = "H";
codeName[73] = "I";
codeName[74] = "J";
codeName[75] = "K";
codeName[76] = "L";
codeName[77] = "M";
codeName[78] = "N";
codeName[79] = "O";
codeName[80] = "P";
codeName[81] = "Q";
codeName[82] = "R";
codeName[83] = "S";
codeName[84] = "T";
codeName[85] = "U";
codeName[86] = "V";
codeName[87] = "W";
codeName[88] = "X";
codeName[89] = "Y";
codeName[90] = "Z";
codeName[91] = "Windows key";
codeName[93] = "Context menu";
codeName[96] = "numbpad0";
codeName[97] = "numbpad1";
codeName[98] = "numbpad2";
codeName[99] = "numbpad3";
codeName[100] = "numbpad4";
codeName[101] = "numbpad5";
codeName[102] = "numbpad6";
codeName[103] = "numbpad7";
codeName[104] = "numbpad8";
codeName[105] = "numbpad9";
codeName[106] = "numbpad*";
codeName[107] = "numbpad+";
codeName[108] = "numbpadenter";
codeName[109] = "numbpad-";
codeName[110] = "numbpad.";
codeName[111] = "numbpad/";
codeName[112] = "F1";
codeName[113] = "F2";
codeName[114] = "F3";
codeName[115] = "F4";
codeName[116] = "F5";
codeName[117] = "F6";
codeName[118] = "F7";
codeName[119] = "F8";
codeName[120] = "F9";
codeName[121] = "F10";
codeName[122] = "F11";
codeName[123] = "F12";
codeName[124] = "F13";
codeName[125] = "F14";
codeName[126] = "F15";
codeName[144] = "numlock";
codeName[145] = "Scroll lock";
codeName[186] = ";";
codeName[187] = "=";
codeName[188] = ",";
codeName[189] = "-";
codeName[190] = ".";
codeName[191] = "/";
codeName[192] = "`";
codeName[219] = "[";
codeName[220] = "\\";
codeName[221] = "]";
codeName[222] = "'";
if (userSettings_so.data.left != undefined) {
op_volume = userSettings_so.data.volume;
_quality = userSettings_so.data.qual;
if (userSettings_so.data.showFPS == (fpsCounter == undefined)) {
toggleFPScounter();
}
key_aim = userSettings_so.data.aim;
key_move = userSettings_so.data.move;
key_left = userSettings_so.data.left;
key_right = userSettings_so.data.right;
key_up = userSettings_so.data.up;
key_down = userSettings_so.data.down;
key_aimLeft = userSettings_so.data.aimLeft;
key_aimRight = userSettings_so.data.aimRight;
key_aimUp = userSettings_so.data.aimUp;
key_aimDown = userSettings_so.data.aimDown;
key_shoot = userSettings_so.data.shoot;
key_pause = userSettings_so.data.pause;
key_ed_up = userSettings_so.data.ed_up;
key_ed_down = userSettings_so.data.ed_down;
key_ed_left = userSettings_so.data.ed_left;
key_ed_right = userSettings_so.data.ed_right;
key_ed_rotateLeft1 = userSettings_so.data.ed_rotateLeft1;
key_ed_rotateRight1 = userSettings_so.data.ed_rotateRight1;
key_ed_rotateLeft45 = userSettings_so.data.ed_rotateLeft45;
key_ed_rotateRight45 = userSettings_so.data.ed_rotateRight45;
key_ed_delete = userSettings_so.data.ed_delete;
key_ed_lock = userSettings_so.data.ed_lock;
key_ed_nextParent = userSettings_so.data.ed_nextParent;
key_ed_prevParent = userSettings_so.data.ed_prevParent;
key_ed_xscale = userSettings_so.data.ed_xscale;
key_ed_yscale = userSettings_so.data.ed_yscale;
key_ed_xyscale = userSettings_so.data.ed_xyscale;
key_ed_duplicate = userSettings_so.data.ed_duplicate;
key_ed_selAll = userSettings_so.data.ed_selAll;
key_ed_selCore = userSettings_so.data.ed_selCore;
} else {
setDefaultControls();
}
createTextField("ideHelpTxt", d_ideHelpTxt, 0, 0, 800, 100);
ideHelpTxt.autoSize = true;
ideHelpTxt.selectable = false;
ideHelpTxt.background = true;
ideHelpTxt.backgroundColor = "0x444444";
ideHelpTxt.html = true;
ideHelpTxt.setTxt = function (txt) {
if (txt == undefined) {
this._visible = false;
} else {
this._visible = true;
this.htmlText = ("<font color=\"#FFFFFF\">" + txt) + "</font>";
this._x = _xmouse + 20;
this._y = _ymouse + 20;
if ((this._y + this._height) > STAGE_H) {
this._y = STAGE_H - this._height;
}
if ((this._x + this._width) > STAGE_W) {
this._x = STAGE_W - this._width;
}
if (this._y < 0) {
this._y = 0;
}
if (this._x < 0) {
this._x = 0;
}
}
};
ideHelpTxt.setTxt();
ideHelpTxt._alpha = 50;
var level0 = new Object();
level0.init = function () {
lives = 1;
lifeCount.update();
attachMovie("tutorial", "tutorial", d_tutorial);
};
level0.AI = ["", ["AI_randomRotate"]];
level0.code = [["core", 400, 200, 0, 1, 1, -1, 0], ["tri", -33, 4, 45, 1, 1, "e0", 1], ["tri", 34, 4, -45, 1, 1, "e0", 2], ["jet", 48, -34, 168, 1, 1, "e0", 5], ["tri", -13, -36, 41, 1, 1, "e5", 7], ["jet", -48, -34, -167, 1, 1, "e0", 4], ["tri", 13, -36, -41, 1, 1, "e4", 6]];
var level1 = new Object();
level1.AI = ["AI_coreGun_double", ["AI_randomRotate"], ["AI_randomWaypoints"]];
level1.code = [["core", 400, 200, 0, 1, 1, -1, 0], ["rhombus", -51.95, 0, 180, 1, 1, "e0", 3], ["single", -23, 2, 45, 1, 1, "e3", 7], ["rhombus", -51.95, -37, 135, 1, 1, "e0", 2], ["single", -23, -2, 135, 1, 1, "e2", 8], ["rhombus", 52, -37, 0, 1, 1, "e0", 1], ["single", 23, -1, -135, 1, 1, "e1", 5], ["rhombus", 52, 0, 135, 1, 1, "e0", 4], ["single", 24, 0, -45, 1, 1, "e4", 6]];
var level2 = new Object();
level2.AI = ["AI_coreGun_4way_2shot", ["AI_randomRotate"], ["AI_randomWaypoints"]];
level2.code = [["core", 400, 200, 0, 1, 1, -1, 0], ["rhombus", -53, -2, 0, 1, 1, "e0", 1], ["box", -18, -65, -90, 1, 1, "e1", 3], ["tri", 28, -40, 60, 1, 1, "e3", 7], ["single", 6, -4, -125, 1, 1, "e7", 9], ["rhombus", -26, 27, 45, 1, 1, "e1", 11], ["jet", -30.95, -29, 90, 1, 1, "e11", 19], ["tri", -39, 1, 90, 1, 1, "e19", 20], ["spread", -13, 1, 0, 1, 1, "e20", 22], ["jet", 32, 37, -30, 1, 1, "e11", 13], ["square", 16, 28, -30, 1, 1, "e13", 16], ["box", 74, -66, -90, 1, 1, "e0", 4], ["tri", -27, -39, -60, 1, 1, "e4", 8], ["single", -7, -4, 125, 1, 1, "e8", 10], ["rhombus", 52, -1, 135, 1, 1, "e0", 2], ["rhombus", 26, 27, 90, 1, 1, "e2", 12], ["jet", 31, -29, -90, 1, 1, "e12", 17], ["tri", 38, 0, -90, 1, 1, "e17", 18], ["spread", 13, 0, 0, 1, 1, "e18", 21], ["jet", -32, 35, 35, 1, 1, "e12", 14], ["square", -19, 27, 40, 1, 1, "e14", 15]];
var level3 = new Object();
level3.AI = ["AI_coreGun_4way_2shot", ["AI_4"]];
level3.code = [["core", 400, 200, 0, 1, 1, -1, 0], ["smallbox", -46, 1, -145, 1, 1, "e0", 3], ["rhombus", -25, -49, 135, 1, 1, "e3", 7], ["jet", 41, -34, 85, 1, 1, "e7", 25], ["tri", 8, -21, -25, 1, 1, "e25", 27], ["single", 9, -11, -140, 1, 1, "e27", 29], ["tri", -33, -22, 125, 1, 1, "e3", 5], ["single", -9, 4, 70, 1, 1, "e5", 38], ["box", -28, 53, 115, 1, 1, "e3", 9], ["square", 17, 27, -55, 1, 1, "e9", 33], ["rhombus", -43, 52, 160, 1, 1, "e9", 12], ["single", 18, 10, -45, 1, 1, "e12", 31], ["smallbox", -30, -26, 175, 1, 1, "e12", 15], ["single", -1, -13, -150, 1, 1, "e15", 39], ["jet", -45, -7, 140, 1, 1, "e15", 17], ["jet", -38, -45, -40, 1, 1, "e17", 22], ["spread", 1, 2, 0, 1, 1, "e22", 36], ["smallbox", 44, 3, -35, 1, 1, "e0", 2], ["tri", 33, -22, -125, 1, 1, "e2", 4], ["single", 11, 5, -70, 1, 1, "e4", 37], ["rhombus", -8, -27, 0, 1, 1, "e4", 6], ["jet", -42, -35, -80, 1, 1, "e6", 26], ["tri", -5, -22, 30, 1, 1, "e26", 28], ["single", -6, -11, 145, 1, 1, "e28", 30], ["box", 28, 53, 65, 1, 1, "e2", 8], ["square", -17, 26, 60, 1, 1, "e8", 34], ["rhombus", 41.95, 52, 155, 1, 1, "e8", 11], ["single", -20.95, 12, 45, 1, 1, "e11", 32], ["smallbox", 30, -25, 5, 1, 1, "e11", 14], ["single", 6, -17, 155, 1, 1, "e14", 40], ["jet", 46, -10, -145, 1, 1, "e14", 16], ["jet", 34, -48, 35, 1, 1, "e16", 21], ["spread", -2, 3, 0, 1, 1, "e21", 35]];
var level4 = new Object();
level4.AI = ["AI_coreGun_spread", ["AI_randomRotate"], ["AI_randomWaypoints"], ["AI_rotatePart", 1, 0.4, -10, 90, 0], ["AI_rotatePart", 2, 0.4, -10, 90, 0], ["AI_rotatePart", 6, 0.4, 0, 90, 0], ["AI_rotatePart", 5, 0.4, 0, 90, 0]];
level4.code = [["core", 400, 200, 0, 1, 1, -1, 0], ["circle", -51, 9, 0, 1, 1, "e0", 2], ["jet", -39, 38, -135, 1, 1, "e2", 3], ["single", -10, -15, 135, 1, 1, "e3", 14], ["circle", 10, 37, 90, 1, 1, "e3", 5], ["tri", -17, 14.95, -135, 1, 1, "e5", 17], ["square", -13, 13, 45, 1, 1, "e17", 19], ["jet", 38, 0, -90, 1, 1, "e5", 7], ["single", 7, 15.95, 0, 1, 1, "e7", 13], ["box", 75.95, 1, 180, 1, 1, "e7", 9], ["spread", 46, 32.95, 0, 1, 1, "e9", 11], ["circle", 47.95, -48, 180, 1, 1, "e0", 1], ["jet", 38, -39, 45, 1, 1, "e1", 4], ["single", 10, 11, -45, 1, 1, "e4", 16], ["circle", -10, -37, -90, 1, 1, "e4", 6], ["tri", 17, -16, 45, 1, 1, "e6", 18], ["square", 13, -11, -135, 1, 1, "e18", 20], ["jet", -38, 2, 90, 1, 1, "e6", 8], ["single", -4, -17, 180, 1, 1, "e8", 15], ["box", -75.95, -1, 0, 1, 1, "e8", 10], ["spread", -45, -30, 0, 1, 1, "e10", 12]];
var level5 = new Object();
level5.AI = ["AI_coreGun_spread", ["AI_randomRotate"], ["AI_randomWaypoints"], ["AI_rotatePart", 3, 1, 0, 0, 0], ["AI_rotatePart", 4, -1, 0, 0, 90]];
level5.code = [["core", 400, 200, 0, 1, 1, -1, 0], ["tri", 0, 65.95, 0, 1, 1, "e0", 25], ["tri", 34, 2, -45, 1, 1, "e0", 22], ["tri", -35, 2, 45, 1, 1, "e0", 21], ["tri", 17, -57, -135, 1, 1, "e0", 26], ["tri", -18, -57, 135, 1, 1, "e0", 23], ["tri", -1, -74, 0, 1, 1, "e0", 27], ["stick", -99, -30, 180, 1, 1, "e0", 1], ["circle", -69.95, 1, 0, 1, 1, "e1", 3], ["smallbox", 1, -56, -90, 1, 1, "e3", 6], ["square", 26, -30, -90, 1, 1, "e6", 17], ["box", 1, -77, 90, 1, 1, "e6", 11], ["single", -31, -44, 90, 1, 1, "e11", 16], ["smallbox", -1, 55, 90, 1, 1, "e3", 5], ["square", -24, 31, 90, 1, 1, "e5", 19], ["box", -1, 76.95, -90, 1, 1, "e5", 12], ["single", 30, 45, -90, 1, 1, "e12", 13], ["stick", 98, -31, 180, 1, 1, "e0", 2], ["circle", 70, 0, 0, 1, 1, "e2", 4], ["smallbox", 1, 56, 90, 1, 1, "e4", 8], ["square", -23, 32, 90, 1, 1, "e8", 20], ["box", -1, 76.95, -90, 1, 1, "e8", 9], ["single", 30, 44, -90, 1, 1, "e9", 14], ["smallbox", 1, -56, -90, 1, 1, "e4", 7], ["square", 23, -31, -90, 1, 1, "e7", 18], ["box", 0, -77, 90, 1, 1, "e7", 10], ["single", -30, -42, 90, 1, 1, "e10", 15]];
var level6 = new Object();
level6 = editor_getLevelFromString("AI_coreGun_spread|AI_rotatePart,4,1,-45,90,0|AI_rotatePart,3,1,-90,45,-45|AI_randomWaypoints|AI_randomRotate<>core,400,300,0,1,1,-1,0|stick,33,59,-90,1,1,e0,20|tri,-17,34,90,1,1,e20,24|jet,-3,81,102,1,1,e20,22|laser,26,-8,-51,1,1,e22,27|stick,-34,58,90,1,1,e0,19|tri,18,35,-90,1,1,e19,25|spread,16,-2,0,1,1,e25,23|jet,3,81,-101,1,1,e19,21|laser,-26,-8,-126,1,1,e21,26|tube2,51,-61,135,1,1,e0,2|single,-15,-22,146,1,1,e2,15|circle,42,-44,0,1,1,e2,4|tube2,0,-60,-90,1,1,e4,7|smallbox,55,-14,180,1,1,e7,11|laser,30,21,11,1,1,e11,13|tube2,-50,-64,45,1,1,e0,1|single,12,-20,-147,1,1,e1,14|circle,-43,-42,0,1,1,e1,3|tube2,-1,-60,-90,1,1,e3,6|smallbox,-55,-15,0,1,1,e6,10|laser,-29,20,169,1,1,e10,12");
var level7 = new Object();
level7 = editor_getLevelFromString("AI_coreGun_twinRapid|AI_rotatePart,5,1,0,0,0|AI_makeSwitch,18,9,7,8,10,23,24|AI_rotateToShip|AI_followShip|AI_<>core,400,300,0,1,1,-1,0|laser,44,8,90,1,1,e0,20|laser,-42,7,90,1,1,e0,19|switch1,0,76,0,1,1,e0,18|tri,0,-66,0,1,1,e0,6|circle,0,-31,0,1,1,e6,5|laser,0,-27,-90,1,1,e5,4|oddbox,33,-70,-64,1,1,e0,3|forcefieldLine,64,155,90,1,1,e3,23|single,87,8,180,1,1,e3,16|single,102,14,-135,1,1,e3,15|tube,127,36,-64,1,1,e3,12|spread,-19,41,0,1,1,e12,22|forcefieldLine,88,-10,0,1,1,e3,10|forcefieldLine,1,-46,42,1,1,e3,8|oddbox2,-33,-71,66,1,1,e0,1|forcefieldLine,-69,153,90,1,1,e1,24|single,-91,6,180,1,1,e1,17|single,-101,12,135,1,1,e1,14|tube,-128,34,-114,1,1,e1,13|spread,17,41,0,1,1,e13,21|forcefieldLine,-91,-12,180,1,1,e1,9|forcefieldLine,-5,-44,-44,1,1,e1,7");
var level8 = new Object();
level8.AI = ["AI_coreGun_spread", ["AI_rotatePartToShip", 9], ["AI_rotatePartToShip", 10], ["AI_randomWaypoints"], ["AI_randomRotate"], ["AI_rotatePart", 29, 1, 0, 180, 0], ["AI_rotatePart", 30, 1, -180, 0, 0]];
level8.code = [["core", 400, 200, 0, 1, 1, -1, 0], ["rhombus", 53, -37, 0, 1, 1, "e0", 4], ["rhombus", 27, -27, 45, 1, 1, "e4", 6], ["tri", -27, -38, -36, 1, 1, "e6", 28], ["square", -29, -17, 90, 1, 1, "e6", 18], ["rhombus", -51, -38, 135, 1, 1, "e0", 3], ["rhombus", -27.95, -25, 90, 1, 1, "e3", 5], ["tri", 27.95, -38, 38, 1, 1, "e5", 27], ["square", 27.95, -17, -90, 1, 1, "e5", 17], ["oddbox2", 40.95, 7, -45, 1, 1, "e0", 2], ["laser", 81.05, 85, 111, 1, 1, "e2", 30], ["smallbox", 21.05, 80.95, 57, 1, 1, "e2", 21], ["smallbox", -27, 11, 81, 1, 1, "e21", 23], ["spread", -17, -30.95, 0, 1, 1, "e23", 34], ["spread", -15, 32, 0, 1, 1, "e23", 25], ["tube2", 116.1, -17, 114, 1, 1, "e2", 7], ["circle", 23.95, -55, 0, 1, 1, "e7", 9], ["single", 19, -16, 174, 1, 1, "e9", 16], ["single", -18, -16, -169, 1, 1, "e9", 15], ["single", 1, -22, -180, 1, 1, "e9", 14], ["oddbox", -41.05, 7, 45, 1, 1, "e0", 1], ["laser", -78.95, 88, 68, 1, 1, "e1", 29], ["smallbox", -19.9, 79.95, 123, 1, 1, "e1", 20], ["smallbox", 26.95, 10, 99, 1, 1, "e20", 22], ["spread", 12, -28.95, 0, 1, 1, "e22", 33], ["spread", 14, 34, 0, 1, 1, "e22", 24], ["tube2", -115, -16.05, 65, 1, 1, "e1", 8], ["circle", -26, -54, 0, 1, 1, "e8", 10], ["single", 19, -19, 165, 1, 1, "e10", 13], ["single", -19, -17, -170, 1, 1, "e10", 12], ["single", 0, -23, 180, 1, 1, "e10", 11]];
var level9 = new Object();
level9.AI = ["AI_coreGun_4way_2shot", ["AI_rotatePart", 22, 0.5, 0, 0, 0], ["AI_rotatePart", 24, 0.5, 0, 45, 0], ["AI_rotatePartToShip", 25], ["AI_rotatePartToShip", 31], ["AI_makeInvincible", 51], ["AI_makeSwitch", 61, 50], ["AI_makeSwitch", 60, 49], ["AI_makeSwitch", 62, 47], ["AI_makeSwitch", 63, 48], ["AI_randomWaypoints"], ["AI_coreGun_double"]];
level9.code = [["core", 382, 273, 0, 1, 1, -1, 0], ["switch2", -28, -41, -45, 1, -0.3, "e0", 63], ["switch2", 28, -41, 45, -1, -0.3, "e0", 62], ["switch2", 29, 4, -45, -1, 0.3, "e0", 61], ["switch2", -29, 4, 45, 1, 0.3, "e0", 60], ["switch1b", 0, 0, 0, 0.01, 0.01, "e0", 22], ["forcefieldLine", -47, -94, 0, 1, -1, "e22", 50], ["forcefieldLine", 47, 94, 0, -1, 1, "e22", 48], ["forcefieldLine", -47, 94, 0, 1, 1, "e22", 47], ["forcefieldLine", 94, -188, 0, -1, -1, "e47", 49], ["switch2b", 116, -3, 0, 1, 1, "e22", 24], ["circle", -1, 0, 0, 0.7, 0.7, "e24", 58], ["switch3b", -1, 0, 0, 1.3, 1.3, "e58", 59], ["switch3b", -208, 88, 0, 1.2, 1.2, "e24", 51], ["singu", -208, 88, 0, 1, 1, "e24", 23], ["oddbox2", -13, 133, 90, -0.6, 0.8, "e22", 8], ["oddbox", 15, 133, -90, -0.6, 0.8, "e22", 7], ["oddbox", 15, -144, 90, -0.6, -0.8, "e22", 6], ["oddbox2", -13, -144, -90, -0.6, -0.8, "e22", 5], ["oddbox", -138, 8, 0, -0.6, 0.8, "e22", 4], ["oddbox2", -138, -19, 180, -0.6, 0.8, "e22", 3], ["oddbox2", 139, -51, -180, 0.6, 0.5, "e22", 2], ["switch1", -3, 48, -90, -0.5, 0.4, "e2", 57], ["switch1", -3, 22, -90, -0.5, 0.4, "e2", 53], ["switch1", 10, 22, 90, 0.5, 0.4, "e2", 52], ["circle", -9, -49, 0, 1, 1, "e2", 25], ["tube2", -1, -66, -90, 1.2, 0.9, "e25", 28], ["tri", -15, -47, -65, -0.6, 0.5, "e28", 30], ["tri", 16, -48, 65, 0.6, 0.5, "e28", 29], ["singu", -1, -123, 0, 1, 1, "e25", 26], ["oddbox", 139, 42, 0, 0.6, 0.5, "e22", 1], ["switch1", 11, -46, 90, 0.5, 0.4, "e1", 56], ["switch1", -3, -21, -90, -0.5, 0.4, "e1", 55], ["switch1", 11, -21, 90, 0.5, 0.4, "e1", 54], ["circle", -9, 58, 180, 1, -1, "e1", 31], ["tube2", 0, -66, -90, 1.2, -0.9, "e31", 32], ["single", -10, -47, -180, 1, 1, "e32", 65], ["single", -6, -49, -180, 1, 1, "e32", 67], ["single", -2, -51, -180, 1, 1, "e32", 69], ["single", 2, -51, -180, 1, 1, "e32", 71], ["single", 6, -49, -180, 1, 1, "e32", 73], ["single", 10, -47, -180, 1, 1, "e32", 75], ["tri", -15, -46, -115, -0.6, -0.5, "e32", 34], ["tri", 16, -46, 115, 0.6, -0.5, "e32", 33]];
var level10 = new Object();
level10.AI = ["AI_coreGun_twinRapid", ["AI_rotatePart", 7, -0.4, -20, 60, 0], ["AI_rotatePart", 5, 0.4, -60, 20, 0], ["AI_randomWaypoints"], ["AI_randomRotate"]];
level10.code = [["core", 400, 200, 0, 1, 1, -1, 0], ["rhombus", 26, 25, 90, 1, 1, "e0", 18], ["singu", 0, -56, 0, 1, 1, "e0", 53], ["rhombus", 37, 1, 45, 1, 1, "e18", 23], ["smallbox", 49, 14, 180, 1, 1, "e23", 26], ["laser", -4, -29, -13, 1, 1, "e26", 51], ["jet", 44, 0, -90, 1, 1, "e26", 27], ["jet", 59, 0, 90, 1, 1, "e27", 31], ["tri", 21, -1, -90, 1, 1, "e31", 29], ["spread", 14, 0, 0, 1, 1, "e29", 39], ["stick", 7, 85, -90, 1, 1, "e18", 20], ["single", -15, 48, 54, 1, 1, "e20", 38], ["single", -15, 5, 6, 1, 1, "e20", 36], ["single", -16, -41, 14, 1, 1, "e20", 34], ["oddbox2", 39, -30, 0, 1, 1, "e20", 22], ["rhombus", -28, 23, -135, 1, 1, "e0", 17], ["rhombus", -36, 3, 90, 1, 1, "e17", 24], ["smallbox", -49, 11, 0, 1, 1, "e24", 25], ["laser", 1, -27, -169, 1, 1, "e25", 52], ["jet", -43, 0, 90, 1, 1, "e25", 28], ["jet", -59, 0, -90, 1, 1, "e28", 32], ["tri", -21, -1, 90, 1, 1, "e32", 30], ["spread", -14, 0, 0, 1, 1, "e30", 40], ["stick", -8, 84, 90, 1, 1, "e17", 19], ["single", 9, 50, -50, 1, 1, "e19", 37], ["single", 12, 9, -13, 1, 1, "e19", 35], ["single", 15, -38, -18, 1, 1, "e19", 33], ["oddbox", -39, -31, 0, 1, 1, "e19", 21], ["tube2", 53, -61, 135, 1, 1, "e0", 2], ["circle", 40, -42, 0, 1, 1, "e2", 5], ["tube", 41, -41, -45, 1, 1, "e5", 14], ["laser", -21, -30, -67, 1, 1, "e14", 44], ["laser", 33, 19, -21, 1, 1, "e14", 43], ["tube", 46, -68, -60, 1, 1, "e14", 15], ["tube2", 34, 34, 135, 1, 1, "e2", 4], ["circle", 40, -39, 0, 1, 1, "e4", 6], ["tube", 58, 0, 0, 1, 1, "e6", 9], ["tube", 82, 5, 6, 1, 1, "e9", 11], ["single", 46, -10, -135, 1, 1, "e11", 47], ["single", 31, -22, 180, 1, 1, "e11", 46], ["spread", 35, 30, 0, 1, 1, "e11", 45], ["tube2", -51, -62, 46, 1, 1, "e0", 1], ["circle", -41, -40, 0, 1, 1, "e1", 7], ["tube", -43, -41, -135, 1, 1, "e7", 13], ["laser", 20, -33, -110, 1, 1, "e13", 42], ["laser", -35, 15, -158, 1, 1, "e13", 41], ["tube", -48, -65, -123, 1, 1, "e13", 16], ["tube2", -35, 33, 45, 1, 1, "e1", 3], ["circle", -43, -40, 0, 1, 1, "e3", 8], ["tube", -59, 0, 180, 1, 1, "e8", 10], ["tube", -79, 2, 177, 1, 1, "e10", 12], ["spread", -31, 26, 0, 1, 1, "e12", 50], ["single", -39, -22, 135, 1, 1, "e12", 49], ["single", -20, -25, 180, 1, 1, "e12", 48]];
volumeMasterSnd = new Sound(this);
volumeMasterSnd.setVolume(op_volume);
delete op_volume;
createEmptyMovieClip("volume15", 701);
volume15Snd = new Sound(volume15);
volume15Snd.setVolume(15);
createEmptyMovieClip("volume30", 700);
volume30Snd = new Sound(volume30);
volume30Snd.setVolume(30);
createEmptyMovieClip("volume60", 702);
volume60Snd = new Sound(volume60);
volume60Snd.setVolume(60);
createEmptyMovieClip("volume100", 703);
volume100Snd = new Sound(volume100);
volume100Snd.setVolume(100);
expSnd = new Sound(volume100);
expSnd.attachSound("expSnd");
tinyShotSnd = new Sound(volume100);
tinyShotSnd.attachSound("tinyShotSnd");
tinyShot2Snd = new Sound(volume100);
tinyShot2Snd.attachSound("tinyshot2Snd");
bulletExpSnd = new Sound(volume100);
bulletExpSnd.attachSound("deepQuickHit.wav");
invincibleBulletExpSnd = new Sound(volume60);
invincibleBulletExpSnd.attachSound("lightQuickHit.mp3");
roundSnd = new Sound(volume100);
roundSnd.attachSound("roundSnd");
laser2Snd = new Sound(volume100);
laser2Snd.attachSound("laser2Snd");
squareSnd = new Sound(volume60);
squareSnd.attachSound("bosu33.wav");
spikeSnd = new Sound(volume30);
spikeSnd.attachSound("cursor04.wav");
laserSnd_start = new Sound(volume15);
laserSnd_start.attachSound("eco03(slow).wav");
singularitySnd = new Sound(volume30);
singularitySnd.attachSound("Fire.mp3");
e_Rhombus = function () {
};
e_Rhombus.prototype = new MovieClip();
e_Rhombus.prototype.init = function () {
this.hp = 1200;
_root.setColour(this, "0066FF");
};
e_Box = function () {
};
e_Box.prototype = new MovieClip();
e_Box.prototype.init = function () {
this.hp = 2200;
_root.setColour(this, "0066FF");
};
e_Oddbox = function () {
};
e_Oddbox.prototype = new MovieClip();
e_Oddbox.prototype.init = function () {
this.hp = 2800;
_root.setColour(this, "0066FF");
};
e_Oddbox2 = function () {
};
e_Oddbox2.prototype = new MovieClip();
e_Oddbox2.prototype.init = function () {
this.hp = 2800;
_root.setColour(this, "0066FF");
};
e_Circle = function () {
};
e_Circle.prototype = new MovieClip();
e_Circle.prototype.init = function () {
this.hp = 3000;
_root.setColour(this, "0066FF");
};
e_Jet = function () {
};
e_Jet.prototype = new MovieClip();
e_Jet.prototype.init = function () {
this.hp = 800;
_root.setColour(this, "0066FF");
};
e_Smallbox = function () {
};
e_Smallbox.prototype = new MovieClip();
e_Smallbox.prototype.init = function () {
this.hp = 1000;
_root.setColour(this, "0066FF");
};
e_Tri = function () {
};
e_Tri.prototype = new MovieClip();
e_Tri.prototype.init = function () {
this.hp = 800;
_root.setColour(this, "0066FF");
};
e_RightTri = function () {
};
e_RightTri.prototype = new MovieClip();
e_RightTri.prototype.init = function () {
this.hp = 1000;
_root.setColour(this, "0066FF");
};
e_Rect = function () {
};
e_Rect.prototype = new MovieClip();
e_Rect.prototype.init = function () {
this.hp = 1000;
_root.setColour(this, "0066FF");
};
e_Core = function () {
};
e_Core.prototype = new MovieClip();
e_Core.prototype.init = function () {
this.hp = 1000;
_root.setColour(this, "0066FF");
};
e_Core.prototype.gunAI = function () {
currentLvl_coreGunAI();
};
e_Stick = function () {
};
e_Stick.prototype = new MovieClip();
e_Stick.prototype.init = function () {
this.hp = 2000;
_root.setColour(this, "0066FF");
};
e_Stick2 = function () {
};
e_Stick2.prototype = new MovieClip();
e_Stick2.prototype.init = function () {
this.hp = 2000;
_root.setColour(this, "0066FF");
};
e_Tube = function () {
};
e_Tube.prototype = new MovieClip();
e_Tube.prototype.init = function () {
this.hp = 1500;
_root.setColour(this, "0066FF");
};
e_Tube2 = function () {
};
e_Tube2.prototype = new MovieClip();
e_Tube2.prototype.init = function () {
this.hp = 1500;
_root.setColour(this, "0066FF");
};
e_forcefieldLine = function () {
};
e_forcefieldLine.prototype = new MovieClip();
e_forcefieldLine.prototype.init = function () {
this.invincible = true;
this.hp = 99999999 /* 0x5F5E0FF */;
_root.setColour(this, "82B4FF");
};
e_switch1 = function () {
};
e_switch1.prototype = new MovieClip();
e_switch1.prototype.init = function () {
this.hp = 600;
_root.setColour(this, "0C6666");
};
e_switch1b = function () {
};
e_switch1b.prototype = new MovieClip();
e_switch1b.prototype.init = function () {
this.hp = 600;
_root.setColour(this, "0C6666");
};
e_switch2 = function () {
};
e_switch2.prototype = new MovieClip();
e_switch2.prototype.init = function () {
this.hp = 600;
_root.setColour(this, "952966");
};
e_switch2b = function () {
};
e_switch2b.prototype = new MovieClip();
e_switch2b.prototype.init = function () {
this.hp = 600;
_root.setColour(this, "952966");
};
e_switch3 = function () {
};
e_switch3.prototype = new MovieClip();
e_switch3.prototype.init = function () {
this.hp = 600;
_root.setColour(this, "0646B3");
};
e_switch3b = function () {
};
e_switch3b.prototype = new MovieClip();
e_switch3b.prototype.init = function () {
this.hp = 600;
_root.setColour(this, "0646B3");
};
e_switch4 = function () {
};
e_switch4.prototype = new MovieClip();
e_switch4.prototype.init = function () {
this.hp = 600;
_root.setColour(this, "8F79FE");
};
e_switch4b = function () {
};
e_switch4b.prototype = new MovieClip();
e_switch4b.prototype.init = function () {
this.hp = 600;
_root.setColour(this, "8F79FE");
};
e_c = function () {
};
e_c.prototype = new MovieClip();
e_c.prototype.init = function () {
this.hp = 2000;
_root.setColour(this, "0066FF");
};
e_Spread = function () {
};
e_Spread.prototype = new MovieClip();
e_Spread.prototype.init = function () {
this.hp = 1000;
_root.setColour(this, "666666");
var count = 0;
var i = 0;
while (i < gunArray.length) {
if (gunArray[i].link == "spread") {
count++;
}
i++;
}
this.isGun = true;
this.delay = (count * 30) % 492;
if (this.delay >= 260) {
this.anim.gotoAndPlay(this.delay - 259);
}
gunArray.push(this);
};
e_Spread.prototype.gunAI = function () {
this.delay++;
if (this.delay >= 260) {
if (this.delay == 265) {
this.anim.play();
} else if ((this.delay == 300) or (this.delay == 320)) {
var g = 0;
while (g < 12) {
enemy_fireBullet(this, "round", g * 30, enemy_pixelBullets);
g++;
}
} else if (this.delay >= 480) {
this.gun_a++;
enemy_fireBullet(this, "round", this.gun_a * 30, enemy_pixelBullets);
if (this.delay >= 492) {
this.gun_a = 0;
this.delay = 0;
}
}
}
};
e_Single = function () {
};
e_Single.prototype = new MovieClip();
e_Single.prototype.init = function () {
this.hp = 1000;
_root.setColour(this, "666666");
var count = 0;
var i = 0;
while (i < gunArray.length) {
if (gunArray[i].link == "single") {
count++;
}
i++;
}
this.isGun = true;
this.delay = (count * 15) % 120;
_root.gunArray.push(this);
};
e_Single.prototype.gunAI = function () {
this.delay++;
if (this.delay == 100) {
enemy_fireBullet(this, "round", this._rotation + 90, enemy_pixelBullets);
this.turret.play();
} else if (this.delay >= 120) {
enemy_fireBullet(this, "round", this._rotation + 90, enemy_pixelBullets);
this.delay = 0;
this.turret.play();
}
};
e_Square = function () {
};
e_Square.prototype = new MovieClip();
e_Square.prototype.init = function () {
this.hp = 1200;
_root.setColour(this, "666666");
var count = 0;
var i = 0;
while (i < gunArray.length) {
if (gunArray[i].link == "square") {
count++;
}
i++;
}
this.isGun = true;
this.delay = (count * 5) % 170;
_root.gunArray.push(this);
};
e_Square.prototype.gunAI = function () {
this.delay++;
if (this.delay == 110) {
this.fire.play();
} else if (this.delay >= 170) {
this.delay = 0;
}
};
e_Laser = function () {
};
e_Laser.prototype = new MovieClip();
e_Laser.prototype.init = function () {
this.hp = 1000;
_root.setColour(this, "666666");
var count = 0;
var i = 0;
while (i < gunArray.length) {
if ((gunArray[i].link == "laser") or (gunArray[i].link == "laser_")) {
count++;
}
i++;
}
this.isGun = true;
this.delay = (Math.floor(count / 2) * 15) % 120;
_root.gunArray.push(this);
};
e_Laser.prototype.gunAI = function () {
this.delay++;
if (this.delay == 50) {
enemy_fireBullet(this, "laser", this._rotation, enemy_shapeBullets);
} else if (this.delay >= 120) {
this.delay = 0;
}
};
e_Laser_ = function () {
};
e_Laser_.prototype = new MovieClip();
e_Laser_.prototype.init = function () {
this.hp = 1000;
_root.setColour(this, "666666");
var count = 0;
var i = 0;
while (i < gunArray.length) {
if (gunArray[i].link == "laser_") {
count++;
}
i++;
}
this.isGun = true;
this.delay = (Math.floor(count / 2) * 15) % 120;
_root.gunArray.push(this);
};
e_Laser_.prototype.gunAI = function () {
this.delay++;
if (this.delay == 50) {
enemy_fireBullet(this, "laser_", this._rotation, enemy_shapeBullets);
} else if (this.delay >= 120) {
this.delay = 0;
}
};
e_Singu = function () {
};
e_Singu.prototype = new MovieClip();
e_Singu.prototype.init = function () {
this.hp = 1000;
_root.setColour(this, "666666");
this.isGun = true;
var count = 0;
var i = 0;
while (i < gunArray.length) {
if (gunArray[i].link == "singu") {
count++;
}
i++;
}
this.delay = ((count * 20) + count) % 300;
_root.gunArray.push(this);
};
e_Singu.prototype.gunAI = function () {
this.delay++;
if (this.delay == 70) {
enemy_fireBullet(this, "Singularity", this._rotation, enemy_shapeBullets);
this.anim.play();
} else if (this.delay == 90) {
enemy_fireBullet(this, "Singularity", this._rotation, enemy_shapeBullets);
this.anim.play();
} else if (this.delay == 110) {
enemy_fireBullet(this, "Singularity", this._rotation, enemy_shapeBullets);
this.anim.play();
} else if (this.delay >= 300) {
enemy_fireBullet(this, "Singularity", this._rotation, enemy_shapeBullets);
this.anim.play();
this.delay = 0;
}
};
b_Round = function () {
};
b_Round.prototype = new MovieClip();
b_Round.prototype.init = function (angle) {
this.angle = angle;
this.angleRad = angle * (PI / 180);
this.v = 8;
};
b_Square = function () {
};
b_Square.prototype = new MovieClip();
b_Square.prototype.init = function (angle) {
this.angle = angle;
this.angleRad = angle * (PI / 180);
this.v = 7;
};
b_Square.prototype.a = function () {
this.lifetime++;
if (this.lifetime > 120) {
return(undefined);
}
var oldangle = (this.angleRad / (PI / 180));
oldangle = oldangle % 360;
var angle = (Math.atan2(this._y - ship._y, this._x - ship._x) / (PI / 180));
var dist = (oldangle - angle);
if (dist < -180) {
angle = angle - 360;
} else if (dist > 180) {
angle = angle + 360;
}
if (oldangle > angle) {
newangle = oldangle + 5;
} else if (oldangle < angle) {
newangle = oldangle - 5;
}
this._rotation = newangle;
this.angleRad = newangle * (PI / 180);
this.vx = Math.cos(this.angleRad) * this.v;
this.vy = Math.sin(this.angleRad) * this.v;
};
b_Spike = function () {
};
b_Spike.prototype = new MovieClip();
b_Spike.prototype.init = function (angle) {
this.angle = angle;
this.angleRad = angle * (PI / 180);
this.v = 15;
};
b_Laser = function () {
};
b_Laser.prototype = new MovieClip();
b_Laser.prototype.init = function (angle) {
this.angle = angle;
this.angleRad = angle * (PI / 180);
this.v = 0;
};
b_Laser.prototype.a = function () {
this.lifetime++;
if (this.lifetime > 90) {
this.removeMovieClip();
}
this._rotation = this.shooter._rotation;
this._x = this.shooter._x;
this._y = this.shooter._y;
if (this.shooter._x == undefined) {
this.removeMovieClip();
}
};
b_Laser_ = function () {
};
b_Laser_.prototype = new MovieClip();
b_Laser_.prototype.init = function (angle) {
this.angle = angle;
this.angleRad = angle * (PI / 180);
this.v = 0;
};
b_Laser_.prototype.a = function () {
this.lifetime++;
if (this.lifetime > 90) {
this.removeMovieClip();
}
this._rotation = this.shooter._rotation;
this._x = this.shooter._x;
this._y = this.shooter._y;
if (this.shooter._x == undefined) {
this.removeMovieClip();
}
};
b_Singularity = function () {
};
b_Singularity.prototype = new MovieClip();
b_Singularity.prototype.init = function (angle) {
this.angle = angle;
this.angleRad = angle * (PI / 180);
this.v = 0;
};
Frame 4
campaignMode = false;
currentLvl = 0;
stop();
Key.addListener(this);
if (url_ID != null) {
getLevel({ID:url_ID}, 1);
delete url_ID;
} else if (url_username != null) {
getLevel({username:url_username, name:url_name}, 1);
delete url_username;
delete url_name;
} else if (url_editor == "true") {
editorMode(true, true);
delete url_editor;
} else if (url_options == "true") {
openKeySettings();
delete url_options;
_root.keySettings.customFunction = function () {
getURL ("http://zetaflow.skylogic.ca/", "_top");
};
} else {
campaignMode = true;
gameMode(_root["level" + currentLvl]);
}
Frame 5
stop();
fpsTxt_._visible = false;
Stage.showMenu = true;
Frame 6
gotoAndPlay (1);
Frame 7
Stage.showMenu = false;
Symbol 11 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 14 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "background");
Symbol 17 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 19 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 22 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(disabled_mc, "foregroundDisabled");
Symbol 25 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(dot_mc, "radioDot");
Symbol 26 MovieClip [frb_states] Frame 1
stop();
Symbol 26 MovieClip [frb_states] Frame 2
stop();
Symbol 26 MovieClip [frb_states] Frame 3
stop();
Symbol 26 MovieClip [frb_states] Frame 4
stop();
Symbol 26 MovieClip [frb_states] Frame 5
stop();
Symbol 36 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 39 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "background");
Symbol 42 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 44 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(background_mc, "backgroundDisabled");
Symbol 47 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(check_mc, "foregroundDisabled");
Symbol 50 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(check_mc, "check");
Symbol 51 MovieClip [fcb_states] Frame 1
stop();
Symbol 51 MovieClip [fcb_states] Frame 2
stop();
Symbol 51 MovieClip [fcb_states] Frame 3
stop();
Symbol 51 MovieClip [fcb_states] Frame 4
stop();
Symbol 51 MovieClip [fcb_states] Frame 5
stop();
Symbol 51 MovieClip [fcb_states] Frame 6
stop();
Symbol 54 MovieClip [FLabelSymbol] Frame 1
#initclip 3
_global.FLabelClass = function () {
if (this.hostComponent == undefined) {
this.hostComponent = ((this._parent.controller == undefined) ? (this._parent) : (this._parent.controller));
}
if (this.customTextStyle == undefined) {
if (this.hostComponent.textStyle == undefined) {
this.hostComponent.textStyle = new TextFormat();
}
this.textStyle = this.hostComponent.textStyle;
this.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var val = this.hostComponent.styleTable.embedFonts.value;
if (val != undefined) {
this.labelField.embedFonts = val;
}
this.labelField.setNewTextFormat(this.textStyle);
this.labelField.text = label;
this.labelField._height = this.labelField.textHeight + 2;
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
this.enable = enable;
var tmpColor = this.hostComponent.styleTable[(enable ? "textColor" : "textDisabled")].value;
if (tmpColor == undefined) {
tmpColor = (enable ? 16777215 : 8947848);
}
this.setColor(tmpColor);
};
FLabelClass.prototype.getLabel = function () {
return(this.labelField.text);
};
FLabelClass.prototype.setColor = function (col) {
this.labelField.textColor = col;
};
#endinitclip
Symbol 57 MovieClip [FHighlightSymbol] Frame 1
var component = _parent.controller;
component.registerSkinElement(highlight_mc, "selection");
stop();
Symbol 57 MovieClip [FHighlightSymbol] Frame 2
component.registerSkinElement(highlight_mc2, "selectionDisabled");
stop();
Symbol 57 MovieClip [FHighlightSymbol] Frame 3
component.registerSkinElement(highlight_mc3, "selectionUnfocused");
stop();
Symbol 88 MovieClip [expFire] Frame 1
_root.expFireSnd.start(0, 0);
Symbol 88 MovieClip [expFire] Frame 17
this.removeMovieClip();
Symbol 89 MovieClip [FUIComponentSymbol] Frame 1
#initclip 1
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var i in this.styleFormat_prm) {
this.setStyleProperty(i, this.styleFormat_prm[i]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
this.enable = ((arguments.length > 0) ? (enabledFlag) : true);
this.tabEnabled = (this.focusEnabled = enabledFlag);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
this.handlerObj = ((obj == undefined) ? (this._parent) : (obj));
this.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
this.methodTable[methodName] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var funct in this.methodTable) {
this[funct]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var inner = this.styleTable.focusRectInner.value;
var outer = this.styleTable.focusRectOuter.value;
if (inner == undefined) {
inner = 16777215 /* 0xFFFFFF */;
}
if (outer == undefined) {
outer = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, outer);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, inner);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
if (value == "") {
return(undefined);
}
var tmpValue = parseInt(value);
if (!isNaN(tmpValue)) {
value = tmpValue;
}
var global = ((arguments.length > 2) ? (isGlobal) : false);
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].useGlobal || (!global)) {
this.styleTable[propName].value = value;
if (this.setCustomStyleProperty(propName, value)) {
} else if (propName == "embedFonts") {
this.invalidate("setSize");
} else if (propName.subString(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var textProp = propName.subString(4, propName.length);
this.textStyle[textProp] = value;
this.invalidate("setSize");
} else {
for (var j in this.styleTable[propName].coloredMCs) {
var myColor = new Color(this.styleTable[propName].coloredMCs[j]);
if (this.styleTable[propName].value == undefined) {
var myTObj = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
myColor.setTransform(myTObj);
} else {
myColor.setRGB(value);
}
}
}
this.styleTable[propName].useGlobal = global;
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].coloredMCs == undefined) {
this.styleTable[propName].coloredMCs = new Object();
}
this.styleTable[propName].coloredMCs[skinMCRef] = skinMCRef;
if (this.styleTable[propName].value != undefined) {
var myColor = new Color(skinMCRef);
myColor.setRGB(this.styleTable[propName].value);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this.isGlobal = false;
if (arguments.length > 0) {
for (var i in arguments[0]) {
this[i] = arguments[0][i];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var arg = 0;
while (arg < arguments.length) {
var mcRef = arguments[arg];
this.listeners[arguments[arg]] = mcRef;
for (var i in this) {
if (this.isAStyle(i)) {
mcRef.updateStyleProperty(this, i.toString());
}
}
arg++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
this.listeners[component] = undefined;
for (var prop in this) {
if (this.isAStyle(prop)) {
if (component.styleTable[prop].useGlobal == this.isGlobal) {
component.styleTable[prop].useGlobal = true;
var value = (this.isGlobal ? undefined : (globalStyleFormat[prop]));
component.setStyleProperty(prop, value, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var count = 0;
for (var i in this.listeners) {
var component = this.listeners[i];
if (arguments.length > 0) {
var j = 0;
while (j < arguments.length) {
if (this.isAStyle(arguments[j])) {
component.updateStyleProperty(this, arguments[j]);
}
j++;
}
} else {
for (var j in this) {
if (this.isAStyle(j)) {
component.updateStyleProperty(this, j.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 100 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 110 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 119 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 120 MovieClip [UpArrow] Frame 1
stop();
Symbol 120 MovieClip [UpArrow] Frame 2
stop();
Symbol 120 MovieClip [UpArrow] Frame 3
stop();
Symbol 126 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 133 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 138 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(highlight3D_mc, "highlight3D");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
Symbol 139 MovieClip [ScrollThumb] Frame 1
stop();
Symbol 147 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 155 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 163 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 164 MovieClip [DownArrow] Frame 1
stop();
Symbol 164 MovieClip [DownArrow] Frame 2
stop();
Symbol 164 MovieClip [DownArrow] Frame 3
stop();
Symbol 170 MovieClip [FListItemSymbol] Frame 1
#initclip 9
function FListItemClass() {
this.init();
}
FListItemClass.prototype = new FSelectableItemClass();
Object.registerClass("FListItemSymbol", FListItemClass);
#endinitclip
Symbol 172 MovieClip Frame 1
var component = _parent;
component.registerSkinElement(track_mc, "scrollTrack");
Symbol 173 MovieClip [FScrollBarSymbol] Frame 1
#initclip 5
FScrollBarClass = function () {
if (this._height == 4) {
return(undefined);
}
this.init();
this.minPos = (this.maxPos = (this.pageSize = (this.largeScroll = 0)));
this.smallScroll = 1;
this.width = (this.horizontal ? (this._width) : (this._height));
this._xscale = (this._yscale = 100);
this.setScrollPosition(0);
this.tabEnabled = false;
if (this._targetInstanceName.length > 0) {
this.setScrollTarget(this._parent[this._targetInstanceName]);
}
this.tabChildren = false;
this.setSize(this.width);
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function (flag) {
if (this.horizontal && (!flag)) {
this._xscale = 100;
this._rotation = 0;
} else if (flag && (!this.horizontal)) {
this._xscale = -100;
this._rotation = -90;
}
this.horizontal = flag;
};
FScrollBarClass.prototype.setScrollProperties = function (pSize, mnPos, mxPos) {
if (!this.enable) {
return(undefined);
}
this.pageSize = pSize;
this.minPos = Math.max(mnPos, 0);
this.maxPos = Math.max(mxPos, 0);
this.scrollPosition = Math.max(this.minPos, this.scrollPosition);
this.scrollPosition = Math.min(this.maxPos, this.scrollPosition);
if ((this.maxPos - this.minPos) <= 0) {
this.scrollThumb_mc.removeMovieClip();
this.upArrow_mc.gotoAndStop(3);
this.downArrow_mc.gotoAndStop(3);
this.downArrow_mc.onPress = (this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = null));
this.upArrow_mc.onPress = (this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = null));
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onRelease = null);
this.scrollTrack_mc.onDragOut = (this.scrollTrack_mc.onRollOut = null);
this.scrollTrack_mc.useHandCursor = false;
} else {
var tmp = this.getScrollPosition();
this.upArrow_mc.gotoAndStop(1);
this.downArrow_mc.gotoAndStop(1);
this.upArrow_mc.onPress = (this.upArrow_mc.onDragOver = this.startUpScroller);
this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = this.stopScrolling);
this.downArrow_mc.onPress = (this.downArrow_mc.onDragOver = this.startDownScroller);
this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = this.stopScrolling);
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onDragOver = this.startTrackScroller);
this.scrollTrack_mc.onRelease = this.stopScrolling;
this.scrollTrack_mc.onDragOut = this.stopScrolling;
this.scrollTrack_mc.onRollOut = this.stopScrolling;
this.scrollTrack_mc.useHandCursor = false;
this.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
this.scrollThumb_mc._x = 0;
this.scrollThumb_mc._y = this.upArrow_mc._height;
this.scrollThumb_mc.onPress = this.startDragThumb;
this.scrollThumb_mc.controller = this;
this.scrollThumb_mc.onRelease = (this.scrollThumb_mc.onReleaseOutside = this.stopDragThumb);
this.scrollThumb_mc.useHandCursor = false;
this.thumbHeight = (this.pageSize / ((this.maxPos - this.minPos) + this.pageSize)) * this.trackSize;
this.thumbMid_mc = this.scrollThumb_mc.mc_sliderMid;
this.thumbTop_mc = this.scrollThumb_mc.mc_sliderTop;
this.thumbBot_mc = this.scrollThumb_mc.mc_sliderBot;
this.thumbHeight = Math.max(this.thumbHeight, 6);
this.midHeight = (this.thumbHeight - this.thumbTop_mc._height) - this.thumbBot_mc._height;
this.thumbMid_mc._yScale = (this.midHeight * 100) / this.thumbMid_mc._height;
this.thumbMid_mc._y = this.thumbTop_mc._height;
this.thumbBot_mc._y = this.thumbTop_mc._height + this.midHeight;
this.scrollTop = this.scrollThumb_mc._y;
this.trackHeight = this.trackSize - this.thumbHeight;
this.scrollBot = this.trackHeight + this.scrollTop;
tmp = Math.min(tmp, this.maxPos);
this.setScrollPosition(Math.max(tmp, this.minPos));
}
};
FScrollBarClass.prototype.getScrollPosition = function () {
return(this.scrollPosition);
};
FScrollBarClass.prototype.setScrollPosition = function (pos) {
this.scrollPosition = pos;
if (this.scrollThumb_mc != undefined) {
pos = Math.min(pos, this.maxPos);
pos = Math.max(pos, this.minPos);
}
this.scrollThumb_mc._y = (((pos - this.minPos) * this.trackHeight) / (this.maxPos - this.minPos)) + this.scrollTop;
this.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function (lScroll) {
this.largeScroll = lScroll;
};
FScrollBarClass.prototype.setSmallScroll = function (sScroll) {
this.smallScroll = sScroll;
};
FScrollBarClass.prototype.setEnabled = function (enabledFlag) {
var wasEnabled = this.enable;
if (enabledFlag && (!wasEnabled)) {
this.enable = enabledFlag;
if (this.textField != undefined) {
this.setScrollTarget(this.textField);
} else {
this.setScrollProperties(this.pageSize, this.cachedMinPos, this.cachedMaxPos);
this.setScrollPosition(this.cachedPos);
}
this.clickFilter = undefined;
} else if ((!enabledFlag) && (wasEnabled)) {
this.textField.removeListener(this);
this.cachedPos = this.getScrollPosition();
this.cachedMinPos = this.minPos;
this.cachedMaxPos = this.maxPos;
if (this.clickFilter == undefined) {
this.setScrollProperties(this.pageSize, 0, 0);
} else {
this.clickFilter = true;
}
this.enable = enabledFlag;
}
};
FScrollBarClass.prototype.setSize = function (hgt) {
if (this._height == 1) {
return(undefined);
}
this.width = hgt;
this.scrollTrack_mc._yscale = 100;
this.scrollTrack_mc._yscale = (100 * this.width) / this.scrollTrack_mc._height;
if (this.upArrow_mc == undefined) {
this.attachMovie("UpArrow", "upArrow_mc", 1);
this.attachMovie("DownArrow", "downArrow_mc", 2);
this.downArrow_mc.controller = (this.upArrow_mc.controller = this);
this.upArrow_mc.useHandCursor = (this.downArrow_mc.useHandCursor = false);
this.upArrow_mc._x = (this.upArrow_mc._y = 0);
this.downArrow_mc._x = 0;
}
this.scrollTrack_mc.controller = this;
this.downArrow_mc._y = this.width - this.downArrow_mc._height;
this.trackSize = this.width - (2 * this.downArrow_mc._height);
if (this.textField != undefined) {
this.onTextChanged();
} else {
this.setScrollProperties(this.pageSize, this.minPos, this.maxPos);
}
};
FScrollBarClass.prototype.scrollIt = function (inc, mode) {
var delt = this.smallScroll;
if (inc != "one") {
delt = ((this.largeScroll == 0) ? (this.pageSize) : (this.largeScroll));
}
var newPos = (this.getScrollPosition() + (mode * delt));
if (newPos > this.maxPos) {
newPos = this.maxPos;
} else if (newPos < this.minPos) {
newPos = this.minPos;
}
this.setScrollPosition(newPos);
};
FScrollBarClass.prototype.startDragThumb = function () {
this.lastY = this._ymouse;
this.onMouseMove = this.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function () {
this.scrollMove = this._ymouse - this.lastY;
this.scrollMove = this.scrollMove + this._y;
if (this.scrollMove < this.controller.scrollTop) {
this.scrollMove = this.controller.scrollTop;
} else if (this.scrollMove > this.controller.scrollBot) {
this.scrollMove = this.controller.scrollBot;
}
this._y = this.scrollMove;
var c = this.controller;
c.scrollPosition = Math.round(((c.maxPos - c.minPos) * (this._y - c.scrollTop)) / c.trackHeight) + c.minPos;
this.controller.isScrolling = true;
updateAfterEvent();
this.controller.executeCallBack();
};
FScrollBarClass.prototype.stopDragThumb = function () {
this.controller.isScrolling = false;
this.onMouseMove = null;
};
FScrollBarClass.prototype.startTrackScroller = function () {
this.controller.trackScroller();
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "page", -1);
};
FScrollBarClass.prototype.scrollInterval = function (inc, mode) {
clearInterval(this.scrolling);
if (inc == "page") {
this.trackScroller();
} else {
this.scrollIt(inc, mode);
}
this.scrolling = setInterval(this, "scrollInterval", 35, inc, mode);
};
FScrollBarClass.prototype.trackScroller = function () {
if ((this.scrollThumb_mc._y + this.thumbHeight) < this._ymouse) {
this.scrollIt("page", 1);
} else if (this.scrollThumb_mc._y > this._ymouse) {
this.scrollIt("page", -1);
}
};
FScrollBarClass.prototype.stopScrolling = function () {
this.controller.downArrow_mc.gotoAndStop(1);
this.controller.upArrow_mc.gotoAndStop(1);
clearInterval(this.controller.scrolling);
};
FScrollBarClass.prototype.startUpScroller = function () {
this.controller.upArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", -1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", -1);
};
FScrollBarClass.prototype.startDownScroller = function () {
this.controller.downArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", 1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", 1);
};
FScrollBarClass.prototype.setScrollTarget = function (tF) {
if (tF == undefined) {
this.textField.removeListener(this);
delete this.textField[(this.horizontal ? "hScroller" : "vScroller")];
if ((this.textField.hScroller != undefined) && (this.textField.vScroller != undefined)) {
this.textField.unwatch("text");
this.textField.unwatch("htmltext");
}
}
this.textField = undefined;
if (!(tF instanceof TextField)) {
return(undefined);
}
this.textField = tF;
this.textField[(this.horizontal ? "hScroller" : "vScroller")] = this;
this.onTextChanged();
this.onChanged = function () {
this.onTextChanged();
};
this.onScroller = function () {
if (!this.isScrolling) {
if (!this.horizontal) {
this.setScrollPosition(this.textField.scroll);
} else {
this.setScrollPosition(this.textField.hscroll);
}
}
};
this.textField.addListener(this);
this.textField.watch("text", this.callback);
this.textField.watch("htmlText", this.callback);
};
FScrollBarClass.prototype.callback = function (prop, oldVal, newVal) {
clearInterval(this.hScroller.synchScroll);
clearInterval(this.vScroller.synchScroll);
this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
return(newVal);
};
FScrollBarClass.prototype.onTextChanged = function () {
if ((!this.enable) || (this.textField == undefined)) {
return(undefined);
}
clearInterval(this.synchScroll);
if (this.horizontal) {
var pos = this.textField.hscroll;
this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxhscroll));
} else {
var pos = this.textField.scroll;
var pageSize = (this.textField.bottomScroll - this.textField.scroll);
this.setScrollProperties(pageSize, 1, this.textField.maxscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxscroll));
}
};
FScrollBarClass.prototype.executeCallBack = function () {
if (this.textField == undefined) {
super.executeCallBack();
} else if (this.horizontal) {
this.textField.hscroll = this.getScrollPosition();
} else {
this.textField.scroll = this.getScrollPosition();
}
};
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Symbol 174 MovieClip [DataProviderSymbol] Frame 1
#initclip 2
_global.DataProviderClass = function () {
this.init();
};
DataProviderClass.prototype.init = function () {
this.items = new Array();
this.uniqueID = 0;
this.views = new Array();
};
DataProviderClass.prototype.addView = function (viewRef) {
this.views.push(viewRef);
var eventObj = {event:"updateAll"};
viewRef.modelChanged(eventObj);
};
DataProviderClass.prototype.addItemAt = function (index, value) {
if (index < this.getLength()) {
this.items.splice(index, 0, "tmp");
}
this.items[index] = new Object();
if (typeof(value) == "object") {
this.items[index] = value;
} else {
this.items[index].label = value;
}
this.items[index].__ID__ = this.uniqueID++;
var eventObj = {event:"addRows", firstRow:index, lastRow:index};
this.updateViews(eventObj);
};
DataProviderClass.prototype.addItem = function (value) {
this.addItemAt(this.getLength(), value);
};
DataProviderClass.prototype.removeItemAt = function (index) {
var tmpItm = this.items[index];
this.items.splice(index, 1);
var eventObj = {event:"deleteRows", firstRow:index, lastRow:index};
this.updateViews(eventObj);
return(tmpItm);
};
DataProviderClass.prototype.removeAll = function () {
this.items = new Array();
this.updateViews({event:"deleteRows", firstRow:0, lastRow:this.getLength() - 1});
};
DataProviderClass.prototype.replaceItemAt = function (index, itemObj) {
if ((index < 0) || (index >= this.getLength())) {
return(undefined);
}
var tmpID = this.getItemID(index);
if (typeof(itemObj) == "object") {
this.items[index] = itemObj;
} else {
this.items[index].label = itemObj;
}
this.items[index].__ID__ = tmpID;
this.updateViews({event:"updateRows", firstRow:index, lastRow:index});
};
DataProviderClass.prototype.getLength = function () {
return(this.items.length);
};
DataProviderClass.prototype.getItemAt = function (index) {
return(this.items[index]);
};
DataProviderClass.prototype.getItemID = function (index) {
return(this.items[index].__ID__);
};
DataProviderClass.prototype.sortItemsBy = function (fieldName, order) {
this.items.sortOn(fieldName);
if (order == "DESC") {
this.items.reverse();
}
this.updateViews({event:"sort"});
};
DataProviderClass.prototype.updateViews = function (eventObj) {
var i = 0;
while (i < this.views.length) {
this.views[i].modelChanged(eventObj);
i++;
}
};
#endinitclip
Symbol 175 MovieClip [FSelectableItemSymbol] Frame 1
#initclip 7
function FSelectableItemClass() {
this.init();
}
FSelectableItemClass.prototype = new FUIComponentClass();
FSelectableItemClass.prototype.init = function () {
if (this._name != "itemAsset") {
this.highlighted = false;
this.layoutContent(100);
}
};
FSelectableItemClass.prototype.drawItem = function (itmObj, selected) {
this.displayContent(itmObj, selected);
if ((this.highlighted != selected) || ((this.controller.focused != this.oldFocus) && (selected))) {
this.setHighlighted(selected);
}
this.oldFocus = this.controller.focused;
};
FSelectableItemClass.prototype.setSize = function (width, height) {
var LOWEST_DEPTH = -16384;
this.width = width;
this.layoutContent(width);
this.attachMovie("FHighlightSymbol", "highlight_mc", LOWEST_DEPTH);
this.highlight_mc._x = 0.5;
this.highlight_mc._width = width - 0.5;
this.highlight_mc._height = height;
this.highlight_mc.controller = this;
this.highlight_mc._alpha = 0;
this.highlight_mc.trackAsMenu = true;
this.highlight_mc.onPress = function () {
if (this.controller.enable) {
this.controller.controller.clickHandler(this.controller.itemNum);
}
};
this.highlight_mc.onDragOver = function () {
if (this.controller.controller.focused) {
this.onPress();
}
};
this.highlight_mc.useHandCursor = false;
this.highlight_mc.trackAsMenu = true;
};
FSelectableItemClass.prototype.setEnabled = function (enabledFlag) {
this.enable = enabledFlag;
this.fLabel_mc.setEnabled(enabledFlag);
this.highlight_mc.gotoAndStop((enabledFlag ? "unfocused" : "disabled"));
};
FSelectableItemClass.prototype.layoutContent = function (width) {
this.attachMovie("FLabelSymbol", "fLabel_mc", 2, {hostComponent:this.controller});
this.fLabel_mc._x = 2;
this.fLabel_mc._y = 0;
this.fLabel_mc.setSize(width - 2);
this.fLabel_mc.labelField.selectable = false;
};
FSelectableItemClass.prototype.displayContent = function (itmObj, selected) {
var tmpLabel = "";
if (itmObj.label != undefined) {
tmpLabel = itmObj.label;
} else if (typeof(itmObj) == "object") {
for (var i in itmObj) {
if (i != "__ID__") {
tmpLabel = (itmObj[i] + ", ") + tmpLabel;
}
}
tmpLabel = tmpLabel.substring(0, tmpLabel.length - 2);
} else {
tmpLabel = itmObj;
}
if (this.fLabel_mc.labelField.text != tmpLabel) {
this.fLabel_mc.setLabel(tmpLabel);
}
var clr = (selected ? (this.controller.styleTable.textSelected.value) : (this.controller.styleTable.textColor.value));
if (clr == undefined) {
clr = (selected ? 16777215 : 16777215);
}
this.fLabel_mc.setColor(clr);
};
FSelectableItemClass.prototype.getItemIndex = function () {
return(this.controller.getScrollPosition() + this.itemNum);
};
FSelectableItemClass.prototype.getItemModel = function () {
return(this.controller.getItemAt(this.getItemIndex()));
};
FSelectableItemClass.prototype.getHostDataProvider = function () {
return(this.controller.dataProvider);
};
FSelectableItemClass.prototype.setHighlighted = function (flag) {
fade = this.controller.styleTable.fadeRate.value;
if (((fade == undefined) || (fade == 0)) || (!flag)) {
this.highlight_mc._alpha = (flag ? 100 : 0);
delete this.onEnterFrame;
} else {
this.fadeN = fade;
this.fadeX = 1;
this.highLight_mc._alpha = 20;
this.onEnterFrame = function () {
this.highLight_mc._alpha = (60 * Math.sqrt((this.fadeX++) / this.fadeN)) + 40;
if (this.fadeX > this.fadeN) {
delete this.onEnterFrame;
}
};
}
this.highlighted = flag;
};
#endinitclip
Symbol 176 MovieClip [FSelectableListSymbol] Frame 1
#initclip 4
function FSelectableListClass() {
this.init();
}
FSelectableListClass.prototype = new FUIComponentClass();
FSelectableListClass.prototype.init = function () {
super.init();
this.enable = true;
this.selected = new Array();
this.topDisplayed = (this.numDisplayed = 0);
this.lastSelected = 0;
this.tabChildren = false;
if (this._name != undefined) {
this.dataProvider = new DataProviderClass();
this.dataProvider.addView(this);
}
};
FSelectableListClass.prototype.addItemAt = function (index, label, data) {
if ((index < 0) || (!this.enable)) {
return(undefined);
}
this.dataProvider.addItemAt(index, {label:label, data:data});
};
FSelectableListClass.prototype.addItem = function (label, data) {
if (!this.enable) {
return(undefined);
}
this.dataProvider.addItem({label:label, data:data});
};
FSelectableListClass.prototype.removeItemAt = function (index) {
this.selectHolder = this.getSelectedIndex();
var item = this.getItemAt(index);
this.dataProvider.removeItemAt(index);
return(item);
};
FSelectableListClass.prototype.removeAll = function () {
this.dataProvider.removeAll();
};
FSelectableListClass.prototype.replaceItemAt = function (index, newLabel, newData) {
this.dataProvider.replaceItemAt(index, {label:newLabel, data:newData});
};
FSelectableListClass.prototype.sortItemsBy = function (fieldName, order) {
this.lastSelID = this.dataProvider.getItemID(this.lastSelected);
this.dataProvider.sortItemsBy(fieldName, order);
};
FSelectableListClass.prototype.getLength = function () {
return(this.dataProvider.getLength());
};
FSelectableListClass.prototype.getSelectedIndex = function () {
for (var uniqueID in this.selected) {
var tmpInd = this.selected[uniqueID].sIndex;
if (tmpInd != undefined) {
return(tmpInd);
}
}
};
FSelectableListClass.prototype.getSelectedItem = function () {
return(this.getItemAt(this.getSelectedIndex()));
};
FSelectableListClass.prototype.getItemAt = function (index) {
return(this.dataProvider.getItemAt(index));
};
FSelectableListClass.prototype.getEnabled = function () {
return(this.enable);
};
FSelectableListClass.prototype.getValue = function () {
var item = this.getSelectedItem();
return(((item.data == undefined) ? (item.label) : (item.data)));
};
FSelectableListClass.prototype.setSelectedIndex = function (index, flag) {
if (((index >= 0) && (index < this.getLength())) && (this.enable)) {
this.clearSelected();
this.selectItem(index, true);
this.lastSelected = index;
this.invalidate("updateControl");
if (flag != false) {
this.executeCallBack();
}
}
};
FSelectableListClass.prototype.setDataProvider = function (obj) {
this.setScrollPosition(0);
this.clearSelected();
if (obj instanceof Array) {
this.dataProvider = new DataProviderClass();
var i = 0;
while (i < obj.length) {
var value = ((typeof(obj[i]) == "string") ? ({label:obj[i]}) : (obj[i]));
this.dataProvider.addItem(value);
i++;
}
} else {
this.dataProvider = obj;
}
this.dataProvider.addView(this);
};
FSelectableListClass.prototype.setItemSymbol = function (linkID) {
this.tmpPos = this.getScrollPosition();
this.itemSymbol = linkID;
this.invalidate("setSize");
this.setScrollPosition(this.tmpPos);
};
FSelectableListClass.prototype.setEnabled = function (enabledFlag) {
this.cleanUI();
super.setEnabled(enabledFlag);
this.enable = enabledFlag;
this.boundingBox_mc.gotoAndStop((this.enable ? "enabled" : "disabled"));
var limit = Math.min(this.numDisplayed, this.getLength());
var i = 0;
while (i < limit) {
this.container_mc[("fListItem" + i) + "_mc"].setEnabled(this.enable);
i++;
}
if (this.enable) {
this.invalidate("updateControl");
}
};
FSelectableListClass.prototype.updateControl = function () {
var i = 0;
while (i < this.numDisplayed) {
this.container_mc[("fListItem" + i) + "_mc"].drawItem(this.getItemAt(this.topDisplayed + i), this.isSelected(this.topDisplayed + i));
i++;
}
};
FSelectableListClass.prototype.setSize = function (w, h) {
super.setSize(w, h);
this.boundingBox_mc._xscale = (this.boundingBox_mc._yscale = 100);
this.boundingBox_mc._xscale = (this.width * 100) / this.boundingBox_mc._width;
this.boundingBox_mc._yscale = (this.height * 100) / this.boundingBox_mc._height;
var i = 0;
while (i < this.numDisplayed) {
this.container_mc.attachMovie(this.itemSymbol, ("fListItem" + i) + "_mc", 10 + i, {controller:this, itemNum:i});
var item_mc = this.container_mc[("fListItem" + i) + "_mc"];
var offset = ((this.scrollOffset == undefined) ? 0 : (this.scrollOffset));
item_mc.setSize(this.width - offset, this.itmHgt);
item_mc._y = (this.itmHgt - 2) * i;
i++;
}
this.updateControl();
};
FSelectableListClass.prototype.modelChanged = function (eventObj) {
var firstRow = eventObj.firstRow;
var lastRow = eventObj.lastRow;
var event = eventObj.event;
if (event == "addRows") {
for (var i in this.selected) {
if ((this.selected[i].sIndex != undefined) && (this.selected[i].sIndex >= firstRow)) {
this.selected[i].sIndex = this.selected[i].sIndex + ((lastRow - firstRow) + 1);
this.setSelectedIndex(this.selected[i].sIndex, false);
}
}
} else if (event == "deleteRows") {
if (firstRow == lastRow) {
var index = firstRow;
if (this.selectHolder == index) {
this.selectionDeleted = true;
}
if (((this.topDisplayed + this.numDisplayed) >= this.getLength()) && (this.topDisplayed > 0)) {
this.topDisplayed--;
if (this.selectionDeleted && ((index - 1) >= 0)) {
this.setSelectedIndex(index - 1, false);
}
} else if (this.selectionDeleted) {
var len = this.getLength();
if (((index == (len - 1)) && (len > 1)) || (index > (len / 2))) {
this.setSelectedIndex(index - 1, false);
} else {
this.setSelectedIndex(index, false);
}
}
for (var i in this.selected) {
if (this.selected[i].sIndex > firstRow) {
this.selected[i].sIndex--;
}
}
} else {
this.clearSelected();
this.topDisplayed = 0;
}
} else if (event == "sort") {
var len = this.getLength();
var i = 0;
while (i < len) {
if (this.isSelected(i)) {
var id = this.dataProvider.getItemID(i);
if (id == this.lastSelID) {
this.lastSelected = i;
}
this.selected[String(id)].sIndex = i;
}
i++;
}
}
this.invalidate("updateControl");
};
FSelectableListClass.prototype.measureItmHgt = function () {
this.attachMovie(this.itemSymbol, "tmpItem_mc", 0, {controller:this});
this.tmpItem_mc.drawItem({label:"Sizer: PjtTopg"}, false);
this.itmHgt = this.tmpItem_mc._height;
this.tmpItem_mc.removeMovieClip();
};
FSelectableListClass.prototype.selectItem = function (index, selectedFlag) {
if (selectedFlag && (!this.isSelected(index))) {
this.selected[String(this.dataProvider.getItemID(index))] = {sIndex:index};
} else if (!selectedFlag) {
delete this.selected[String(this.dataProvider.getItemID(index))];
}
};
FSelectableListClass.prototype.isSelected = function (index) {
return(this.selected[String(this.dataProvider.getItemID(index))].sIndex != undefined);
};
FSelectableListClass.prototype.clearSelected = function () {
for (var uniqueID in this.selected) {
var index = this.selected[uniqueID].sIndex;
if (((index != undefined) && (this.topDisplayed <= index)) && (index < (this.topDisplayed + this.numDisplayed))) {
this.container_mc[("fListItem" + (index - this.topDisplayed)) + "_mc"].drawItem(this.getItemAt(index), false);
}
}
delete this.selected;
this.selected = new Array();
};
FSelectableListClass.prototype.selectionHandler = function (itemNum) {
var tmpInd = (this.topDisplayed + itemNum);
if (this.getItemAt(tmpInd == undefined)) {
this.changeFlag = false;
return(undefined);
}
this.changeFlag = true;
this.clearSelected();
this.selectItem(tmpInd, true);
this.container_mc[("fListItem" + itemNum) + "_mc"].drawItem(this.getItemAt(tmpInd), this.isSelected(tmpInd));
};
FSelectableListClass.prototype.moveSelBy = function (incr) {
var itmNum = this.getSelectedIndex();
var newItm = (itmNum + incr);
newItm = Math.max(0, newItm);
newItm = Math.min(this.getLength() - 1, newItm);
if (newItm == itmNum) {
return(undefined);
}
if ((itmNum < this.topDisplayed) || (itmNum >= (this.topDisplayed + this.numDisplayed))) {
this.setScrollPosition(itmNum);
}
if ((newItm >= (this.topDisplayed + this.numDisplayed)) || (newItm < this.topDisplayed)) {
this.setScrollPosition(this.topDisplayed + incr);
}
this.selectionHandler(newItm - this.topDisplayed);
};
FSelectableListClass.prototype.clickHandler = function (itmNum) {
this.focusRect.removeMovieClip();
if (!this.focused) {
this.pressFocus();
}
this.selectionHandler(itmNum);
this.onMouseUp = this.releaseHandler;
};
FSelectableListClass.prototype.releaseHandler = function () {
if (this.changeFlag) {
this.executeCallBack();
}
this.changeFlag = false;
this.onMouseUp = undefined;
};
FSelectableListClass.prototype.myOnSetFocus = function () {
super.myOnSetFocus();
var i = 0;
while (i < this.numDisplayed) {
this.container_mc[("fListItem" + i) + "_mc"].highlight_mc.gotoAndStop("enabled");
i++;
}
};
FSelectableListClass.prototype.myOnKillFocus = function () {
super.myOnKillFocus();
var i = 0;
while (i < this.numDisplayed) {
this.container_mc[("fListItem" + i) + "_mc"].highlight_mc.gotoAndStop("unfocused");
i++;
}
};
#endinitclip
Instance of Symbol 174 MovieClip [DataProviderSymbol] "dPAsset" in Symbol 176 MovieClip [FSelectableListSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
}
Instance of Symbol 175 MovieClip [FSelectableItemSymbol] "ItemAsset" in Symbol 176 MovieClip [FSelectableListSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
}
Symbol 177 MovieClip [FScrollSelectListSymbol] Frame 1
#initclip 6
function FScrollSelectListClass() {
this.init();
}
FScrollSelectListClass.prototype = new FSelectableListClass();
FScrollSelectListClass.prototype.getScrollPosition = function () {
return(this.topDisplayed);
};
FScrollSelectListClass.prototype.setScrollPosition = function (pos) {
if (this.enable) {
pos = Math.min(pos, this.getLength() - this.numDisplayed);
pos = Math.max(pos, 0);
this.scrollBar_mc.setScrollPosition(pos);
}
};
FScrollSelectListClass.prototype.setAutoHideScrollBar = function (flag) {
this.permaScrollBar = !flag;
this.setSize(this.width, this.height);
};
FScrollSelectListClass.prototype.setEnabled = function (enabledFlag) {
super.setEnabled(enabledFlag);
this.scrollBar_mc.setEnabled(this.enable);
};
FScrollSelectListClass.prototype.setSize = function (w, h) {
var pos = this.getScrollPosition();
super.setSize(w, h);
if (this.scrollBar_mc != undefined) {
this.removed = true;
}
this.scrollBar_mc = undefined;
this.initScrollBar();
this.setScrollPosition(pos);
};
FScrollSelectListClass.prototype.modelChanged = function (eventObj) {
super.modelChanged(eventObj);
this.invalidate("initScrollBar");
};
FScrollSelectListClass.prototype.initScrollBar = function () {
if ((!this.permaScrollBar) && (this.getLength() <= this.numDisplayed)) {
if (this.removed) {
this.scrollBar_mc.removeMovieClip();
this.scrollBar_mc = undefined;
this.scrollOffset = undefined;
this.invalidate("setSize");
}
} else {
if (this.scrollBar_mc == undefined) {
this.container_mc.attachMovie("FScrollBarSymbol", "scrollBar_mc", 3000, {hostStyle:this.styleTable});
this.scrollBar_mc = this.container_mc.scrollBar_mc;
this.scrollBar_mc.setChangeHandler("scrollHandler", this);
this.scrollBar_mc.setSize(this.height);
this.scrollBar_mc._x = this.width - this.scrollBar_mc._width;
this.scrollBar_mc._y = 0;
this.scrollBar_mc.setLargeScroll(this.numDisplayed - 1);
this.scrollOffset = this.scrollBar_mc._width;
this.invalidate("setSize");
}
this.scrollBar_mc.setScrollProperties(this.numDisplayed, 0, this.getLength() - this.numDisplayed);
}
};
FScrollSelectListClass.prototype.scrollHandler = function (scrollBar) {
var pos = scrollBar.getScrollPosition();
this.topDisplayed = pos;
if (this.lastPosition != pos) {
this.updateControl();
}
this.lastPosition = pos;
};
FScrollSelectListClass.prototype.clickHandler = function (itmNum) {
super.clickHandler(itmNum);
if ((this.dragScrolling == undefined) && (this.scrollBar_mc != undefined)) {
this.dragScrolling = setInterval(this, "dragScroll", 15);
}
};
FScrollSelectListClass.prototype.releaseHandler = function () {
clearInterval(this.dragScrolling);
this.dragScrolling = undefined;
super.releaseHandler();
};
FScrollSelectListClass.prototype.dragScroll = function () {
clearInterval(this.dragScrolling);
if (this.container_mc._ymouse < 0) {
this.setScrollPosition(this.getScrollPosition() - 1);
this.selectionHandler(0);
this.scrollInterval = Math.max(25, (-23.8 * (-this.container_mc._ymouse)) + 500);
this.dragScrolling = setInterval(this, "dragScroll", this.scrollInterval);
} else if (this.container_mc._ymouse > ((this.itmHgt - 2) * this.numDisplayed)) {
this.setScrollPosition(this.getScrollPosition() + 1);
this.selectionHandler(this.numDisplayed - 1);
this.scrollInterval = Math.max(25, (-23.8 * Math.abs((this.container_mc._ymouse - ((this.itmHgt - 2) * this.numDisplayed)) - 2)) + 500);
this.dragScrolling = setInterval(this, "dragScroll", this.scrollInterval);
} else {
this.dragScrolling = setInterval(this, "dragScroll", 15);
}
};
FScrollSelectListClass.prototype.myOnKeyDown = function () {
if (this.focused) {
this.keyCodes = new Array(40, 38, 34, 33, 36, 35);
this.keyIncrs = new Array(1, -1, this.numDisplayed - 1, -(this.numDisplayed - 1), -this.getLength(), this.getLength());
var i = 0;
while (i < this.keyCodes.length) {
if (Key.isDown(this.keyCodes[i])) {
this.moveSelBy(this.keyIncrs[i]);
return(undefined);
}
i++;
}
this.findInputText();
}
};
FScrollSelectListClass.prototype.findInputText = function () {
var tmpCode = Key.getAscii();
if ((tmpCode >= 33) && (tmpCode <= 126)) {
this.findString(String.fromCharCode(tmpCode));
}
};
FScrollSelectListClass.prototype.findString = function (str) {
if (this.getLength() == 0) {
return(undefined);
}
var itemNum = this.getSelectedIndex();
var jump = 0;
var i = (itemNum + 1);
while (i != itemNum) {
var itmStr = this.getItemAt(i).label.substring(0, str.length);
if ((str == itmStr) || (str.toUpperCase() == itmStr.toUpperCase())) {
var jump = (i - itemNum);
break;
}
if (i >= (this.getLength() - 1)) {
i = -1;
}
i++;
}
if (jump != 0) {
this.moveSelBy(jump);
}
};
#endinitclip
Instance of Symbol 173 MovieClip [FScrollBarSymbol] "scrollBarAsset" in Symbol 177 MovieClip [FScrollSelectListSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
_targetInstanceName = "";
horizontal = false;
}
onClipEvent (load) {
this._width = (this._height = 1);
}
Instance of Symbol 176 MovieClip [FSelectableListSymbol] "superClassAsset" in Symbol 177 MovieClip [FScrollSelectListSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
}
Symbol 181 MovieClip [FBoundingBoxSymbol] Frame 1
var component = _parent;
component.registerSkinElement(boundingBox, "background");
stop();
Symbol 181 MovieClip [FBoundingBoxSymbol] Frame 2
component.registerSkinElement(boundingBox2, "backgroundDisabled");
stop();
Symbol 184 MovieClip [FListBoxSymbol] Frame 1
#initclip 8
function FListBoxClass() {
this.itemSymbol = "FListItemSymbol";
this.init();
this.permaScrollBar = true;
var i = 0;
while (i < this.labels.length) {
this.addItem(this.labels[i], this.data[i]);
i++;
}
this.boundingBox_mc.gotoAndStop(1);
this.width = this._width;
this.height = this._height;
this._yscale = (this._xscale = 100);
this.setSize(this.width, this.height);
if (this.changeHandler.length > 0) {
this.setChangeHandler(this.changeHandler);
}
}
FListBoxClass.prototype = new FScrollSelectListClass();
Object.registerClass("FListBoxSymbol", FListBoxClass);
FListBoxClass.prototype.getSelectedIndices = function () {
var tmpArray = new Array();
for (var i in this.selected) {
tmpArray.push(this.selected[i].sIndex);
}
return(((tmpArray.length > 0) ? (tmpArray) : undefined));
};
FListBoxClass.prototype.getSelectedItems = function () {
var indices = this.getSelectedIndices();
var tmpArray = new Array();
var i = 0;
while (i < indices.length) {
tmpArray.push(this.getItemAt(indices[i]));
i++;
}
return(((tmpArray.length > 0) ? (tmpArray) : undefined));
};
FListBoxClass.prototype.getSelectMultiple = function () {
return(this.selectMultiple);
};
FListBoxClass.prototype.getRowCount = function () {
return(this.numDisplayed);
};
FListBoxClass.prototype.setSelectedIndices = function (indexArray) {
this.clearSelected();
var i = 0;
while (i < indexArray.length) {
this.selectItem(indexArray[i], true);
i++;
}
this.updateControl();
};
FListBoxClass.prototype.setSelectMultiple = function (flag) {
this.selectMultiple = flag;
};
FListBoxClass.prototype.setRowCount = function (count) {
var hgt = ((count * (this.itmHgt - 2)) + 2);
this.setSize(this.width, hgt);
};
FListBoxClass.prototype.setWidth = function (wdt) {
this.setSize(wdt, this.height);
};
FListBoxClass.prototype.setSize = function (w, h) {
if (!this.enable) {
return(undefined);
}
w = Math.max(w, 20);
h = Math.max(h, 40);
this.container_mc.removeMovieClip();
this.container_mc = this.createEmptyMovieClip("container", 3);
this.measureItmHgt();
this.numDisplayed = Math.floor(h / (this.itmHgt - 2));
this.height = (this.numDisplayed * (this.itmHgt - 2)) + 2;
super.setSize(w, this.height);
};
FListBoxClass.prototype.removeItemAt = function (index) {
this.selectHolder = this.getSelectedIndices();
return(super.removeItemAt(index));
};
FListBoxClass.prototype.selectionHandler = function (itemNum) {
if (this.clickFilter) {
var index = (this.topDisplayed + itemNum);
if (this.getItemAt(index) == undefined) {
this.changeFlag = false;
return(undefined);
}
this.changeFlag = true;
if (((!this.selectMultiple) && (!Key.isDown(17))) || ((!Key.isDown(16)) && (!Key.isDown(17)))) {
this.clearSelected();
this.selectItem(index, true);
this.lastSelected = index;
this.container_mc[("fListItem" + itemNum) + "_mc"].drawItem(this.getItemAt(index), this.isSelected(index));
} else if (Key.isDown(16) && (this.selectMultiple)) {
if (this.lastSelected == -1) {
this.lastSelected = index;
}
var incr = ((this.lastSelected < index) ? 1 : -1);
this.clearSelected();
var i = this.lastSelected;
while (i != index) {
this.selectItem(i, true);
if ((i >= this.topDisplayed) && (i < (this.topDisplayed + this.numDisplayed))) {
this.container_mc[("fListItem" + (i - this.topDisplayed)) + "_mc"].drawItem(this.getItemAt(i), this.isSelected(i));
}
i = i + incr;
}
this.selectItem(index, true);
this.container_mc[("fListItem" + (index - this.topDisplayed)) + "_mc"].drawItem(this.getItemAt(index), this.isSelected(index));
} else if (key.isDown(17)) {
var selectedFlag = this.isSelected(index);
if (!this.selectMultiple) {
this.clearSelected();
}
if (!((!this.selectMultiple) && (selectedFlag))) {
this.selectItem(index, !selectedFlag);
this.container_mc[("fListItem" + itemNum) + "_mc"].drawItem(this.getItemAt(this.topDisplayed + itemNum), this.isSelected(this.topDisplayed + itemNum));
}
this.lastSelected = index;
}
} else {
this.clickFilter = true;
}
};
FListBoxClass.prototype.moveSelBy = function (itemNum) {
super.moveSelBy(itemNum);
this.releaseHandler();
};
#endinitclip
this.deadPreview._visible = false;
Instance of Symbol 177 MovieClip [FScrollSelectListSymbol] "superClassAsset" in Symbol 184 MovieClip [FListBoxSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
}
Instance of Symbol 184 MovieClip [FListBoxSymbol] "levelsListBox" in Symbol 187 MovieClip [editor.gallery_getID] Frame 1
//component parameters
onClipEvent (initialize) {
labels = [];
labels[0] = "Loading Data....";
selectMultiple = false;
changeHandler = "";
}
Symbol 193 Button [invisButton]
on (keyPress "<Enter>") {
close.onRelease();
}
Symbol 194 Button [invisButton]
on (release) {
bind("ed_selCore");
}
Symbol 195 Button [invisButton]
on (release) {
bind("ed_selAll");
}
Symbol 196 Button [invisButton]
on (release) {
bind("ed_duplicate");
}
Symbol 197 Button [invisButton]
on (release) {
bind("aimRight");
}
Symbol 198 Button [invisButton]
on (release) {
bind("aimLeft");
}
Symbol 199 Button [invisButton]
on (release) {
bind("aimDown");
}
Symbol 200 Button [invisButton]
on (release) {
bind("aimUp");
}
Symbol 201 Button [invisButton]
on (release) {
bind("ed_xyscale");
}
Symbol 202 Button [invisButton]
on (release) {
bind("ed_yscale");
}
Symbol 203 Button [invisButton]
on (release) {
bind("ed_xscale");
}
Symbol 204 Button [invisButton]
on (release) {
bind("ed_delete");
}
Symbol 205 Button [invisButton]
on (release) {
bind("ed_nextParent");
}
Symbol 206 Button [invisButton]
on (release) {
bind("ed_lock");
}
Symbol 207 Button [invisButton]
on (release) {
bind("ed_prevParent");
}
Symbol 208 Button [invisButton]
on (release) {
bind("ed_rotateRight45");
}
Symbol 209 Button [invisButton]
on (release) {
bind("ed_rotateLeft45");
}
Symbol 210 Button [invisButton]
on (release) {
bind("ed_rotateRight1");
}
Symbol 211 Button [invisButton]
on (release) {
bind("ed_rotateLeft1");
}
Symbol 212 Button [invisButton]
on (release) {
bind("ed_right");
}
Symbol 213 Button [invisButton]
on (release) {
bind("ed_left");
}
Symbol 214 Button [invisButton]
on (release) {
bind("ed_down");
}
Symbol 215 Button [invisButton]
on (release) {
bind("ed_up");
}
Symbol 216 Button [invisButton]
on (release) {
bindAll();
}
Symbol 217 Button [invisButton]
on (release) {
bind("pause");
}
Symbol 218 Button [invisButton]
on (release) {
bind("right");
}
Symbol 219 Button [invisButton]
on (release) {
bind("left");
}
Symbol 220 Button [invisButton]
on (release) {
bind("down");
}
Symbol 221 Button [invisButton]
on (release) {
bind("up");
}
Symbol 222 Button [invisButton]
on (release) {
bind("shoot");
}
on (rollOver) {
_root.ideHelpTxt.setTxt("Key to shoot. If using the mouse, left click will be used instead");
}
on (rollOut) {
_root.ideHelpTxt.setTxt();
}
Symbol 225 Button [invisButton]
on (keyPress "<Enter>") {
saveBtn.onRelease();
}
Symbol 226 Button [invisButton]
on (rollOver) {
_root.ideHelpTxt.setTxt("Use the <b>link</b> option to link levels together, thus creating a <b>series</b>");
}
on (rollOut) {
_root.ideHelpTxt.setTxt();
}
Symbol 227 Button [invisButton]
on (keyPress "<Enter>") {
ok.onRelease();
}
Symbol 228 Button [invisButton]
on (keyPress "<Enter>") {
loginBtn.onRelease();
}
Symbol 230 Button [invisButton]
on (release) {
livesInput = -1;
}
Symbol 236 MovieClip Frame 1
currentbytes = int(_root.getBytesLoaded() / 1000);
totalbytes = int(_root.getBytesTotal() / 1000);
percentbytes = int((currentbytes / totalbytes) * 100);
circlemessagemc = customcirclemessagemc;
if (percentbytes == 100) {
circlemessagemc = "Loading complete!";
_root.play();
}
circlebytetxt = percentbytes + "% loaded";
if (rotate == null) {
circle._rotation = circle._rotation + per;
}
per = percentbytes / customRotation;
circleColor = new Color(circle);
circleColot.setRGB(customCircleColor);
txtColor = new Color(circlemessagemc);
txtColor.setRGB(customtxtColor);
txtColor2 = new Color(circlebytetext);
txtColor2.setRGB(customtxtColor);
Symbol 242 MovieClip Frame 1
this._xscale = (this._yscale = this._yscale + (random(20) - 10));
gotoAndPlay(random(20));
Symbol 242 MovieClip Frame 21
gotoAndPlay (2);
Symbol 262 Button
on (release) {
getURL ("http://skylogic.ca/", "_blank");
}
Symbol 265 MovieClip [FCheckBoxSymbol] Frame 1
#initclip 11
function FCheckBoxClass() {
this.init();
}
FCheckBoxClass.prototype = new FUIComponentClass();
Object.registerClass("FCheckBoxSymbol", FCheckBoxClass);
FCheckBoxClass.prototype.init = function () {
super.setSize(this._width, this._height);
this.boundingBox_mc.unloadMovie();
this.attachMovie("fcb_hitArea", "fcb_hitArea_mc", 1);
this.attachMovie("fcb_states", "fcb_states_mc", 2);
this.attachMovie("FLabelSymbol", "fLabel_mc", 3);
super.init();
this.setChangeHandler(this.changeHandler);
this._xscale = 100;
this._yscale = 100;
this.setSize(this.width, this.height);
if (this.initialValue == undefined) {
this.setCheckState(false);
} else {
this.setCheckState(this.initialValue);
}
if (this.label != undefined) {
this.setLabel(this.label);
}
this.ROLE_SYSTEM_CHECKBUTTON = 44;
this.STATE_SYSTEM_CHECKED = 16;
this.EVENT_OBJECT_STATECHANGE = 32778;
this.EVENT_OBJECT_NAMECHANGE = 32780;
this._accImpl.master = this;
this._accImpl.stub = false;
this._accImpl.get_accRole = this.get_accRole;
this._accImpl.get_accName = this.get_accName;
this._accImpl.get_accState = this.get_accState;
this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
};
FCheckBoxClass.prototype.setLabelPlacement = function (pos) {
this.setLabel(this.getLabel());
this.txtFormat(pos);
var halfLabelH = (this.fLabel_mc._height / 2);
var halfFrameH = (this.fcb_states_mc._height / 2);
var vertCenter = (halfFrameH - halfLabelH);
var checkWidth = this.fcb_states_mc._width;
var frame = this.fcb_states_mc;
var label = this.fLabel_mc;
var w = 0;
if (frame._width > this.width) {
w = 0;
} else {
w = this.width - frame._width;
}
this.fLabel_mc.setSize(w);
if ((pos == "right") || (pos == undefined)) {
this.labelPlacement = "right";
this.fcb_states_mc._x = 0;
this.fLabel_mc._x = checkWidth;
this.txtFormat("left");
} else if (pos == "left") {
this.labelPlacement = "left";
this.fLabel_mc._x = 0;
this.fcb_states_mc._x = this.width - checkWidth;
this.txtFormat("right");
}
this.fLabel_mc._y = vertCenter;
this.fcb_hitArea_mc._y = vertCenter;
};
FCheckBoxClass.prototype.txtFormat = function (pos) {
var txtS = this.textStyle;
var sTbl = this.styleTable;
txtS.align = ((sTbl.textAlign.value == undefined) ? ((txtS.align = pos)) : undefined);
txtS.leftMargin = ((sTbl.textLeftMargin.value == undefined) ? ((txtS.leftMargin = 0)) : undefined);
txtS.rightMargin = ((sTbl.textRightMargin.value == undefined) ? ((txtS.rightMargin = 0)) : undefined);
if (this.flabel_mc._height > this.height) {
super.setSize(this.width, this.flabel_mc._height);
} else {
super.setSize(this.width, this.height);
}
this.fLabel_mc.labelField.setTextFormat(this.textStyle);
this.setEnabled(this.enable);
};
FCheckBoxClass.prototype.setHitArea = function (w, h) {
var hit = this.fcb_hitArea_mc;
this.hitArea = hit;
if (this.fcb_states_mc._width > w) {
hit._width = this.fcb_states_mc._width;
} else {
hit._width = w;
}
hit._visible = false;
if (arguments.length > 1) {
hit._height = h;
}
};
FCheckBoxClass.prototype.setSize = function (w) {
this.setLabel(this.getLabel());
this.setLabelPlacement(this.labelPlacement);
if (this.fcb_states_mc._height < this.flabel_mc.labelField._height) {
super.setSize(w, this.flabel_mc.labelField._height);
}
this.setHitArea(this.width, this.height);
this.setLabelPlacement(this.labelPlacement);
};
FCheckBoxClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this._width + 6, this._height - 1);
};
FCheckBoxClass.prototype.onPress = function () {
this.pressFocus();
_root.focusRect.removeMovieClip();
var states = this.fcb_states_mc;
if (this.getValue()) {
states.gotoAndStop("checkedPress");
} else {
states.gotoAndStop("press");
}
};
FCheckBoxClass.prototype.onRelease = function () {
this.fcb_states_mc.gotoAndStop("up");
this.setValue(!this.checked);
};
FCheckBoxClass.prototype.onReleaseOutside = function () {
var states = this.fcb_states_mc;
if (this.getValue()) {
states.gotoAndStop("checkedEnabled");
} else {
states.gotoAndStop("up");
}
};
FCheckBoxClass.prototype.onDragOut = function () {
var states = this.fcb_states_mc;
if (this.getValue()) {
states.gotoAndStop("checkedEnabled");
} else {
states.gotoAndStop("up");
}
};
FCheckBoxClass.prototype.onDragOver = function () {
var states = this.fcb_states_mc;
if (this.getValue()) {
states.gotoAndStop("checkedPress");
} else {
states.gotoAndStop("press");
}
};
FCheckBoxClass.prototype.setValue = function (checkedValue) {
if (checkedValue || (checkedValue == undefined)) {
this.setCheckState(checkedValue);
} else if (checkedValue == false) {
this.setCheckState(checkedValue);
}
this.executeCallBack();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FCheckBoxClass.prototype.setCheckState = function (checkedValue) {
var states = this.fcb_states_mc;
if (this.enable) {
this.flabel_mc.setEnabled(true);
if (checkedValue || (checkedValue == undefined)) {
states.gotoAndStop("checkedEnabled");
this.enabled = true;
this.checked = true;
} else {
states.gotoAndStop("up");
this.enabled = true;
this.checked = false;
}
} else {
this.flabel_mc.setEnabled(false);
if (checkedValue || (checkedValue == undefined)) {
states.gotoAndStop("checkedDisabled");
this.enabled = false;
this.checked = true;
} else {
states.gotoAndStop("uncheckedDisabled");
this.enabled = false;
this.checked = false;
this.focusRect.removeMovieClip();
}
}
};
FCheckBoxClass.prototype.getValue = function () {
return(this.checked);
};
FCheckBoxClass.prototype.setEnabled = function (enable) {
if ((enable == true) || (enable == undefined)) {
this.enable = true;
Super.setEnabled(true);
} else {
this.enable = false;
Super.setEnabled(false);
}
this.setCheckState(this.checked);
};
FCheckBoxClass.prototype.getEnabled = function () {
return(this.enable);
};
FCheckBoxClass.prototype.setLabel = function (label) {
this.fLabel_mc.setLabel(label);
this.txtFormat();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_NAMECHANGE);
}
};
FCheckBoxClass.prototype.getLabel = function () {
return(this.fLabel_mc.labelField.text);
};
FCheckBoxClass.prototype.setTextColor = function (color) {
this.fLabel_mc.labelField.textColor = color;
};
FCheckBoxClass.prototype.myOnKeyDown = function () {
if (((Key.getCode() == 32) && (this.pressOnce == undefined)) && (this.enabled == true)) {
this.setValue(!this.getValue());
this.pressOnce = true;
}
};
FCheckBoxClass.prototype.myOnKeyUp = function () {
if (Key.getCode() == 32) {
this.pressOnce = undefined;
}
};
FCheckBoxClass.prototype.get_accRole = function (childId) {
return(this.master.ROLE_SYSTEM_CHECKBUTTON);
};
FCheckBoxClass.prototype.get_accName = function (childId) {
return(this.master.getLabel());
};
FCheckBoxClass.prototype.get_accState = function (childId) {
if (this.master.getValue()) {
return(this.master.STATE_SYSTEM_CHECKED);
}
return(0);
};
FCheckBoxClass.prototype.get_accDefaultAction = function (childId) {
if (this.master.getValue()) {
return("UnCheck");
}
return("Check");
};
FCheckBoxClass.prototype.accDoDefaultAction = function (childId) {
this.master.setValue(!this.master.getValue());
};
#endinitclip
boundingBox_mc._visible = false;
deadPreview._visible = false;
Symbol 266 MovieClip [FComboBoxItemSymbol] Frame 1
#initclip 13
function FComboBoxItemClass() {
this.init();
}
FComboBoxItemClass.prototype = new FSelectableItemClass();
Object.registerClass("FComboBoxItemSymbol", FComboBoxItemClass);
FComboBoxItemClass.prototype.setSize = function (w, h) {
super.setSize(w, h);
this.highlight_mc.onRollOver = function () {
this.controller.controller.selectionHandler(this.controller.itemNum);
};
};
#endinitclip
Symbol 269 MovieClip [FComboBoxSymbol] Frame 1
#initclip 14
function FComboBoxClass() {
_global._popUpLevel = ((_global._popUpLevel == undefined) ? 20000 : (_global._popUpLevel + 1));
this.superHolder = _root.createEmptyMovieClip("superHolder" + _popUpLevel, _popUpLevel);
var testContainer = this.superHolder.createEmptyMovieClip("testCont", 20000);
var testBox = testContainer.attachMovie("FBoundingBoxSymbol", "boundingBox_mc", 0);
if (testBox._name == undefined) {
this.superHolder.removeMovieClip();
this.superHolder = this._parent.createEmptyMovieClip("superHolder" + _popUpLevel, _popUpLevel);
} else {
testContainer.removeMovieClip();
}
if (this.rowCount == undefined) {
this.rowCount = 8;
this.editable = false;
}
this.itemSymbol = "FComboBoxItemSymbol";
this.init();
this.permaScrollBar = false;
this.proxyBox_mc.gotoAndStop(1);
this.width = this._width;
this.height = (this.proxyBox_mc._height * this._yscale) / 100;
var i = 0;
while (i < this.labels.length) {
this.addItem(this.labels[i], this.data[i]);
i++;
}
this.lastSelected = 0;
this.selectItem(0);
this._xscale = (this._yscale = 100);
this.opened = false;
this.setSize(this.width);
this.highlightTop(false);
if (this.changeHandler.length > 0) {
this.setChangeHandler(this.changeHandler);
}
this.onUnload = function () {
this.superHolder.removeMovieClip();
};
this.setSelectedIndex(0, false);
this.value = "";
this.focusEnabled = true;
this.changeFlag = false;
}
FComboBoxClass.prototype = new FScrollSelectListClass();
Object.registerClass("FComboBoxSymbol", FComboBoxClass);
FComboBoxClass.prototype.modelChanged = function (eventObj) {
super.modelChanged(eventObj);
var event = eventObj.event;
if ((event == "addRows") || (event == "deleteRows")) {
var diff = ((eventObj.lastRow - eventObj.firstRow) + 1);
var mode = ((event == "addRows") ? 1 : -1);
var len = this.getLength();
var lenBefore = (len - (mode * diff));
if ((this.rowCount > lenBefore) || (this.rowCount > len)) {
this.invalidate("setSize");
}
if (this.getSelectedIndex() == undefined) {
this.setSelectedIndex(0, false);
}
} else if (event == "updateAll") {
this.invalidate("setSize");
}
};
FComboBoxClass.prototype.removeAll = function () {
if (!this.enable) {
return(undefined);
}
super.removeAll();
if (this.editable) {
this.value = "";
}
this.invalidate("setSize");
};
FComboBoxClass.prototype.setSize = function (w) {
if ((((w == undefined) || (typeof(w) != "number")) || (w <= 0)) || (!this.enable)) {
return(undefined);
}
this.proxyBox_mc._width = w;
this.container_mc.removeMovieClip();
this.measureItmHgt();
this.container_mc = this.superHolder.createEmptyMovieClip("container", 3);
this.container_mc.tabChildren = false;
this.setPopUpLocation(this.container_mc);
this.container_mc.attachMovie("FBoundingBoxSymbol", "boundingBox_mc", 0);
this.boundingBox_mc = this.container_mc.boundingBox_mc;
this.boundingBox_mc.component = this;
this.registerSkinElement(this.boundingBox_mc.boundingBox, "background");
this.proxyBox_mc._height = this.itmHgt;
this.numDisplayed = Math.min(this.rowCount, this.getLength());
if (this.numDisplayed < 3) {
this.numDisplayed = Math.min(3, this.getLength());
}
this.height = (this.numDisplayed * (this.itmHgt - 2)) + 2;
super.setSize(w, this.height);
this.attachMovie("DownArrow", "downArrow", 10);
this.downArrow._y = 0;
this.downArrow._width = this.itmHgt;
this.downArrow._height = this.itmHgt;
this.downArrow._x = this.proxyBox_mc._width - this.downArrow._width;
this.setEditable(this.editable);
this.container_mc._visible = this.opened;
this.highlightTop(false);
this.fader = this.superHolder.attachMovie("FBoundingBoxSymbol", "faderX", 4);
this.registerSkinElement(this.fader.boundingBox, "background");
this.fader._width = this.width;
this.fader._height = this.height;
this.fader._visible = false;
};
FComboBoxClass.prototype.setDataProvider = function (dp) {
super.setDataProvider(dp);
this.invalidate("setSize");
this.setSelectedIndex(0);
};
FComboBoxClass.prototype.getValue = function () {
if (this.editable) {
return(this.fLabel_mc.getLabel());
}
return(super.getValue());
};
FComboBoxClass.prototype.getRowCount = function () {
return(this.rowCount);
};
FComboBoxClass.prototype.setRowCount = function (count) {
this.rowCount = ((this.getLength() > count) ? (Math.max(count, 3)) : (count));
this.setSize(this.width);
var len = this.getLength();
if ((len - this.getScrollPosition()) < this.rowCount) {
this.setScrollPosition(len - Math.min(this.rowCount, len));
this.invalidate("updateControl");
}
};
FComboBoxClass.prototype.setEditable = function (editableFlag) {
if (!this.enable) {
return(undefined);
}
this.editable = editableFlag;
if (!this.editable) {
this.onPress = this.pressHandler;
this.useHandCursor = false;
this.trackAsMenu = true;
this.attachMovie("FComboBoxItemSymbol", "fLabel_mc", 5, {controller:this, itemNum:-1});
this.fLabel_mc.onRollOver = undefined;
this.fLabel_mc.setSize((this.width - this.itmHgt) + 1, this.itmHgt);
this.topLabel = this.getSelectedItem();
this.fLabel_mc.drawItem(this.topLabel, false);
this.highlightTop(false);
} else {
this.attachMovie("FLabelSymbol", "fLabel_mc", 5);
this.fLabel_txt = this.fLabel_mc.labelField;
this.fLabel_txt.type = "input";
this.fLabel_txt._x = 4;
this.fLabel_txt.onSetFocus = this.onLabelFocus;
this.fLabel_mc.setSize((this.width - this.itmHgt) - 3);
delete this.onPress;
this.fLabel_txt.onKillFocus = function () {
this._parent._parent.myOnKillFocus();
};
this.fLabel_mc.setLabel(this.value);
this.fLabel_txt.onChanged = function () {
this._parent._parent.findInputText();
};
this.downArrow.onPress = this.buttonPressHandler;
this.downArrow.useHandCursor = false;
this.downArrow.trackAsMenu = true;
}
};
FComboBoxClass.prototype.setEnabled = function (enabledFlag) {
enabledFlag = (((enabledFlag == undefined) || (typeof(enabledFlag) != "boolean")) ? true : (enabledFlag));
super.setEnabled(enabledFlag);
this.registerSkinElement(this.boundingBox_mc.boundingBox, "background");
this.proxyBox_mc.gotoAndStop((this.enable ? "enabled" : "disabled"));
this.downArrow.gotoAndStop((this.enable ? 1 : 3));
if (this.editable) {
this.fLabel_txt.type = (enabledFlag ? "input" : "dynamic");
this.fLabel_txt.selectable = enabledFlag;
} else if (enabledFlag) {
this.fLabel_mc.drawItem(this.topLabel, false);
this.setSelectedIndex(this.getSelectedIndex(), false);
}
this.fLabel_mc.setEnabled(this.enable);
this.fLabel_txt.onSetFocus = (enabledFlag ? (this.onLabelFocus) : undefined);
};
FComboBoxClass.prototype.setSelectedIndex = function (index, flag) {
super.setSelectedIndex(index, flag);
if (!this.editable) {
this.topLabel = this.getSelectedItem();
this.fLabel_mc.drawItem(this.topLabel, false);
} else {
this.value = ((flag != undefined) ? "" : (this.getSelectedItem().label));
this.fLabel_mc.setLabel(this.value);
}
this.invalidate("updateControl");
};
FComboBoxClass.prototype.setValue = function (value) {
if (this.editable) {
this.fLabel_mc.setLabel(value);
this.value = value;
}
};
FComboBoxClass.prototype.pressHandler = function () {
this.focusRect.removeMovieClip();
if (this.enable) {
if (!this.opened) {
this.onMouseUp = this.releaseHandler;
} else {
this.onMouseUp = undefined;
}
this.changeFlag = false;
if (!this.focused) {
this.pressFocus();
this.clickFilter = (this.editable ? false : true);
}
if (!this.clickFilter) {
this.openOrClose(!this.opened);
} else {
this.clickFilter = false;
}
}
};
FComboBoxClass.prototype.clickHandler = function (itmNum) {
if (!this.focused) {
if (this.editable) {
this.fLabel_txt.onKillFocus = undefined;
}
this.pressFocus();
}
super.clickHandler(itmNum);
this.selectionHandler(itmNum);
this.onMouseUp = this.releaseHandler;
};
FComboBoxClass.prototype.highlightTop = function (flag) {
if (!this.editable) {
this.fLabel_mc.drawItem(this.topLabel, flag);
}
};
FComboBoxClass.prototype.myOnSetFocus = function () {
super.myOnSetFocus();
this.fLabel_mc.highlight_mc.gotoAndStop("enabled");
this.highlightTop(true);
};
FComboBoxClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this._height + 4);
};
FComboBoxClass.prototype.myOnKillFocus = function () {
if (Selection.getFocus().indexOf("labelField") != -1) {
return(undefined);
}
super.myOnKillFocus();
delete this.fLabel_txt.onKeyDown;
this.openOrClose(false);
this.highlightTop(false);
};
FComboBoxClass.prototype.setPopUpLocation = function (mcRef) {
mcRef._x = this._x;
var point = {x:this._x, y:this._y + this.proxyBox_mc._height};
this._parent.localToGlobal(point);
mcRef._parent.globalToLocal(point);
mcRef._x = point.x;
mcRef._y = point.y;
if ((this.height + mcRef._y) >= Stage.height) {
this.upward = true;
mcRef._y = (point.y - this.height) - this.proxyBox_mc._height;
} else {
this.upward = false;
}
};
FComboBoxClass.prototype.openOrClose = function (flag) {
if (this.getLength() == 0) {
return(undefined);
}
this.setPopUpLocation(this.container_mc);
if ((this.lastSelected != -1) && ((this.lastSelected < this.topDisplayed) || (this.lastSelected > (this.topDisplayed + this.numDisplayed)))) {
super.moveSelBy(this.lastSelected - this.getSelectedIndex());
}
if (!flag) {
(this.downArrow.gotoAndStop(1));// not popped
} else {
(this.downArrow.gotoAndStop(2));// not popped
}
if (flag == this.opened) {
return(undefined);
}
this.highlightTop(!flag);
this.fadeRate = this.styleTable.popUpFade.value;
if (((!flag) || (this.fadeRate == undefined)) || (this.fadeRate == 0)) {
this.opened = (this.container_mc._visible = flag);
return(undefined);
}
this.setPopUpLocation(this.fader);
this.time = 0;
this.const = 85 / Math.sqrt(this.fadeRate);
this.fader._alpha = 85;
this.container_mc._visible = (this.fader._visible = true);
this.onEnterFrame = function () {
this.fader._alpha = 100 - ((this.const * Math.sqrt(++this.time)) + 15);
if (this.time >= this.fadeRate) {
this.fader._visible = false;
delete this.onEnterFrame;
this.opened = true;
}
};
};
FComboBoxClass.prototype.fireChange = function () {
this.lastSelected = this.getSelectedIndex();
if (!this.editable) {
this.topLabel = this.getSelectedItem();
this.fLabel_mc.drawItem(this.topLabel, true);
} else {
this.value = this.getSelectedItem().label;
this.fLabel_mc.setLabel(this.value);
}
this.executeCallback();
};
FComboBoxClass.prototype.releaseHandler = function () {
var onCombo = this.boundingBox_mc.hitTest(_root._xmouse, _root._ymouse);
if (this.changeFlag) {
if (onCombo) {
this.fireChange();
}
this.openOrClose(!this.opened);
} else if (onCombo) {
this.openOrClose(false);
} else {
this.onMouseDown = function () {
if ((!this.boundingBox_mc.hitTest(_root._xmouse, _root._ymouse)) && (!this.hitTest(_root._xmouse, _root._ymouse))) {
this.onMouseDown = undefined;
this.openOrClose(false);
}
};
}
this.changeFlag = false;
this.onMouseUp = undefined;
clearInterval(this.dragScrolling);
this.dragScrolling = undefined;
};
FComboBoxClass.prototype.moveSelBy = function (itemNum) {
if (itemNum != 0) {
super.moveSelBy(itemNum);
if (this.editable) {
this.setValue(this.getSelectedItem().label);
}
if (!this.opened) {
if (this.changeFlag && (!this.isSelected(this.lastSelected))) {
this.fireChange();
}
}
}
};
FComboBoxClass.prototype.myOnKeyDown = function () {
if (!this.focused) {
return(undefined);
}
if (this.editable && (Key.isDown(13))) {
this.setValue(this.fLabel_mc.getLabel());
this.executeCallback();
this.openOrClose(false);
} else if ((Key.isDown(13) || (Key.isDown(32) && (!this.editable))) && (this.opened)) {
if (this.getSelectedIndex() != this.lastSelected) {
this.fireChange();
}
this.openOrClose(false);
this.fLabel_txt.hscroll = 0;
}
super.myOnKeyDown();
};
FComboBoxClass.prototype.findInputText = function () {
if (!this.editable) {
super.findInputText();
}
};
FComboBoxClass.prototype.onLabelFocus = function () {
this._parent._parent.tabFocused = false;
this._parent._parent.focused = true;
this.onKeyDown = function () {
this._parent._parent.myOnKeyDown();
};
Key.addListener(this);
};
FComboBoxClass.prototype.buttonPressHandler = function () {
this._parent.pressHandler();
};
#endinitclip
this.deadPreview._visible = false;
Instance of Symbol 177 MovieClip [FScrollSelectListSymbol] "superClassAsset" in Symbol 269 MovieClip [FComboBoxSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
}
Symbol 272 MovieClip [FRadioButtonSymbol] Frame 1
#initclip 10
function FRadioButtonClass() {
this.init();
}
function FRadioButtonGroupClass() {
this.radioInstances = new Array();
}
FRadioButtonClass.prototype = new FUIComponentClass();
FRadioButtonGroupClass.prototype = new FUIComponentClass();
Object.registerClass("FRadioButtonSymbol", FRadioButtonClass);
FRadioButtonClass.prototype.init = function () {
if (this.initialState == undefined) {
this.selected = false;
} else {
this.selected = this.initialState;
}
super.setSize(this._width, this._height);
this.boundingBox_mc.unloadMovie();
this.boundingBox_mc._width = 0;
this.boundingBox_mc._height = 0;
this.attachMovie("frb_hitArea", "frb_hitArea_mc", 1);
this.attachMovie("frb_states", "frb_states_mc", 2);
this.attachMovie("FLabelSymbol", "fLabel_mc", 3);
super.init();
this._xscale = 100;
this._yscale = 100;
this.setSize(this.width, this.height);
this.setChangeHandler(this.changeHandler);
if (this.label != undefined) {
this.setLabel(this.label);
}
if (this.initialState == undefined) {
this.setValue(false);
} else {
this.setValue(this.initialState);
}
if (this.data == "") {
this.data = undefined;
} else {
this.setData(this.data);
}
this.addToRadioGroup();
this.ROLE_SYSTEM_RADIOBUTTON = 45;
this.STATE_SYSTEM_SELECTED = 16;
this.EVENT_OBJECT_STATECHANGE = 32778;
this.EVENT_OBJECT_NAMECHANGE = 32780;
this._accImpl.master = this;
this._accImpl.stub = false;
this._accImpl.get_accRole = this.get_accRole;
this._accImpl.get_accName = this.get_accName;
this._accImpl.get_accState = this.get_accState;
this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
};
FRadioButtonClass.prototype.setHitArea = function (w, h) {
var hit = this.frb_hitArea_mc;
this.hitArea = hit;
if (this.frb_states_mc._width > w) {
hit._width = this.frb_states_mc._width;
} else {
hit._width = w;
}
hit._visible = false;
if (arguments.length > 1) {
hit._height = h;
}
};
FRadioButtonClass.prototype.txtFormat = function (pos) {
var txtS = this.textStyle;
var sTbl = this.styleTable;
txtS.align = ((sTbl.textAlign.value == undefined) ? ((txtS.align = pos)) : undefined);
txtS.leftMargin = ((sTbl.textLeftMargin.value == undefined) ? ((txtS.leftMargin = 0)) : undefined);
txtS.rightMargin = ((sTbl.textRightMargin.value == undefined) ? ((txtS.rightMargin = 0)) : undefined);
if (this.flabel_mc._height > this.height) {
super.setSize(this.width, this.flabel_mc._height);
} else {
super.setSize(this.width, this.height);
}
this.setEnabled(this.enable);
};
FRadioButtonClass.prototype.setSize = function (w, h) {
this.setLabel(this.getLabel());
this.setLabelPlacement(this.labelPlacement);
if (this.frb_states_mc._height < this.flabel_mc.labelField._height) {
super.setSize(w, this.flabel_mc.labelField._height);
}
this.setHitArea(this.width, this.height);
this.setLabelPlacement(this.labelPlacement);
};
FRadioButtonClass.prototype.setLabelPlacement = function (pos) {
this.setLabel(this.getLabel());
this.txtFormat(pos);
var halfLabelH = (this.fLabel_mc._height / 2);
var halfFrameH = (this.frb_states_mc._height / 2);
var vertCenter = (halfFrameH - halfLabelH);
var radioWidth = this.frb_states_mc._width;
var frame = this.frb_states_mc;
var label = this.fLabel_mc;
var w = (this.width - frame._width);
if (frame._width > this.width) {
w = 0;
} else {
w = this.width - frame._width;
}
this.fLabel_mc.setSize(w);
if ((pos == "right") || (pos == undefined)) {
this.labelPlacement = "right";
this.frb_states_mc._x = 0;
this.fLabel_mc._x = radioWidth;
this.txtFormat("left");
} else if (pos == "left") {
this.labelPlacement = "left";
this.fLabel_mc._x = 0;
this.frb_states_mc._x = this.width - radioWidth;
this.txtFormat("right");
}
this.fLabel_mc._y = vertCenter;
this.frb_hitArea_mc._y = vertCenter;
this.setLabel(this.getLabel());
};
FRadioButtonClass.prototype.setData = function (dataValue) {
this.data = dataValue;
};
FRadioButtonClass.prototype.getData = function () {
return(this.data);
};
FRadioButtonClass.prototype.getState = function () {
return(this.selected);
};
FRadioButtonClass.prototype.getSize = function () {
return(this.width);
};
FRadioButtonClass.prototype.getGroupName = function () {
return(this.groupName);
};
FRadioButtonClass.prototype.setGroupName = function (groupName) {
var i = 0;
while (i < this._parent[this.groupName].radioInstances.length) {
if (this._parent[this.groupName].radioInstances[i] == this) {
delete this._parent[this.groupName].radioInstances[i];
}
i++;
}
this.groupName = groupName;
this.addToRadioGroup();
};
FRadioButtonClass.prototype.addToRadioGroup = function () {
if (this._parent[this.groupName] == undefined) {
this._parent[this.groupName] = new FRadioButtonGroupClass();
}
this._parent[this.groupName].addRadioInstance(this);
};
FRadioButtonClass.prototype.setValue = function (selected) {
if (selected || (selected == undefined)) {
this.setState(true);
this.focusRect.removeMovieClip();
this.executeCallBack();
} else if (selected == false) {
this.setState(false);
}
};
FRadioButtonClass.prototype.setTabState = function (selected) {
Selection.setFocus(this);
this.setState(selected);
this.drawFocusRect();
this.executeCallBack();
};
FRadioButtonClass.prototype.setState = function (selected) {
if (selected || (selected == undefined)) {
this.tabEnabled = true;
for (var i in this._parent) {
if ((this != this._parent[i]) && (this._parent[i].groupName == this.groupName)) {
this._parent[i].setState(false);
this._parent[i].tabEnabled = false;
}
}
}
if (this.enable) {
this.flabel_mc.setEnabled(true);
if (selected || (selected == undefined)) {
this.frb_states_mc.gotoAndStop("selectedEnabled");
this.enabled = false;
this.selected = true;
this.tabEnabled = true;
this.tabFocused = true;
} else {
this.frb_states_mc.gotoAndStop("unselectedEnabled");
this.enabled = true;
this.selected = false;
this.tabEnabled = false;
var enabTrue = this._parent[this.groupName].getEnabled();
var noneSelect = (this._parent[this.groupName].getValue() == undefined);
if (enabTrue && (noneSelect)) {
this._parent[this.groupName].radioInstances[0].tabEnabled = true;
}
}
} else {
this.flabel_mc.setEnabled(false);
if (selected || (selected == undefined)) {
this.frb_states_mc.gotoAndStop("selectedDisabled");
this.enabled = false;
this.selected = true;
this.tabEnabled = false;
} else {
this.frb_states_mc.gotoAndStop("unselectedDisabled");
this.enabled = false;
this.selected = false;
this.tabEnabled = false;
}
}
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_STATECHANGE, true);
}
};
FRadioButtonClass.prototype.getValue = function () {
if (this.selected) {
if ((this.data == "") || (this.data == undefined)) {
return(this.getLabel());
}
return(this.data);
}
};
FRadioButtonClass.prototype.setEnabled = function (enable) {
if ((enable == true) || (enable == undefined)) {
this.enable = true;
super.setEnabled(true);
} else {
this.enable = false;
super.setEnabled(false);
}
this.setState(this.selected);
var cgn = (this._parent[this.groupName].getEnabled() == undefined);
var cgnez = (this._parent[this.groupName].radioInstances[0].getEnabled() == false);
if (cgn && (cgnez)) {
var i = 0;
while (i < this._parent[this.groupName].radioInstances.length) {
if (this._parent[this.groupName].radioInstances[i].getEnabled() == true) {
this._parent[this.groupName].radioInstances[i].tabEnabled = true;
return(undefined);
}
i++;
}
}
};
FRadioButtonClass.prototype.getEnabled = function () {
return(this.enable);
};
FRadioButtonClass.prototype.setLabel = function (label) {
this.fLabel_mc.setLabel(label);
this.txtFormat();
if (Accessibility.isActive()) {
Accessibility.sendEvent(this, 0, this.EVENT_OBJECT_NAMECHANGE);
}
};
FRadioButtonClass.prototype.getLabel = function () {
return(this.fLabel_mc.getLabel());
};
FRadioButtonClass.prototype.onPress = function () {
this.pressFocus();
this.frb_states_mc.gotoAndStop("press");
};
FRadioButtonClass.prototype.onRelease = function () {
this.frb_states_mc.gotoAndStop("unselectedDisabled");
this.setValue(!this.selected);
};
FRadioButtonClass.prototype.onReleaseOutside = function () {
this.frb_states_mc.gotoAndStop("unselectedEnabled");
};
FRadioButtonClass.prototype.onDragOut = function () {
this.frb_states_mc.gotoAndStop("unselectedEnabled");
};
FRadioButtonClass.prototype.onDragOver = function () {
this.frb_states_mc.gotoAndStop("press");
};
FRadioButtonClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this._parent[this.groupName]);
};
FRadioButtonGroupClass.prototype.addRadioInstance = function (instance) {
this.radioInstances.push(instance);
this.radioInstances[0].tabEnabled = true;
};
FRadioButtonGroupClass.prototype.setEnabled = function (enableFlag) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setEnabled(enableFlag);
i++;
}
};
FRadioButtonGroupClass.prototype.getEnabled = function () {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].getEnabled() != this.radioInstances[0].getEnabled()) {
return(undefined);
}
i++;
}
return(this.radioInstances[0].getEnabled());
};
FRadioButtonGroupClass.prototype.setChangeHandler = function (changeHandler, obj) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setChangeHandler(changeHandler, obj);
i++;
}
};
FRadioButtonGroupClass.prototype.getValue = function () {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].selected == true) {
if ((this.radioInstances[i].data == "") || (this.radioInstances[i].data == undefined)) {
return(this.radioInstances[i].getLabel());
}
return(this.radioInstances[i].data);
}
i++;
}
};
FRadioButtonGroupClass.prototype.getData = function () {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].selected) {
return(this.radioInstances[i].getData());
}
i++;
}
};
FRadioButtonGroupClass.prototype.getInstance = function () {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].selected == true) {
return(i);
}
i++;
}
};
FRadioButtonGroupClass.prototype.setValue = function (dataValue) {
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].data == dataValue) {
this.radioInstances[i].setValue(true);
return(undefined);
}
i++;
}
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].getLabel() == dataValue) {
this.radioInstances[i].setValue(true);
}
i++;
}
};
FRadioButtonGroupClass.prototype.setSize = function (w) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setSize(w);
i++;
}
};
FRadioButtonGroupClass.prototype.getSize = function () {
var widestRadio = 0;
var i = 0;
while (i < this.radioInstances.length) {
if (this.radioInstances[i].width >= widestRadio) {
widestRadio = this.radioInstances[i].width;
}
i++;
}
return(widestRadio);
};
FRadioButtonGroupClass.prototype.setGroupName = function (groupName) {
this.oldGroupName = this.radioInstances[0].groupName;
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].groupName = groupName;
this.radioInstances[i].addToRadioGroup();
i++;
}
delete this._parent[this.oldGroupName];
};
FRadioButtonGroupClass.prototype.getGroupName = function () {
return(this.radioInstances[0].groupName);
};
FRadioButtonGroupClass.prototype.setLabelPlacement = function (pos) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setLabelPlacement(pos);
i++;
}
};
FRadioButtonGroupClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].setStyleProperty(propName, value, isGlobal);
i++;
}
};
FRadioButtonGroupClass.prototype.addListener = function () {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].addListener();
i++;
}
};
FRadioButtonGroupClass.prototype.applyChanges = function () {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].applyChanges();
i++;
}
};
FRadioButtonGroupClass.prototype.removeListener = function (component) {
var i = 0;
while (i < this.radioInstances.length) {
this.radioInstances[i].removeListener(component);
i++;
}
};
FRadioButtonClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this._width + 6, this._height - 3);
};
FRadioButtonClass.prototype.myOnKillFocus = function () {
Key.removeListener(this.keyListener);
this.focused = false;
this.focusRect.removeMovieClip();
this._parent[this.groupName].foobar = 0;
};
FRadioButtonClass.prototype.myOnKeyDown = function () {
if ((Key.getCode() == 32) && (this._parent[this.groupName].getValue() == undefined)) {
if (this._parent[this.groupName].radioInstances[0] == this) {
this.setTabState(true);
}
}
if ((Key.getCode() == 40) && (this.pressOnce == undefined)) {
this.foobar = this._parent[this.groupName].getInstance();
var i = this.foobar;
while (i < this._parent[this.groupName].radioInstances.length) {
var inc = (i + 1);
if (this._parent[this.groupName].radioInstances[inc].getEnabled()) {
this._parent[this.groupName].radioInstances[inc].setTabState(true);
return(undefined);
}
i++;
}
}
if ((Key.getCode() == 38) && (this.pressOnce == undefined)) {
this.foobar = this._parent[this.groupName].getInstance();
var i = this.foobar;
while (i >= 0) {
var inc = (i - 1);
if (this._parent[this.groupName].radioInstances[inc].getEnabled()) {
this._parent[this.groupName].radioInstances[inc].setTabState(true);
return(undefined);
}
i--;
}
}
};
FRadioButtonClass.prototype.get_accRole = function (childId) {
return(this.master.ROLE_SYSTEM_RADIOBUTTON);
};
FRadioButtonClass.prototype.get_accName = function (childId) {
return(this.master.getLabel());
};
FRadioButtonClass.prototype.get_accState = function (childId) {
if (this.master.getState()) {
return(this.master.STATE_SYSTEM_SELECTED);
}
return(0);
};
FRadioButtonClass.prototype.get_accDefaultAction = function (childId) {
if (this.master.getState()) {
return("UnCheck");
}
return("Check");
};
FRadioButtonClass.prototype.accDoDefaultAction = function (childId) {
this.master.setValue(!this.master.getValue());
};
#endinitclip
boundingBox_mc._visible = false;
deadPreview._visible = false;
Symbol 276 MovieClip [FScrollPaneSymbol] Frame 1
#initclip 12
function FScrollPaneClass() {
function boolToString(str) {
if (str == "false") {
return(false);
}
if (str == "true") {
return(true);
}
return(str);
}
this.init();
this.width = this._width;
this.height = this._height;
this._xscale = (this._yscale = 100);
this.contentWidth = (this.contentHeight = 0);
if (this.hScroll == undefined) {
this.hScroll = (this.vScroll = "auto");
this.dragContent = false;
}
this.offset = new Object();
this.vScroll = boolToString(this.vScroll);
this.hScroll = boolToString(this.hScroll);
this.attachMovie("FScrollBarSymbol", "hScrollBar_mc", 100, {hostStyle:this.styleTable});
this.hScrollBar_mc.setHorizontal(true);
this.hScrollBar_mc.setSmallScroll(5);
this.hScrollBar_mc.setChangeHandler("onScroll", this);
this.attachMovie("FScrollBarSymbol", "vScrollBar_mc", 99, {hostStyle:this.styleTable});
this.vScrollBar_mc.setSmallScroll(5);
this.vScrollBar_mc.setChangeHandler("onScroll", this);
this.setSize(this.width, this.height);
if (this.scrollContent != "") {
this.setScrollContent(this.scrollContent);
}
this.setDragContent(this.dragContent);
}
FScrollPaneClass.prototype = new FUIComponentClass();
Object.registerClass("FScrollPaneSymbol", FScrollPaneClass);
FScrollPaneClass.prototype.getScrollContent = function () {
return(this.content_mc);
};
FScrollPaneClass.prototype.getPaneWidth = function () {
return(this.width);
};
FScrollPaneClass.prototype.getPaneHeight = function () {
return(this.height);
};
FScrollPaneClass.prototype.getScrollPosition = function () {
var xPos = ((this.hScrollBar_mc == undefined) ? 0 : (this.hScrollBar_mc.getScrollPosition()));
var yPos = ((this.vScrollBar_mc == undefined) ? 0 : (this.vScrollBar_mc.getScrollPosition()));
return({x:xPos, y:yPos});
};
FScrollPaneClass.prototype.setScrollContent = function (target) {
this.offset.x = 0;
this.offset.y = 0;
if (this.content_mc != undefined) {
if (target != this.content_mc) {
this.content_mc._visible = false;
this.content_mc.removeMovieClip();
this.content_mc.unloadMovie();
}
}
if (typeof(target) == "string") {
this.attachMovie(target, "tmp_mc", 3);
this.content_mc = this.tmp_mc;
} else if (target == undefined) {
this.content_mc.unloadMovie();
} else {
this.content_mc = target;
}
this.localToGlobal(this.offset);
this.content_mc._parent.globalToLocal(this.offset);
this.content_mc._x = this.offset.x;
this.content_mc._y = this.offset.y;
var contentBounds = this.content_mc.getBounds(this);
this.offset.x = -contentBounds.xMin;
this.offset.y = -contentBounds.yMin;
this.localToGlobal(this.offset);
this.content_mc._parent.globalToLocal(this.offset);
this.content_mc._x = this.offset.x;
this.content_mc._y = this.offset.y;
this.contentWidth = this.content_mc._width;
this.contentHeight = this.content_mc._height;
this.content_mc.setMask(this.mask_mc);
this.setSize(this.width, this.height);
};
FScrollPaneClass.prototype.setSize = function (w, h) {
if (((arguments.length < 2) || (isNaN(w))) || (isNaN(h))) {
return(undefined);
}
super.setSize(w, h);
this.width = Math.max(w, 60);
this.height = Math.max(h, 60);
this.boundingBox_mc._xscale = 100;
this.boundingBox_mc._yscale = 100;
this.boundingBox_mc._width = this.width;
this.boundingBox_mc._height = this.height;
this.setHandV();
this.initScrollBars();
if (this.mask_mc == undefined) {
this.attachMovie("FBoundingBoxSymbol", "mask_mc", 3000);
}
this.mask_mc._xscale = 100;
this.mask_mc._yscale = 100;
this.mask_mc._width = this.hWidth;
this.mask_mc._height = this.vHeight;
this.mask_mc._alpha = 0;
};
FScrollPaneClass.prototype.setScrollPosition = function (x, y) {
x = Math.max(this.hScrollBar_mc.minPos, x);
x = Math.min(this.hScrollBar_mc.maxPos, x);
y = Math.max(this.vScrollBar_mc.minPos, y);
y = Math.min(this.vScrollBar_mc.maxPos, y);
this.hScrollBar_mc.setScrollPosition(x);
this.vScrollBar_mc.setScrollPosition(y);
};
FScrollPaneClass.prototype.refreshPane = function () {
this.setScrollContent(this.content_mc);
};
FScrollPaneClass.prototype.loadScrollContent = function (url, handler, location) {
this.content_mc.removeMovieClip();
this.content_mc.unloadMovie();
this.content_mc._visible = 0;
this.loadContent.duplicateMovieClip("loadTemp", 3);
this.dupeFlag = true;
this.contentLoaded = function () {
this.loadReady = false;
this.content_mc = this.loadTemp;
this.refreshPane();
this.executeCallBack();
};
this.setChangeHandler(handler, location);
this.loadTemp.loadMovie(url);
};
FScrollPaneClass.prototype.setHScroll = function (prop) {
this.hScroll = prop;
this.setSize(this.width, this.height);
};
FScrollPaneClass.prototype.setVScroll = function (prop) {
this.vScroll = prop;
this.setSize(this.width, this.height);
};
FScrollPaneClass.prototype.setDragContent = function (dragFlag) {
if (dragFlag) {
this.boundingBox_mc.useHandCursor = true;
this.boundingBox_mc.onPress = function () {
this._parent.startDragLoop();
};
this.boundingBox_mc.tabEnabled = false;
this.boundingBox_mc.onRelease = (this.boundingBox_mc.onReleaseOutside = function () {
this._parent.pressFocus();
this._parent.onMouseMove = null;
});
} else {
delete this.boundingBox_mc.onPress;
this.boundingBox_mc.useHandCursor = false;
}
};
FScrollPaneClass.prototype.setSmallScroll = function (x, y) {
this.hScrollBar_mc.setSmallScroll(x);
this.vScrollBar_mc.setSmallScroll(y);
};
FScrollPaneClass.prototype.setHandV = function () {
if ((((this.contentHeight - this.height) > 2) && (this.vScroll != false)) || (this.vScroll == true)) {
this.hWidth = this.width - this.vScrollBar_mc._width;
} else {
this.hWidth = this.width;
}
if ((((this.contentWidth - this.width) > 2) && (this.hScroll != false)) || (this.hScroll == true)) {
this.vHeight = this.height - this.hScrollBar_mc._height;
} else {
this.vHeight = this.height;
}
};
FScrollPaneClass.prototype.startDragLoop = function () {
this.tabFocused = false;
this.myOnSetFocus();
this.lastX = this._xmouse;
this.lastY = this._ymouse;
this.onMouseMove = function () {
this.scrollXMove = this.lastX - this._xmouse;
this.scrollYMove = this.lastY - this._ymouse;
this.scrollXMove = this.scrollXMove + this.hScrollBar_mc.getScrollPosition();
this.scrollYMove = this.scrollYMove + this.vScrollBar_mc.getScrollPosition();
this.setScrollPosition(this.scrollXMove, this.scrollYMove);
if ((this.scrollXMove < this.hScrollBar_mc.maxPos) && (this.scrollXMove > this.hScrollBar_mc.minPos)) {
this.lastX = this._xmouse;
}
if ((this.scrollYMove < this.vScrollBar_mc.maxPos) && (this.scrollYMove > this.vScrollBar_mc.minPos)) {
this.lastY = this._ymouse;
}
this.updateAfterEvent();
};
};
FScrollPaneClass.prototype.initScrollBars = function () {
this.hScrollBar_mc._y = this.height - this.hScrollBar_mc._height;
this.hScrollBar_mc.setSize(this.hWidth);
this.hScrollBar_mc.setScrollProperties(this.hWidth, 0, this.contentWidth - this.hWidth);
this.vScrollBar_mc._visible = ((this.hWidth == this.width) ? false : true);
this.vScrollBar_mc._x = this.width - this.vScrollBar_mc._width;
this.vScrollBar_mc.setSize(this.vHeight);
this.vScrollBar_mc.setScrollProperties(this.vHeight, 0, this.contentHeight - this.vHeight);
this.hScrollBar_mc._visible = ((this.vHeight == this.height) ? false : true);
};
FScrollPaneClass.prototype.onScroll = function (component) {
var pos = component.getScrollPosition();
var XorY = ((component._name == "hScrollBar_mc") ? "x" : "y");
if (component._name == "hScrollBar_mc") {
this.content_mc._x = (-pos) + this.offset.x;
} else {
this.content_mc._y = (-pos) + this.offset.y;
}
};
FScrollPaneClass.prototype.myOnKeyDown = function () {
var posX = this.hScrollBar_mc.getScrollPosition();
var posY = this.vScrollBar_mc.getScrollPosition();
if (this.hScrollBar_mc.maxPos > this.hScrollBar_mc.minPos) {
if (Key.isDown(37)) {
this.setScrollPosition(posX - 3, posY);
} else if (Key.isDown(39)) {
this.setScrollPosition(posX + 3, posY);
}
}
if (this.vScrollBar_mc.maxPos > this.vScrollBar_mc.minPos) {
if (Key.isDown(38)) {
this.setScrollPosition(posX, posY - 3);
} else if (Key.isDown(40)) {
this.setScrollPosition(posX, posY + 3);
} else if (Key.isDown(34)) {
this.setScrollPosition(posX, posY + this.vScrollBar_mc.pageSize);
} else if (Key.isDown(33)) {
this.setScrollPosition(posX, posY - this.vScrollBar_mc.pageSize);
}
}
};
#endinitclip
this.deadPreview._visible = false;
Instance of Symbol 173 MovieClip [FScrollBarSymbol] "scrollBarAsset" in Symbol 276 MovieClip [FScrollPaneSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
_targetInstanceName = "";
horizontal = false;
}
Instance of Symbol 273 MovieClip "loadContent" in Symbol 276 MovieClip [FScrollPaneSymbol] Frame 1
onClipEvent (load) {
if (this._parent.loadReady) {
this._parent.contentLoaded();
delete this._parent.loadReady;
} else if (this._name != "loadContent") {
this._parent.loadReady = true;
}
}
Symbol 295 MovieClip Frame 1
stop();
antiPause = true;
Symbol 296 MovieClip [e.core] Frame 1
link = "core";
stop();
Symbol 298 MovieClip [e.laser_] Frame 1
link = "laser_";
niceName = "Laser";
stop();
Symbol 299 MovieClip [editor.coreAI] Frame 1
onLoad();
Instance of Symbol 269 MovieClip [FComboBoxSymbol] "coreGunAI_combobox" in Symbol 299 MovieClip [editor.coreAI] Frame 1
//component parameters
onClipEvent (initialize) {
editable = false;
labels = [];
labels[0] = "None";
labels[1] = "coreGun_double";
labels[2] = "coreGun_spread";
labels[3] = "coreGun_4way_2shot";
labels[4] = "coreGun_twinRapid";
data = [];
data[0] = "";
data[1] = "coreGun_double";
data[2] = "coreGun_spread";
data[3] = "coreGun_4way_2shot";
data[4] = "coreGun_twinRapid";
rowCount = 8;
changeHandler = "comboboxHandler";
}
Instance of Symbol 173 MovieClip [FScrollBarSymbol] "scrollBar" in Symbol 299 MovieClip [editor.coreAI] Frame 1
//component parameters
onClipEvent (initialize) {
_targetInstanceName = "inputTxtField";
horizontal = false;
}
Symbol 305 MovieClip [editor.gallery] Frame 1
Instance of Symbol 184 MovieClip [FListBoxSymbol] "levelsListBox" in Symbol 305 MovieClip [editor.gallery] Frame 1
//component parameters
onClipEvent (initialize) {
labels = [];
labels[0] = "Loading Data....";
selectMultiple = false;
changeHandler = "";
}
Symbol 313 MovieClip [editor.gallery.rename] Frame 1
dummy.useHandCursor = false;
stop();
Instance of Symbol 276 MovieClip [FScrollPaneSymbol] "com" in Symbol 315 MovieClip [editor.library] Frame 1
//component parameters
onClipEvent (initialize) {
scrollContent = "editor.library.parts";
hScroll = "auto";
vScroll = "auto";
dragContent = false;
}
Symbol 320 MovieClip Frame 1
stop();
antiPause = true;
Instance of Symbol 319 MovieClip in Symbol 320 MovieClip Frame 2
onClipEvent (enterFrame) {
this._rotation = this._rotation + 2;
}
Symbol 321 MovieClip [e.box] Frame 1
link = "box";
stop();
Symbol 323 MovieClip [e.jet] Frame 1
link = "jet";
stop();
Symbol 326 MovieClip Frame 1
stop();
antiPause = true;
Symbol 327 MovieClip [e.rhombus] Frame 1
stop();
link = "rhombus";
Symbol 330 MovieClip Frame 1
antiPause = true;
stop();
Symbol 330 MovieClip Frame 2
antiPause = false;
Symbol 331 MovieClip [e.spread] Frame 1
link = "spread";
niceName = "Spread";
stop();
Symbol 334 MovieClip Frame 1
stop();
antiPause = true;
Symbol 334 MovieClip Frame 2
antiPause = false;
Symbol 335 MovieClip [e.single] Frame 1
link = "single";
niceName = "Single Shot";
stop();
Symbol 337 MovieClip [e.tri] Frame 1
link = "tri";
stop();
Symbol 339 MovieClip [e.smallbox] Frame 1
link = "smallbox";
stop();
Symbol 342 MovieClip Frame 1
stop();
antiPause = true;
Symbol 343 MovieClip [e.circle] Frame 1
link = "circle";
stop();
Symbol 353 MovieClip Frame 1
stop();
antiPause = true;
Symbol 353 MovieClip Frame 2
antiPause = false;
Symbol 353 MovieClip Frame 20
_root.enemy_fireBullet(this._parent, "square", this._parent._rotation + 90, _root.enemy_destroyableBullets);
Symbol 353 MovieClip Frame 40
_root.enemy_fireBullet(this._parent, "square", this._parent._rotation + 90, _root.enemy_destroyableBullets);
Symbol 354 MovieClip [e.square] Frame 1
link = "square";
niceName = "Rocket";
stop();
Symbol 357 MovieClip Frame 1
stop();
antiPause = true;
Symbol 358 MovieClip [e.stick] Frame 1
link = "stick";
stop();
Symbol 364 MovieClip Frame 1
stop();
antiPause = true;
Symbol 365 MovieClip [e.oddbox] Frame 1
link = "oddbox";
stop();
Symbol 368 MovieClip Frame 1
stop();
antiPause = true;
Symbol 369 MovieClip [e.stick2] Frame 1
link = "stick2";
stop();
Symbol 371 MovieClip Frame 1
stop();
antiPause = true;
Symbol 372 MovieClip [e.tube] Frame 1
link = "tube";
stop();
Symbol 375 MovieClip Frame 1
stop();
antiPause = true;
Symbol 375 MovieClip Frame 2
play();
Symbol 376 MovieClip [e.tube2] Frame 1
link = "tube2";
stop();
Symbol 379 MovieClip Frame 1
stop();
antiPause = true;
Symbol 380 MovieClip [e.oddbox2] Frame 1
link = "oddbox2";
stop();
Symbol 401 MovieClip Frame 1
stop();
antiPause = true;
Instance of Symbol 400 MovieClip in Symbol 401 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndPlay(random(31) + 1);
}
Symbol 402 MovieClip [e.forcefieldLine] Frame 1
link = "forcefieldLine";
stop();
Symbol 410 MovieClip Frame 1
stop();
antiPause = true;
Symbol 411 MovieClip [e.switch2] Frame 1
link = "switch2";
stop();
Symbol 414 MovieClip Frame 1
stop();
antiPause = true;
Symbol 415 MovieClip [e.switch1] Frame 1
link = "switch1";
stop();
Symbol 418 MovieClip Frame 1
stop();
antiPause = true;
Symbol 419 MovieClip [e.switch3] Frame 1
link = "switch3";
stop();
Symbol 422 MovieClip Frame 1
stop();
antiPause = true;
Symbol 423 MovieClip [e.switch4] Frame 1
link = "switch4";
stop();
Symbol 426 MovieClip Frame 1
stop();
antiPause = true;
Symbol 427 MovieClip [e.switch1b] Frame 1
link = "switch1b";
stop();
Symbol 428 MovieClip Frame 1
stop();
antiPause = true;
Symbol 429 MovieClip [e.switch2b] Frame 1
link = "switch2b";
stop();
Symbol 430 MovieClip Frame 1
stop();
antiPause = true;
Symbol 431 MovieClip [e.switch3b] Frame 1
link = "switch3b";
stop();
Symbol 433 MovieClip Frame 1
stop();
antiPause = true;
Symbol 434 MovieClip [e.switch4b] Frame 1
link = "switch4b";
stop();
Symbol 439 MovieClip Frame 1
stop();
antiPause = true;
Symbol 439 MovieClip Frame 2
antiPause = false;
Symbol 440 MovieClip [e.singu] Frame 1
stop();
link = "singu";
niceName = "Singularity";
Symbol 442 MovieClip [e.rect] Frame 1
link = "rect";
niceName = "Plain Square";
stop();
Symbol 444 MovieClip [e.c] Frame 1
link = "c";
niceName = "Plain Circle";
stop();
Symbol 446 MovieClip [e.rightTri] Frame 1
link = "rightTri";
stop();
Symbol 459 MovieClip [editor.login] Frame 1
function checkboxHandler() {
rememberMe = checkbox.getValue();
}
Selection.setFocus(usernameInput_field);
dummy.useHandCursor = false;
pwInput_field.password = true;
stop();
usernameInput_field.tabIndex = 100;
pwInput_field.tabIndex = 101;
this.onEnterFrame = function () {
if (Key.isDown(13)) {
loginBtn.onRelease();
}
};
var rememberMe = false;
Instance of Symbol 265 MovieClip [FCheckBoxSymbol] "checkbox" in Symbol 459 MovieClip [editor.login] Frame 1
//component parameters
onClipEvent (initialize) {
label = "";
initialValue = false;
labelPlacement = "right";
changeHandler = "checkboxHandler";
}
Symbol 481 MovieClip Frame 1
function colour(index) {
i = 0;
while (i < color_list.length) {
j = index;
while (j < (index + 3)) {
k = 0;
while (k < color_list.length) {
list.push((color_list[j] + color_list[k]) + color_list[i]);
k++;
}
j++;
}
i++;
}
}
function swatchCreator() {
var BG = pick_mc.createEmptyMovieClip("lg", ++cpDepth);
BG.beginFill(6710886);
BG.lineStyle(2, 2);
BG.moveTo(1, 1);
BG.lineTo(BG_WIDTH, 1);
BG.lineTo(BG_WIDTH, 199);
BG.lineTo(1, 199);
BG.lineTo(1, 1);
pick_mc.createTextField("cValue", ++cpDepth, 73, 6, 70, 18);
var tf = pick_mc.cValue;
tf.type = "input";
tf.border = true;
var text_txt = new TextFormat();
text_txt.font = "Arial";
text_txt.bold = true;
text_txt.size = 12;
text_txt.color = "0xFFFFFF";
tf.setNewTextFormat(text_txt);
tf.onChanged = function () {
var _l2 = new Color(this._parent.col);
_l2.setRGB(parseInt("0x" + this.text));
};
pick_mc.createEmptyMovieClip("cancel_bg", ++cpDepth);
pick_mc.cancel_bg.beginFill(4473924);
var x = 214;
pick_mc.cancel_bg.moveTo(x, 6);
pick_mc.cancel_bg.lineTo(x + 50, 6);
pick_mc.cancel_bg.lineTo(x + 50, 24);
pick_mc.cancel_bg.lineTo(x, 24);
pick_mc.cancel_bg.lineTo(x, 6);
pick_mc.createTextField("cancel", ++cpDepth, x, 6, 50, 18);
pick_mc.cancel.text = "cancel";
pick_mc.cancel.selectable = false;
var cancel_format = new TextFormat();
cancel_format.font = "Arial";
cancel_format.bold = false;
cancel_format.size = 12;
cancel_format.color = "0xFFFFFF";
cancel_format.align = "center";
pick_mc.cancel.setTextFormat(cancel_format);
pick_mc.cancel_bg.onRelease = function () {
pick_mc._visible = false;
_root.editor_autoKeyListener();
};
pick_mc.createEmptyMovieClip("ok_bg", ++cpDepth);
pick_mc.ok_bg.beginFill(4473924);
var x = 153;
pick_mc.ok_bg.moveTo(x, 6);
pick_mc.ok_bg.lineTo(x + 50, 6);
pick_mc.ok_bg.lineTo(x + 50, 24);
pick_mc.ok_bg.lineTo(x, 24);
pick_mc.ok_bg.lineTo(x, 6);
pick_mc.createTextField("ok", ++cpDepth, x, 6, 50, 18);
pick_mc.ok.text = "ok";
pick_mc.ok.selectable = false;
pick_mc.ok.setTextFormat(cancel_format);
pick_mc.ok_bg.onRelease = function () {
var colour = new Color(color_main.color_mc);
colour.setRGB(parseInt("0x" + this._parent.cValue.text));
pick_mc._visible = false;
_root.editor_setColour(this._parent.cValue.text);
};
pick_mc.onEnterFrame = function () {
if (Key.isDown(13)) {
if (pick_mc._visible) {
this.ok_bg.onRelease();
}
}
};
var _l7 = pick_mc.createEmptyMovieClip("bg", ++cpDepth);
_l7.beginFill(0);
_l7.moveTo(5, 28);
_l7.lineTo(BG_WIDTH - 4, 28);
_l7.lineTo(BG_WIDTH - 4, 197);
_l7.lineTo(5, 197);
_l7.lineTo(5, 28);
var col = pick_mc.createEmptyMovieClip("col", ++cpDepth);
col.beginFill(0);
col.moveTo(7, 7);
col.lineTo(69, 7);
col.lineTo(69, 22);
col.lineTo(7, 22);
col.lineTo(7, 7);
var x = ((xOffset = 20));
var y = 29;
i = 0;
while (i < list.length) {
var ob = pick_mc.createEmptyMovieClip("col" + i, ++cpDepth);
ob.beginFill(parseInt("0x" + list[i]));
ob.id = list[i];
ob.moveTo(x, y);
ob.lineTo(x + 13, y);
ob.lineTo(x + 13, y + 13);
ob.lineTo(x, y + 13);
ob.lineTo(x, y);
ob.hl_mc = pick_mc.createEmptyMovieClip("highL" + i, ++cpDepth);
ob.hl_mc.beginFill(0, 0);
ob.hl_mc.lineStyle(2, 16777215);
ob.hl_mc.moveTo(x, y);
ob.hl_mc.lineTo(x + 13, y);
ob.hl_mc.lineTo(x + 13, y + 13);
ob.hl_mc.lineTo(x, y + 13);
ob.hl_mc.lineTo(x, y);
ob.hl_mc._visible = false;
x = x + 14;
if (x >= (252 + xOffset)) {
y = y + 14;
x = x - 252;
}
ob.onRollOut = function () {
this.hl_mc._visible = false;
};
ob.onRollOver = function () {
this.hl_mc._visible = true;
tf.text = this.id;
var ob = new Color(col);
ob.setRGB(parseInt("0x" + this.id));
pick_mc.cValue.text = this.id;
};
ob.onRelease = function () {
var ob = new Color(color_main.color_mc);
ob.setRGB(parseInt("0x" + this.id));
pick_mc._visible = false;
_root.editor_setColour(this.id);
};
ob.useHandCursor = false;
i++;
}
var x = 6;
var y = 29;
var i = 0;
while (i < greylist.length) {
var ob = pick_mc.createEmptyMovieClip("col" + i, ++cpDepth);
ob.beginFill(parseInt("0x" + greylist[i]));
ob.id = greylist[i];
ob.moveTo(x, y);
ob.lineTo(x + 13, y);
ob.lineTo(x + 13, y + 13);
ob.lineTo(x, y + 13);
ob.lineTo(x, y);
ob.hl_mc = pick_mc.createEmptyMovieClip("highL" + i, ++cpDepth);
ob.hl_mc.beginFill(0, 0);
ob.hl_mc.lineStyle(2, 16777215);
ob.hl_mc.moveTo(x, y);
ob.hl_mc.lineTo(x + 13, y);
ob.hl_mc.lineTo(x + 13, y + 13);
ob.hl_mc.lineTo(x, y + 13);
ob.hl_mc.lineTo(x, y);
ob.hl_mc._visible = false;
y = y + 14;
ob.onRollOut = function () {
this.hl_mc._visible = false;
};
ob.onRollOver = function () {
this.hl_mc._visible = true;
tf.text = this.id;
var ob = new Color(col);
ob.setRGB(parseInt("0x" + this.id));
pick_mc.cValue.text = this.id;
};
ob.onRelease = function () {
var ob = new Color(color_main.color_mc);
ob.setRGB(parseInt("0x" + this.id));
pick_mc._visible = false;
_root.editor_setColour(this.id);
};
ob.useHandCursor = false;
i++;
}
}
var BG_WIDTH = 276;
var cpDepth = 1;
createEmptyMovieClip("pick_mc", cpDepth);
pick_mc._x = 0;
pick_mc._y = -200;
color_main.onRelease = function () {
pick_mc._visible = true;
_root.editor_autoKeyListener();
};
var greylist = [];
greylist.push("000000");
greylist.push("333333");
greylist.push("666666");
greylist.push("999999");
greylist.push("CCCCCC");
greylist.push("FFFFFF");
greylist.push("FF0000");
greylist.push("00FF00");
greylist.push("0000FF");
greylist.push("FFFF00");
greylist.push("00FFFF");
greylist.push("FF00FF");
var list = [];
var color_list = ["00", "33", "66", "99", "CC", "FF"];
colour(0);
colour(3);
swatchCreator();
pick_mc.cValue.text = "0x0066FF";
pick_mc._visible = false;
color_main.useHandCursor = false;
Symbol 482 MovieClip [editor.properties] Frame 1
dummy.useHandCursor = false;
this.onEnterFrame = function () {
var deltaTargetSelection = (_root.ed_prevSelection[7] != _root.library.selected[0]);
var selectedOb = _root.library.selected[0];
xTxt = selectedOb._x;
yTxt = selectedOb._y;
rotationTxt = selectedOb._rotation;
xscaleTxt = selectedOb._xscale;
yscaleTxt = selectedOb._yscale;
if ((_root.enemies["e" + parentTxt] != undefined) or deltaTargetSelection) {
parentTxt = (selectedOb.parent + "").substr(17);
}
};
txtOb = new Object();
xField.addListener(txtOb);
yField.addListener(txtOb);
rotationField.addListener(txtOb);
xscaleField.addListener(txtOb);
yscaleField.addListener(txtOb);
parentField.addListener(txtOb);
txtOb.onChanged = function () {
var selectedOb = _root.library.selected[0];
selectedOb._x = xTxt;
selectedOb._y = yTxt;
selectedOb._rotation = rotationTxt;
selectedOb._xscale = xscaleTxt;
selectedOb._yscale = yscaleTxt;
var tempOb = _root.enemies["e" + parentTxt];
if (tempOb != undefined) {
selectedOb.parent = _root.enemies["e" + parentTxt];
selectedOb.permaParent = true;
}
};
Symbol 501 MovieClip [editor.register] Frame 1
dummy.useHandCursor = false;
pwTxt.password = true;
stop();
usernameInput_text.tabIndex = 107;
pwTxt.tabIndex = 108;
emailInput_text.tabIndex = 109;
ok.tabIndex = 110;
close.tabIndex = 111;
Symbol 501 MovieClip [editor.register] Frame 4
pwTxt.password = true;
Symbol 516 MovieClip [editor.saveAs] Frame 1
function radioTypeHandler(component) {
typeData = component.getData();
}
function visibilityGroupHandler(component) {
hidden = component.getData();
}
dummy.useHandCursor = false;
stop();
nameInput_text.tabIndex = 100;
radio_action.tabIndex = 101;
linkInput_text.tabIndex = 102;
radio_false.tabIndex = 103;
saveBtn.tabIndex = 104;
close.tabIndex = 105;
var typeData;
var hidden;
_root.editor_toggleSaveAsWin();
_root.editor_toggleSaveAsWin();
Instance of Symbol 272 MovieClip [FRadioButtonSymbol] "radio_action" in Symbol 516 MovieClip [editor.saveAs] Frame 1
//component parameters
onClipEvent (initialize) {
label = "Action";
initialState = false;
groupName = "radioGroup";
data = "action";
labelPlacement = "right";
changeHandler = "radioTypeHandler";
}
Instance of Symbol 272 MovieClip [FRadioButtonSymbol] "radio_puzzle" in Symbol 516 MovieClip [editor.saveAs] Frame 1
//component parameters
onClipEvent (initialize) {
label = "Puzzle";
initialState = false;
groupName = "radioGroup";
data = "puzzle";
labelPlacement = "right";
changeHandler = "radioTypeHandler";
}
Instance of Symbol 272 MovieClip [FRadioButtonSymbol] "radio_art" in Symbol 516 MovieClip [editor.saveAs] Frame 1
//component parameters
onClipEvent (initialize) {
label = "Art";
initialState = false;
groupName = "radioGroup";
data = "art";
labelPlacement = "right";
changeHandler = "radioTypeHandler";
}
Instance of Symbol 272 MovieClip [FRadioButtonSymbol] "radio_series" in Symbol 516 MovieClip [editor.saveAs] Frame 1
//component parameters
onClipEvent (initialize) {
label = "Series";
initialState = false;
groupName = "radioGroup";
data = "series";
labelPlacement = "right";
changeHandler = "radioTypeHandler";
}
Instance of Symbol 272 MovieClip [FRadioButtonSymbol] "radio_tutorial" in Symbol 516 MovieClip [editor.saveAs] Frame 1
//component parameters
onClipEvent (initialize) {
label = "Tutorial";
initialState = false;
groupName = "radioGroup";
data = "tutorial";
labelPlacement = "right";
changeHandler = "radioTypeHandler";
}
Instance of Symbol 272 MovieClip [FRadioButtonSymbol] "radio_" in Symbol 516 MovieClip [editor.saveAs] Frame 1
//component parameters
onClipEvent (initialize) {
label = "[none]";
initialState = false;
groupName = "radioGroup";
data = "";
labelPlacement = "right";
changeHandler = "radioTypeHandler";
}
Instance of Symbol 272 MovieClip [FRadioButtonSymbol] "visibilityGroup_0" in Symbol 516 MovieClip [editor.saveAs] Frame 1
//component parameters
onClipEvent (initialize) {
label = "Public";
initialState = false;
groupName = "visibilityGroup";
data = 0;
labelPlacement = "right";
changeHandler = "visibilityGroupHandler";
}
Instance of Symbol 272 MovieClip [FRadioButtonSymbol] "visibilityGroup_1" in Symbol 516 MovieClip [editor.saveAs] Frame 1
//component parameters
onClipEvent (initialize) {
label = "Hidden";
initialState = false;
groupName = "visibilityGroup";
data = 1;
labelPlacement = "right";
changeHandler = "visibilityGroupHandler";
}
Symbol 524 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 1
stop();
Symbol 568 MovieClip [editor.tutorial] Frame 1
this.onMouseDown = function () {
this.removeMovieClip();
};
Symbol 649 MovieClip [keySettings] Frame 1
function aimingHandler() {
_root.key_aim = aimingBox.getValue();
}
function movingHandler() {
_root.key_move = movingBox.getValue();
}
function bind(value) {
waiting._visible = true;
waiting.actionTxt = value;
waiting.defaultTxt = this["default_" + value];
varToBind = "key_" + value;
txtToChange = this[value + "Field"];
}
function bindAll() {
isBindAll = true;
bindAll_current = 0;
bind(bindList[bindAll_current]);
}
dummy.useHandCursor = false;
var n = 0;
while (n < aimingBox.getLength()) {
if (aimingBox.getItemAt(n).data == _root.key_aim) {
aimingBox.setSelectedIndex(n);
break;
}
n++;
}
var m = 0;
while (m < movingBox.getLength()) {
if (movingBox.getItemAt(m).data == _root.key_move) {
movingBox.setSelectedIndex(m);
break;
}
m++;
}
var isBindAll = false;
var bindAll_current = 0;
_root.keyListener.onKeyDown = function () {
if (waiting._visible) {
waiting._visible = false;
_root[varToBind] = Key.getCode();
txtToChange.text = _root.codeName[Key.getCode()];
if (isBindAll) {
bindAll_current++;
if (bindAll_current == bindList.length) {
isBindAll = false;
} else {
bind(bindList[bindAll_current]);
}
}
}
};
var varToBind;
var txtToChange;
waiting._visible = false;
var default_up = "Up arrow";
var default_down = "Down arrow";
var default_left = "Left arrow";
var default_right = "Right arrow";
var default_shoot = "Z";
var default_aimUp = "E";
var default_aimDown = "D";
var default_aimLeft = "S";
var default_aimRight = "F";
var default_pause = "P";
var default_ed_up = "E";
var default_ed_down = "D";
var default_ed_left = "S";
var default_ed_right = "F";
var default_ed_rotateLeft1 = "W";
var default_ed_rotateRight1 = "R";
var default_ed_rotateLeft45 = "Q";
var default_ed_rotateRight45 = "T";
var default_ed_lock = "V";
var default_ed_nextParent = "G";
var default_ed_prevParent = "A";
var default_ed_delete = "Spacebar";
var default_ed_xscale = "Z";
var default_ed_yscale = "X";
var default_ed_xyscale = "C";
var default_ed_duplicate = "CTRL d will always duplicate as well as whichever key you put here";
var default_ed_selAll = "CTRL a will always select all parts as well as whichever key you put here";
var default_ed_selCore = "CTRL h will always select core as well as whichever key you put here";
var bindList = ["up", "down", "left", "right", "shoot", "aimUp", "aimDown", "aimLeft", "aimRight", "pause", "ed_up", "ed_down", "ed_left", "ed_right", "ed_rotateLeft1", "ed_rotateRight1", "ed_rotateLeft45", "ed_rotateRight45", "ed_lock", "ed_nextParent", "ed_prevParent", "ed_delete", "ed_xscale", "ed_yscale", "ed_xyscale", "ed_duplicate", "ed_selAll", "ed_selCore"];
var i = 0;
while (i < bindList.length) {
var value = bindList[i];
var code = _root["key_" + value];
this[value + "Field"].text = _root.codeName[code];
i++;
}
Instance of Symbol 269 MovieClip [FComboBoxSymbol] "aimingBox" in Symbol 649 MovieClip [keySettings] Frame 1
//component parameters
onClipEvent (initialize) {
editable = false;
labels = [];
labels[0] = "Auto aim";
labels[1] = "Expert aim";
labels[2] = "Keyboard aim";
labels[3] = "Mouse aim";
data = [];
data[0] = "Auto";
data[1] = "Expert";
data[2] = "ManKeyboard";
data[3] = "ManMouse";
rowCount = 8;
changeHandler = "aimingHandler";
}
Instance of Symbol 269 MovieClip [FComboBoxSymbol] "movingBox" in Symbol 649 MovieClip [keySettings] Frame 1
//component parameters
onClipEvent (initialize) {
editable = false;
labels = [];
labels[0] = "Mouse";
labels[1] = "Keyboard";
data = [];
data[0] = "Mouse";
data[1] = "Keyboard";
rowCount = 8;
changeHandler = "movingHandler";
}
Symbol 652 MovieClip [message] Frame 1
dummy.useHandCursor = false;
Symbol 669 MovieClip [ratingWindow] Frame 1
if (_root.currentLvlObject.ID == undefined) {
this._x = 9999;
}
var left = mask._x;
var right = (mask._x + mask._width);
var top = mask._y;
var bottom = (mask._y + mask._height);
var width = mask._width;
var percentage = 5;
mask._width = _root.currentLvlObject.rating * 2;
var rate = (((_root.currentLvlObject.rating == undefined) or (_root.currentLvlObject.rating == 0)) ? "0" : (_root.currentLvlObject.rating));
output = ("Click to rate this level!\nCurrent rating is " + int(_root.currentLvlObject.rating)) + "/100";
this.onEnterFrame = function () {
if (!submitted) {
if ((_xmouse >= left) and (_xmouse <= right)) {
if ((_ymouse >= top) and (_ymouse <= bottom)) {
mask._width = Math.round((_xmouse - left) / ((percentage / 100) * width)) * ((percentage / 100) * width);
}
}
}
};
var submitted = false;
starBtn.onRelease = function () {
if (!submitted) {
submitted = true;
this._parent.onEnterFrame = null;
var rating = (Math.round((_xmouse - left) / ((percentage / 100) * width)) * percentage);
if (rating < 0) {
rating = 0;
}
if (rating > 100) {
rating = 100;
}
var varsIn = new LoadVars();
var varsOut = new LoadVars();
varsOut.rating = rating;
varsOut.ID = _root.currentLvlObject.ID;
varsOut.sendAndLoad("http://zetaflow.skylogic.ca/game/saveRating.php", varsIn, "POST");
varsIn.onLoad = function (success) {
if (success) {
mask._width = (this.rating * width) / 100;
output = ("Rating submitted. Now displaying current average of " + int(this.rating)) + "/100";
if (this.error != null) {
output = this.error;
}
}
};
}
};
Instance of Symbol 173 MovieClip [FScrollBarSymbol] "scrollBar" in Symbol 676 MovieClip [editor.textEdit] Frame 1
//component parameters
onClipEvent (initialize) {
_targetInstanceName = "inputTxtField";
horizontal = false;
}
Symbol 701 MovieClip [pauseMenu] Frame 1
stop();
Symbol 703 MovieClip Frame 1
for (var i in this) {
if (typeof(this[i]) == "movieclip") {
this[i].gotoAndPlay(random(23) + 1);
}
}
Symbol 708 MovieClip [gameover] Frame 148
this.removeMovieClip();
Symbol 713 MovieClip [levelMsg] Frame 1
Symbol 713 MovieClip [levelMsg] Frame 31
stop();
Symbol 737 MovieClip [tutorial] Frame 1
this.onEnterFrame = function () {
if (Key.isDown(81)) {
this.removeMovieClip();
}
};
Symbol 737 MovieClip [tutorial] Frame 547
this.removeMovieClip();
Symbol 751 Button
on (release) {
getURL ("http://zetaflow.skylogic.ca/ZetaFlow.php?editor=true", "_self");
}
Symbol 759 Button
on (release) {
getURL ("http://zetaflow.skylogic.ca/?gallery=true", "_self");
}
Symbol 762 MovieClip [victory] Frame 162
stop();
Symbol 779 MovieClip [b.laser] Frame 38
_root.laserSnd_start.start(0, 0);
Symbol 779 MovieClip [b.laser] Frame 61
gotoAndPlay (44);
Symbol 793 MovieClip [b.laser_] Frame 38
_root.laserSnd_start.start(0, 0);
Symbol 793 MovieClip [b.laser_] Frame 61
gotoAndPlay (44);
Symbol 807 MovieClip [b.singularity] Frame 40
this.removeMovieClip();
Symbol 809 MovieClip [e.laser] Frame 1
link = "laser";
niceName = "Laser - This version of the laser does not work properly, you may want to replace it with a new one";
stop();
Symbol 812 MovieClip [bulletExp] Frame 1
_root.bulletExpSnd.start(0, 0);
Symbol 812 MovieClip [bulletExp] Frame 8
this.removeMovieClip();
Symbol 824 MovieClip [coreExplosion] Frame 36
this.removeMovieClip();
Symbol 829 MovieClip [exp] Frame 1
_root.expSnd.start(0, 0);
Symbol 829 MovieClip [exp] Frame 8
this.removeMovieClip();
Symbol 835 MovieClip [expShockwave] Frame 32
this.removeMovieClip();
Symbol 838 MovieClip [invincibleBulletExp] Frame 1
_root.invincibleBulletExpSnd.start(0, 0);
Symbol 838 MovieClip [invincibleBulletExp] Frame 12
this.removeMovieClip();
Symbol 846 MovieClip Frame 15
stop();
Symbol 849 MovieClip Frame 15
stop();
Symbol 850 MovieClip [aimer] Frame 1
stop();
_root.tinyShot2Snd.stop();
Symbol 850 MovieClip [aimer] Frame 2
stop();
_root.tinyShot2Snd.stop();
_root.tinyShot2Snd.start(0, 9999999);
Symbol 854 MovieClip [b.z] Frame 1
stop();
Symbol 865 MovieClip [ship] Frame 1
stop();
Symbol 865 MovieClip [ship] Frame 2
this.invincible = true;
this.speed = 3;
play();
this.onEnterFrame = function () {
if (Key.isDown(_root.key_shoot) or _root.mouseDown) {
gotoAndPlay (74);
}
};
Symbol 865 MovieClip [ship] Frame 28
if (endGame) {
gotoAndStop (3);
}
Symbol 865 MovieClip [ship] Frame 74
this.invincible = false;
this.speed = _root.SHIP_SPEED;
this.onEnterFrame = null;
Symbol 873 MovieClip [Ship.deathAnim] Frame 1
var speed = _root.SHIP_SPEED;
if (_root.key_move == "mouse") {
var left = (_root._xmouse < (this._x - speed));
var right = (_root._xmouse > (this._x + speed));
var up = (_root._ymouse < (this._y - speed));
var down = (_root._ymouse > (this._y + speed));
} else {
var left = Key.isDown(_root.key_left);
var right = Key.isDown(_root.key_right);
var up = Key.isDown(_root.key_up);
var down = Key.isDown(_root.key_down);
}
this.onEnterFrame = function () {
speed = speed - 0.13;
if (left) {
this._x = this._x - speed;
} else if (right) {
this._x = this._x + speed;
}
if (up) {
this._y = this._y - speed;
} else if (down) {
this._y = this._y + speed;
}
};
Symbol 873 MovieClip [Ship.deathAnim] Frame 93
this.onEnterFrame = null;
_root.onLevelComplete(false);
this.removeMovieClip();
Symbol 878 MovieClip [shipRespawnCountdown] Frame 90
_root.attachShip();
this.removeMovieClip();
Symbol 896 MovieClip Frame 100
stop();
_root.play();
Symbol 896 MovieClip Frame 101
gotoAndStop (1);
Instance of Symbol 265 MovieClip [FCheckBoxSymbol] in Symbol 896 MovieClip Frame 102
//component parameters
onClipEvent (initialize) {
label = "Check Box";
initialValue = false;
labelPlacement = "right";
changeHandler = "";
}
Instance of Symbol 269 MovieClip [FComboBoxSymbol] in Symbol 896 MovieClip Frame 102
//component parameters
onClipEvent (initialize) {
editable = false;
rowCount = 8;
changeHandler = "";
}
Instance of Symbol 184 MovieClip [FListBoxSymbol] in Symbol 896 MovieClip Frame 102
//component parameters
onClipEvent (initialize) {
selectMultiple = false;
changeHandler = "";
}
Instance of Symbol 272 MovieClip [FRadioButtonSymbol] in Symbol 896 MovieClip Frame 102
//component parameters
onClipEvent (initialize) {
label = "Radio Button";
initialState = false;
groupName = "radioGroup";
data = "";
labelPlacement = "right";
changeHandler = "";
}
Instance of Symbol 276 MovieClip [FScrollPaneSymbol] in Symbol 896 MovieClip Frame 102
//component parameters
onClipEvent (initialize) {
scrollContent = "";
hScroll = "auto";
vScroll = "auto";
dragContent = false;
}
Symbol 899 Button
on (release) {
getURL ("http://zetaflow.skylogic.ca/", "_top");
}