Frame 1
MochiAd.showPreGameAd({id:"8911cf8f042e4304", res:"650x400"});
mochi.MochiServices.connect("8911cf8f042e4304");
Instance of Symbol 24 MovieClip in Frame 1
onClipEvent (enterFrame) {
perc = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
this._xscale = perc;
}
Frame 2
function dist_ab(ax, ay, bx, by) {
dx = ax - bx;
dy = ay - by;
dist = Math.sqrt((dx * dx) + (dy * dy));
return(dist);
}
function help(itext) {
_root.imenu.mb.box.help.text = itext;
_root.imenu.mb.play();
}
function callMinions(hp) {
monsters_placed = 0;
if (level == 1) {
hp = 1;
igold = 2;
num_monsters = 5;
linkage = "min0";
spec = "ground";
speed = 2;
boxtext = ((((("Level " + level) + ": Armoured Tank [") + hp) + "hp, ") + igold) + " gold]";
} else if (level == 2) {
hp = 2;
igold = 4;
num_monsters = 7;
linkage = "min3";
spec = "ground";
speed = 2.5;
boxtext = ((((("Level " + level) + ": Light Tank [") + hp) + "hp, ") + igold) + " gold]";
} else if (level == 3) {
hp = 3;
igold = 6;
num_monsters = 9;
linkage = "min0";
spec = "ground";
speed = 2;
boxtext = ((((("Level " + level) + ": Armoured Tank [") + hp) + "hp, ") + igold) + " gold]";
} else {
if (_root.diff == 0) {
num_monsters = 10;
} else if (_root.diff == 1) {
num_monsters = 15;
} else if (_root.diff == 2) {
num_monsters = 30;
}
modal = random(4);
igold = level * 2;
if (igold > 20) {
igold = 20;
}
if (modal == 0) {
linkage = "min0";
spec = "ground";
speed = 2.5;
boxtext = ((((("Level " + level) + ": Armoured Tank [") + hp) + "hp, ") + igold) + " gold]";
} else if (modal == 1) {
linkage = "min4";
spec = "air";
speed = 3.5;
boxtext = ((((("Level " + level) + ": Fighter planes [") + hp) + "hp, ") + igold) + " gold, FLYING]";
} else if (modal == 2) {
linkage = "min3";
spec = "ground";
speed = 3;
boxtext = ((((("Level " + level) + ": Light tanks [") + hp) + "hp, ") + igold) + " gold]";
} else if (modal == 3) {
linkage = "min5";
spec = "air";
speed = 3.5;
boxtext = ((((("Level " + level) + ": RAF planes [") + hp) + "hp, ") + igold) + " gold, FLYING]";
}
}
help(boxtext);
life = hp;
minionWave++;
minionMC = "minion" + minionWave;
levelsend = 1;
}
function increment() {
min_id = min_id - _root.gamespeed;
secs = Math.round(min_id / 12);
secs_perc = Math.round((min_id / 1200) * 360);
if (min_id <= 0) {
level++;
min_id = 1200;
thp = (Math.pow(level, 2) + (level * _root.diff)) * (Math.floor(level / 10) + 1);
callMinions(thp);
}
}
monstify = function (yoff) {
_root.monsters_placed++;
_root.new_monster = 0;
min = attachMovie(linkage, "minion" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:40, _y:yoff});
min.spec = _root.spec;
_root.mins.push(min);
min.point_to_reach = 0;
if ((level * 2) < 20) {
min.kgold = level * 2;
} else {
min.kgold = 20;
}
min.hp = 100;
min.life = life;
min.hit = 0;
min.dead = false;
min.speed = _root.speed;
min.origspeed = _root.speed;
hpb = _root.attachMovie("hp", "hp" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:min._x, _y:min._y + (min._height / 2)});
hpb.par = min;
min.bar = hpb;
hpb.onEnterFrame = function () {
this._x = this.par._x;
this._y = this.par._y + (this.par._height / 2);
this.bar._xscale = this.par.hp;
if (this.par.hp <= 0) {
_root.mins = _root.mins.remove(this.par);
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = this.par.kgold;
val._x = this.par._x;
val._y = this.par._y;
_root.gold = _root.gold + this.par.kgold;
this.par.play();
this.par.dead = true;
_root.explode();
_root.kills++;
this.removeMovieClip();
}
if (this.par.hp == 100) {
this._visible = false;
} else {
this._visible = true;
}
};
min.onEnterFrame = function () {
if (this.speed < this.origspeed) {
this.speed = this.speed + 0.01;
} else {
this.hit = 0;
}
if (this.hitTest("_root.path.cy")) {
_root.lives = _root.lives - 1;
_root.imenu.mc_lives.gotoAndPlay(_root.lives);
_root.gold = _root.gold - _root.level;
if (_root.gold < 0) {
_root.gold = 0;
}
if (_root.lives <= 0) {
_root.reset();
_root.gotoAndPlay("lose");
}
_root.mins = _root.mins.remove(this);
this.bar.removeMovieClip();
this.removeMovieClip();
}
dist_x = waypoint_x[this.point_to_reach] - this._x;
dist_y = waypoint_y[this.point_to_reach] - this._y;
if ((Math.abs(dist_x) + Math.abs(dist_y)) < (this.speed * _root.gamespeed)) {
this.point_to_reach++;
}
angle = Math.atan2(dist_y, dist_x);
this.tspeed = this.speed * _root.gamespeed;
if ((_root.pauser._currentframe == 1) && (!this.dead)) {
this._x = this._x + (this.tspeed * Math.cos(angle));
this._y = this._y + (this.tspeed * Math.sin(angle));
}
this._rotation = ((angle / Math.PI) * 180) - 90;
if (this.spec == "air") {
i = _root.tows.length;
while (i > -1) {
tow = _root[_root.tows[i]._name];
if (this.getDepth() < tow.getDepth()) {
this.swapDepths(tow);
}
i--;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.getDepth() < obj.getDepth()) {
this.swapDepths(obj);
}
i--;
}
}
};
return(min._height);
};
Array.prototype.remove = function (obj) {
var _local3 = [];
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] != obj) {
_local3.push(this[_local2]);
}
_local2++;
}
return(_local3);
};
stopAllSounds();
xp = new Sound(this);
xp.attachSound("expl");
explode = function () {
xp.start(0, 1);
};
bp = new Sound(this);
bp.attachSound("beep");
beep = function () {
bp.start(0, 1);
};
reset = function () {
i = _root.tows.length;
while (i > -1) {
tow = _root[_root.tows[i]._name];
tow.removeMovieClip();
i--;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
obj.removeMovieClip();
i--;
}
_root.imenu.removeMovieClip();
_root.pauser.removeMovieClip();
delete onEnterFrame;
};
stop();
Instance of Symbol 205 MovieClip in Frame 2
onClipEvent (load) {
stopAllSounds();
this.swapDepths(200);
this.removeMovieClip();
}
Frame 3
stop();
Instance of Symbol 265 MovieClip in Frame 3
onClipEvent (load) {
counter = 0;
}
onClipEvent (enterFrame) {
counter++;
if (counter >= 120) {
play();
counter = 0;
}
}
Frame 4
stop();
levelsend = 0;
imenu.mc_lives.gotoAndPlay(10);
allsound = new Sound();
bgmusic = new Sound(this);
bgmusic.attachSound("loop");
bgmusic.start(0, 999);
imenu.qbutton.onRelease = function () {
if (_root._quality == "HIGH") {
_root._quality = "LOW";
} else if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
} else if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
} else {
_root._quality = "LOW";
}
};
imenu.mbutton.onRelease = function () {
if (_root.allsound.getVolume() == 100) {
_root.allsound.setVolume(0);
} else {
_root.allsound.setVolume(100);
}
this.play();
};
var lives = 10;
var speed = 1.25;
if (diff == 0) {
var gold = 4000;
} else if (diff == 1) {
var gold = 1000;
} else if (diff == 2) {
var gold = 500;
}
var kills = 0;
var gamespeed = 1;
var level = 0;
var minionWave = 0;
var min_id = 0;
var mins = new Array();
var tows = new Array();
var minionMC = ("minion" + minionWave);
var linkage = "minion";
var sel = "";
attachMovie("path", "path", _root.getNextHighestDepth());
path.onEnterFrame = function () {
this.gotoAndPlay(Math.ceil(Math.random() * 3));
delete this.onEnterFrame;
};
imenu.swapDepths(path);
delay = 25;
new_monster = 0;
monsters_placed = 0;
onEnterFrame = function () {
if (_root.gold > 10000) {
_root.gold = 10000;
}
if (_root.sel != "") {
_root.sel.swapDepths(_root.getNextHighestDepth());
}
if (_root.pauser._currentframe == 1) {
increment();
if (levelsend == 1) {
thite = monstify(-30);
i = 1;
while (i < num_monsters) {
tyoff = -30 - ((thite + 5) * i);
monstify(tyoff);
i++;
}
levelsend = 0;
}
}
};
Instance of Symbol 279 MovieClip "pauser" in Frame 4
onClipEvent (load) {
this.gotoAndPlay(2);
}
onClipEvent (enterFrame) {
if (_root.pauser._currentframe != 1) {
this.swapDepths(_root.getNextHighestDepth());
}
}
Instance of Symbol 321 MovieClip "imenu" in Frame 4
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
}
Frame 5
_root.attachMovie("cover", "cover", _root.getNextHighestDepth());
stop();
Frame 6
stop();
Symbol 10 MovieClip [path] Frame 1
stop();
Symbol 10 MovieClip [path] Frame 2
_root.waypoint_x = new Array(40, 140, 140, 220, 220, 80, 80, 340, 340, 445, 445, 610, 610);
_root.waypoint_y = new Array(140, 140, 60, 60, 240, 240, 300, 300, 100, 100, 300, 300, -20);
stop();
Symbol 10 MovieClip [path] Frame 3
_root.waypoint_x = new Array(40, 180, 180, 40, 40, 250, 250, 330, 330, 500, 500, 600, 600);
_root.waypoint_y = new Array(140, 140, 220, 220, 300, 300, 100, 100, 300, 300, 160, 160, -20);
stop();
Symbol 16 MovieClip [min0] Frame 1
stop();
Symbol 16 MovieClip [min0] Frame 2
this.removeMovieClip();
Symbol 324 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _sendChannel, _loader, _loaderListener, _rcvChannel, _listenChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function getVersion() {
return("1.1");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_container == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
if (_sendChannel._queue != undefined) {
}
if (_container != undefined) {
_container.removeMovieClip();
delete _container;
}
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip.createEmptyMovieClip("__mochiservicesMC", clip.getNextHighestDepth());
} else {
_container = _root.createEmptyMovieClip("__mochiservicesMC", _root.getNextHighestDepth());
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
if (!isNetworkAvailable) {
return(undefined);
}
allowDomains(_gatewayURL);
_loader = new MovieClipLoader();
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else if (_container == undefined) {
onError.apply(null, ["NotConnected"]);
} else {
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 325 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 326 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if (options.clip.__mochiservicesMC != mochi.MochiServices.__get__clip()) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
if (mochi.MochiServices.__get__clip() == _root.__mochiservicesMC) {
mochi.MochiServices.__get__clip()._parent.play();
} else {
mochi.MochiServices.__get__clip().play();
}
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function doClose(args) {
if (args.error == true) {
onError.apply(null, [args.errorCode, args.httpStatus]);
} else {
onClose.apply();
}
}
}
Symbol 33 MovieClip [min3] Frame 1
stop();
Symbol 33 MovieClip [min3] Frame 10
this.removeMovieClip();
Symbol 39 MovieClip Frame 1
stop();
Symbol 39 MovieClip Frame 2
stop();
Symbol 63 Button
on (press) {
startDrag (this);
}
on (release) {
stopDrag();
}
Symbol 65 Button
on (release) {
ivalue = 0;
i = 0;
while (i < _parent.tower.innerLevel) {
ivalue = ivalue + ((_parent.tower.cost / 2) * (i + 1));
i++;
}
ivalue = ivalue * 0.8;
ivalue = Math.round(ivalue);
_root.gold = _root.gold + ivalue;
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = ivalue;
val._x = _parent._x;
val._y = _parent._y;
_root.tows = _root.tows.remove(_parent);
_parent.removeMovieClip();
}
Symbol 71 Button
on (release) {
_root.sel = "";
_parent.tower.placing = true;
startDrag (_parent, true);
_parent.onEnterFrame = function () {
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 1) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (obj != _parent._parent) {
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
mi++;
}
if ((mi >= _root.tows.length) && (di >= ni)) {
this._alpha = 100;
}
}
i++;
}
}
};
_parent.onRelease = function () {
if (_parent._alpha == 100) {
_parent.tower.placing = false;
stopDrag();
delete this.onEnterFrame;
delete this.onRelease;
}
};
}
Symbol 72 MovieClip Frame 1
refreshV = function () {
bar._xscale = _parent.tower.range;
pbar._xscale = _parent.tower.getStats(_parent.tower.innerLevel + 1, "range");
range_txt.text = _parent.tower.getStats(_parent.tower.innerLevel, "range");
bad._xscale = _parent.tower.damage;
pbad._xscale = _parent.tower.getStats(_parent.tower.innerLevel + 1, "damage");
damage_txt.text = _parent.tower.getStats(_parent.tower.innerLevel, "damage");
bas._xscale = _parent.tower.getStats(_parent.tower.innerLevel, "speed");
pbas._xscale = _parent.tower.getStats(_parent.tower.innerLevel + 1, "speed");
speed_txt.text = _parent.tower.getStats(_parent.tower.innerLevel, "speed");
};
onLoad = refreshV();
stop();
Instance of Symbol 49 MovieClip in Symbol 72 MovieClip Frame 1
onClipEvent (load) {
onEnterFrame = function () {
upgradeCost = Math.round((_parent._parent.tower.cost / 2) * _parent._parent.tower.innerLevel);
if (_parent._parent.tower.innerLevel == 5) {
_parent.amount.text = "Fully upgraded";
if (this._currentframe != 2) {
this.gotoAndPlay(2);
}
} else {
_parent.amount.text = upgradeCost + " gold";
if (_root.gold >= upgradeCost) {
if (this._currentframe != 1) {
this.gotoAndPlay(1);
}
} else if (this._currentframe != 2) {
this.gotoAndPlay(2);
}
}
};
onRelease = function () {
if (this._currentframe != 2) {
if (_root.gold >= upgradeCost) {
_root.gold = _root.gold - upgradeCost;
_parent._parent.tower.upgrade();
_parent.refreshV();
if (_parent._parent.tower.innerLevel == 5) {
_parent._parent.tower.play();
}
}
}
};
}
Instance of Symbol 53 MovieClip in Symbol 72 MovieClip Frame 1
onClipEvent (enterFrame) {
this.onRelease = function () {
_root.sel = "none";
};
}
Symbol 73 Button
on (release) {
_root.sel = this;
}
Instance of Symbol 39 MovieClip "tower" in Symbol 74 MovieClip [sn1] Frame 1
onClipEvent (load) {
innerLevel = 1;
cost = 200;
range = 70;
mspeed = 1.5;
firing = 15;
damage = 10;
btype = "bul1";
no = true;
w = 10;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(70);
}
if (stat == "speed") {
return(7);
}
return(10);
case 2 :
if (stat == "range") {
return(70);
}
if (stat == "speed") {
return(8);
}
return(15);
case 3 :
if (stat == "range") {
return(80);
}
if (stat == "speed") {
return(9);
}
return(30);
case 4 :
if (stat == "range") {
return(100);
}
if (stat == "speed") {
return(11);
}
return(60);
case 5 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(14);
}
return(120);
case 6 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(7);
}
return(120);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 70;
this.damage = 10;
this.firing = 15;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 70;
this.damage = 15;
this.firing = 13;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 80;
this.damage = 30;
this.firing = 11;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 100;
this.damage = 60;
this.firing = 9;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 150;
this.damage = 120;
this.firing = 7;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (this.innerLevel == 5) {
i = _root.tows.length;
while (i > -1) {
tow = _root[_root.tows[i]._name];
if (((tow.tower.innerLevel == 5) && (tow.tower.fuse == 2)) && (!tow.tower.placing)) {
if (this.hitTest(tow.tower)) {
thun = _root.attachMovie("grind", "grind" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
thun._x = (_parent._x + tow._x) / 2;
thun._y = (_parent._y + tow._y) / 2;
_root.tows.push(thun);
_root.tows = _root.tows.remove(tow);
_root.tows = _root.tows.remove(this);
tow.removeMovieClip();
_parent.removeMovieClip();
}
}
i--;
}
}
if (_root.pauser._currentframe == 1) {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > this.range) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
if (this.no && (!this.placing)) {
this.w = this.w + _root.gamespeed;
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.dirx = Math.cos((this.angle * Math.PI) / 180) * (15 * _root.gamespeed);
bul.diry = Math.sin((this.angle * Math.PI) / 180) * (15 * _root.gamespeed);
bul.onEnterFrame = function () {
if (this.hitting) {
this._x = this._x - this.dirx;
this._y = this._y - this.diry;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this) && (this.hitting)) {
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
this._x = obj._x;
this._y = obj._y;
this.hitting = false;
this.removeMovieClip();
}
i--;
}
};
}
}
}
};
}
Instance of Symbol 72 MovieClip "inf" in Symbol 74 MovieClip [sn1] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 90 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 2
stop();
Instance of Symbol 90 MovieClip "tower" in Symbol 91 MovieClip [gr1] Frame 1
onClipEvent (load) {
pobj = "";
cost = 800;
innerLevel = 1;
range = 50;
mspeed = 1;
firing = 20;
damage = 20;
btype = "bul2";
no = true;
w = 0;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(20);
case 2 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(30);
case 3 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(40);
case 4 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(50);
case 5 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(60);
case 6 :
if (stat == "range") {
return(1);
}
if (stat == "speed") {
return(0);
}
return(1);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 50;
this.damage = 20;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 50;
this.damage = 30;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 50;
this.damage = 40;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 50;
this.damage = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 50;
this.damage = 60;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > this.range) {
} else if (obj != undefined) {
if (obj.spec == "ground") {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.pobj = obj;
this.no = true;
if (this.no && (!this.placing)) {
}
}
}
} else {
this.no = false;
}
i--;
}
this.innerT._rotation = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
w = w + _root.gamespeed;
if ((this.no && (!this.placing)) && (this.pobj != "")) {
if (this.innerT.razor.hitTest(this.pobj)) {
dps = (damage / 10) * _root.gamespeed;
this.pobj.hp = this.pobj.hp - ((dps / this.pobj.life) * 100);
}
}
};
}
Instance of Symbol 72 MovieClip "inf" in Symbol 91 MovieClip [gr1] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 94 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 2
stop();
Instance of Symbol 94 MovieClip "tower" in Symbol 95 MovieClip [snow] Frame 1
onClipEvent (load) {
innerLevel = 1;
cost = 500;
shots = 0;
range = 60;
mspeed = 1;
firing = 200;
damage = 0;
btype = "bul4";
no = true;
w = 190;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(20);
}
return(0);
case 2 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(50);
}
return(0);
case 3 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(80);
}
return(0);
case 4 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(100);
}
return(0);
case 5 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(200);
}
return(0);
case 6 :
if (stat == "range") {
return(1);
}
if (stat == "speed") {
return(1);
}
return(1);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 60;
this.damage = 0;
this.firing = 200;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 60;
this.damage = 0;
this.firing = 180;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 60;
this.damage = 0;
this.firing = 150;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 60;
this.damage = 0;
this.firing = 100;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 60;
this.damage = 0;
this.firing = 40;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > this.range) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
w = w + _root.gamespeed;
if (this.no && (!this.placing)) {
if (w >= firing) {
w = 0;
bul = _root.attachMovie("sw", "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
bul._x = this._parent._x;
bul._y = this._parent._y;
bul.onEnterFrame = function () {
this._xscale = this._xscale + (30 * _root.gamespeed);
this._yscale = this._yscale + (30 * _root.gamespeed);
this._alpha = this._alpha - (1 * _root.gamespeed);
if (this._alpha <= 0) {
this.removeMovieClip();
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this)) {
if (!(obj.hit === 1)) {
obj.speed = obj.speed - 2;
if (obj.spec == "air") {
obj.hp = obj.hp - ((5 / obj.life) * 100);
}
obj.hit = 1;
}
}
i--;
}
};
}
}
};
}
Instance of Symbol 72 MovieClip "inf" in Symbol 95 MovieClip [snow] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 132 MovieClip [mine] Frame 1
this.hitting = true;
stop();
Symbol 132 MovieClip [mine] Frame 22
this.hitting = false;
this.removeMovieClip();
Symbol 136 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 2
stop();
Instance of Symbol 136 MovieClip "tower" in Symbol 137 MovieClip [electro] Frame 1
onClipEvent (load) {
pobj = "";
cost = 350;
innerLevel = 1;
range = 50;
mspeed = 1;
firing = 35;
damage = 10;
btype = "bul2";
no = true;
w = 30;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(10);
case 2 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(0);
}
return(15);
case 3 :
if (stat == "range") {
return(70);
}
if (stat == "speed") {
return(0);
}
return(20);
case 4 :
if (stat == "range") {
return(80);
}
if (stat == "speed") {
return(0);
}
return(30);
case 5 :
if (stat == "range") {
return(90);
}
if (stat == "speed") {
return(0);
}
return(40);
case 6 :
if (stat == "range") {
return(1);
}
if (stat == "speed") {
return(0);
}
return(1);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 50;
this.damage = 10;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 60;
this.damage = 15;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 70;
this.damage = 20;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 80;
this.damage = 30;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 90;
this.damage = 40;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (this.innerLevel == 5) {
i = _root.tows.length;
while (i > -1) {
tow = _root[_root.tows[i]._name];
if (((tow.tower.innerLevel == 5) && (tow.tower.fuse == 1)) && (!tow.tower.placing)) {
if (this.hitTest(tow.tower)) {
thun = _root.attachMovie("thunder", "thunder" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
thun._x = (_parent._x + tow._x) / 2;
thun._y = (_parent._y + tow._y) / 2;
_root.tows.push(thun);
_root.tows = _root.tows.remove(tow);
_root.tows = _root.tows.remove(this);
tow.removeMovieClip();
_parent.removeMovieClip();
}
}
i--;
}
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > this.range) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.pobj = obj;
this.no = true;
if (this.no && (!this.placing)) {
}
}
} else {
this.no = false;
}
i--;
}
w = w + _root.gamespeed;
if (((this.no && (!this.placing)) && (this.pobj != "")) && (w >= firing)) {
w = 0;
cm = _root.createEmptyMovieClip("canvas_mc" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
cm.living = 35;
cm.lived = 0;
cm.sx = _parent._x;
cm.sy = _parent._y;
cm.onEnterFrame = function () {
this.clear();
this.lived = this.lived + _root.gamespeed;
this.lineStyle(5, 16776960, 100);
this.moveTo(this.sx, this.sy);
this.curveTo((pobj._x - (Math.random() * 20)) + 10, (pobj._y - (Math.random() * 20)) + 10, pobj._x, pobj._y);
dps = (damage / 10) * _root.gamespeed;
pobj.hp = pobj.hp - ((dps / pobj.life) * 100);
if (pobj.hp <= 0) {
this.clear();
this._parent.removeMovieClip();
delete this.onEnterFrame;
}
if (this.lived >= this.living) {
this.clear();
this._parent.removeMovieClip();
delete this.onEnterFrame;
}
};
}
};
}
Instance of Symbol 72 MovieClip "inf" in Symbol 137 MovieClip [electro] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 140 MovieClip [min4] Frame 1
stop();
Symbol 140 MovieClip [min4] Frame 2
this.removeMovieClip();
Instance of Symbol 143 MovieClip in Symbol 144 MovieClip [value] Frame 1
onClipEvent (load) {
price_txt.text = _parent.price + " gold";
}
Instance of Symbol 143 MovieClip in Symbol 144 MovieClip [value] Frame 15
onClipEvent (load) {
price_txt.text = _parent.price;
}
Symbol 144 MovieClip [value] Frame 16
this.removeMovieClip();
Symbol 148 Button
on (release) {
ivalue = _parent.tower.price;
_root.gold = _root.gold + ivalue;
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = ivalue;
val._x = _parent._x;
val._y = _parent._y;
_root.tows = _root.tows.remove(_parent);
_parent.removeMovieClip();
}
Symbol 150 MovieClip [thunder] Frame 20
stop();
Instance of Symbol 147 MovieClip "tower" in Symbol 150 MovieClip [thunder] Frame 20
onClipEvent (load) {
elec = new Array();
price = 12100;
pobj = "";
innerLevel = 5;
range = 150;
mspeed = 1;
firing = 35;
damage = 25;
btype = "bul2";
no = true;
w = 0;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(50);
}
if (stat == "speed") {
return(0);
}
return(10);
case 2 :
if (stat == "range") {
return(60);
}
if (stat == "speed") {
return(0);
}
return(15);
case 3 :
if (stat == "range") {
return(70);
}
if (stat == "speed") {
return(0);
}
return(20);
case 4 :
if (stat == "range") {
return(80);
}
if (stat == "speed") {
return(0);
}
return(30);
case 5 :
if (stat == "range") {
return(90);
}
if (stat == "speed") {
return(0);
}
return(40);
case 6 :
if (stat == "range") {
return(1);
}
if (stat == "speed") {
return(0);
}
return(1);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 50;
this.damage = 10;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 60;
this.damage = 15;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 70;
this.damage = 20;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 80;
this.damage = 30;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 90;
this.damage = 40;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > this.range) {
} else if (obj != undefined) {
if (((obj._y > 0) && (this.elec[obj] != 1)) && (!this.placing)) {
cm = _root.createEmptyMovieClip("canvas_mc" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
cm.living = 35;
cm.lived = 0;
cm.par = this;
cm.sx = _parent._x;
cm.sy = _parent._y;
cm.obj = obj;
cm.onEnterFrame = function () {
this.clear();
this.lived = this.lived + _root.gamespeed;
this.lineStyle(5, 16776960, 100);
this.moveTo(this.sx, this.sy);
this.curveTo((this.obj._x - (Math.random() * 20)) + 10, (this.obj._y - (Math.random() * 20)) + 10, this.obj._x, this.obj._y);
dps = (damage / 10) * _root.gamespeed;
this.obj.hp = this.obj.hp - ((dps / this.obj.life) * 100);
this.obj.speed = this.obj.speed - (0.05 * _root.gamespeed);
if (this.obj.speed <= 0) {
this.obj.speed = 0.2;
}
this.par.elec[this.obj] = 1;
if (this.obj.hp <= 0) {
this.clear();
this._parent.removeMovieClip();
delete this.onEnterFrame;
}
if (this.lived >= this.living) {
this.par.elec[this.obj] = 0;
this.clear();
this._parent.removeMovieClip();
delete this.onEnterFrame;
}
};
}
} else {
this.no = false;
}
i--;
}
w = w + _root.gamespeed;
if (((this.no && (!this.placing)) && (this.pobj != "")) && (w >= firing)) {
w = 0;
}
};
}
Instance of Symbol 149 MovieClip "inf" in Symbol 150 MovieClip [thunder] Frame 20
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 156 MovieClip Frame 1
gotoAndStop(random(4) + 2);
Instance of Symbol 157 MovieClip "tower" in Symbol 158 MovieClip [bank] Frame 1
onClipEvent (load) {
w = 0;
}
onClipEvent (enterFrame) {
w = w + _root.gamespeed;
if (w >= 720) {
ivalue = Math.round(_root.gold * 0.15);
_root.gold = _root.gold + ivalue;
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = ivalue;
val._x = _parent._x;
val._y = _parent._y;
w = 0;
}
}
Symbol 162 MovieClip [mine2] Frame 1
stop();
Symbol 162 MovieClip [mine2] Frame 2
onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.hitTest(obj)) {
obj.hp = obj.hp - 500;
}
i--;
}
};
Symbol 162 MovieClip [mine2] Frame 40
this.removeMovieClip();
Instance of Symbol 164 MovieClip "tower" in Symbol 165 MovieClip [grind] Frame 1
onClipEvent (load) {
innerLevel = 1;
price = 800;
range = 200;
mspeed = 1;
firing = 8;
damage = 120;
btype = "rbul";
no = true;
w = 0;
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (_root.pauser._currentframe == 1) {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > this.range) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
if (this.no && (!this.placing)) {
this.w++;
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.dirx = Math.cos((this.angle * Math.PI) / 180) * 15;
bul.diry = Math.sin((this.angle * Math.PI) / 180) * 15;
bul.onEnterFrame = function () {
if (this.hitting) {
this._x = this._x - this.dirx;
this._y = this._y - this.diry;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this) && (this.hitting)) {
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
this._x = obj._x;
this._y = obj._y;
this.hitting = false;
this.removeMovieClip();
}
i--;
}
};
}
}
}
};
}
Symbol 165 MovieClip [grind] Frame 21
stop();
Instance of Symbol 149 MovieClip "inf" in Symbol 165 MovieClip [grind] Frame 21
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 164 MovieClip "tower" in Symbol 165 MovieClip [grind] Frame 21
onClipEvent (load) {
innerLevel = 1;
price = 11000;
range = 200;
mspeed = 2;
firing = 5;
damage = 120;
btype = "rbul";
no = true;
w = 0;
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (_root.pauser._currentframe == 1) {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > this.range) {
} else if (obj != undefined) {
if (obj._y > 0) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
if (this.no && (!this.placing)) {
this.w = this.w + _root.gamespeed;
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.dirx = (Math.cos((this.angle * Math.PI) / 180) * 15) * _root.gamespeed;
bul.diry = (Math.sin((this.angle * Math.PI) / 180) * 15) * _root.gamespeed;
bul.onEnterFrame = function () {
if (this.hitting) {
this._x = this._x - this.dirx;
this._y = this._y - this.diry;
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.hitTest(this) && (this.hitting)) {
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
this._x = obj._x;
this._y = obj._y;
this.hitting = false;
this.removeMovieClip();
}
i--;
}
};
}
}
}
};
}
Symbol 169 Button
on (release) {
_root.gotoAndPlay("menu");
_root.cover.removeMovieClip();
}
Symbol 172 Button
on (release) {
getURL ("http://www.play4all.net", "_blank");
}
Symbol 177 Button
on (release) {
mochi.MochiScores.showLeaderboard({boardID:"a6bd00e3c6a291f6", score:_root.kills, name:uname.text});
this.removeMovieClip();
}
Symbol 180 Button
on (release) {
mochi.MochiScores.showLeaderboard({boardID:"a6848ece3cd78b5a", score:_root.kills, name:uname.text});
this.removeMovieClip();
}
Symbol 183 Button
on (release) {
mochi.MochiScores.showLeaderboard({boardID:"8c869becf3e530e8", score:_root.kills, name:uname.text});
this.removeMovieClip();
}
Symbol 184 MovieClip [cover] Frame 1
gotoAndPlay(_root.diff + 2);
Symbol 184 MovieClip [cover] Frame 2
stop();
Symbol 184 MovieClip [cover] Frame 3
stop();
Symbol 184 MovieClip [cover] Frame 4
stop();
Symbol 186 MovieClip [min5] Frame 1
stop();
Symbol 186 MovieClip [min5] Frame 2
this.removeMovieClip();
Symbol 200 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 2
stop();
Instance of Symbol 200 MovieClip "tower" in Symbol 201 MovieClip [ml] Frame 1
onClipEvent (load) {
innerLevel = 1;
cost = 550;
range = 100;
mspeed = 0.8;
firing = 50;
damage = 50;
btype = "missile";
no = true;
w = 20;
getStats = function (lvl, stat) {
if (lvl > 5) {
lvl = 6;
}
switch (lvl) {
case 1 :
if (stat == "range") {
return(100);
}
if (stat == "speed") {
return(2);
}
return(50);
case 2 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(2);
}
return(60);
case 3 :
if (stat == "range") {
return(200);
}
if (stat == "speed") {
return(2);
}
return(70);
case 4 :
if (stat == "range") {
return(200);
}
if (stat == "speed") {
return(2);
}
return(100);
case 5 :
if (stat == "range") {
return(200);
}
if (stat == "speed") {
return(2);
}
return(120);
case 6 :
if (stat == "range") {
return(150);
}
if (stat == "speed") {
return(0);
}
return(120);
}
};
upgrade = function () {
innerLevel = innerLevel + 1;
switch (this.innerLevel) {
case 1 :
this.range = 100;
this.damage = 50;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 2 :
this.range = 150;
this.damage = 60;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 3 :
this.range = 200;
this.damage = 70;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 4 :
this.range = 200;
this.damage = 100;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
break;
case 5 :
this.range = 200;
this.damage = 120;
this.firing = 50;
_parent.rc._width = this.range * 2;
_parent.rc._height = this.range * 2;
}
};
cir = _parent.attachMovie("circle", "rc", this.getNextHighestDepth());
cir.swapDepths(_parent.inf);
cir._alpha = 30;
cir._width = this.range * 2;
cir._height = this.range * 2;
cir.onEnterFrame = function () {
if ((_root.sel == _parent) || (placing)) {
this._visible = true;
} else {
this._visible = false;
}
};
this.onEnterFrame = function () {
if (_root.pauser._currentframe == 1) {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (obj.getDepth() > _parent.getDepth()) {
_parent.swapDepths(obj);
}
if (_root.dist_ab(obj._x, obj._y, this._parent._x, this._parent._y) > this.range) {
} else if (obj != undefined) {
if ((obj._y > 0) && (obj.spec == "air")) {
this.px = obj._x;
this.py = obj._y;
this.no = true;
}
} else {
this.no = false;
}
i--;
}
this.rotA = (Math.atan2(this._parent._y - this.py, this._parent._x - this.px) / 0.0174532925) + 90;
this.innerT._rotation = this.rotA;
if (this.no && (!this.placing)) {
this.w = this.w + _root.gamespeed;
if (this.w >= this.firing) {
bul = _root.attachMovie(this.btype, "bullet" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this._parent.swapDepths(bul);
this.w = 0;
bul.par = this;
bul.hitting = true;
this.angle = this.rotA - 90;
bul._rotation = this.rotA;
bul._x = this._parent._x;
bul._y = this._parent._y;
bul._xscale = 50;
bul._yscale = 50;
bul.acc = 1;
bul.dirx = Math.cos((this.angle * Math.PI) / 180);
bul.diry = Math.sin((this.angle * Math.PI) / 180);
bul.onEnterFrame = function () {
this.acc = this.acc + (0.5 * _root.gamespeed);
if (this.hitting) {
this._x = this._x - (this.dirx * (this.acc * _root.gamespeed));
this._y = this._y - (this.diry * (this.acc * _root.gamespeed));
}
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if ((obj.hitTest(this) && (this.hitting)) && (obj.spec == "air")) {
this.hitting = false;
qe = _root.attachMovie("exploder", "ex" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
qe._x = this._x;
qe._y = this._y;
qe.par = this.par;
this.removeMovieClip();
}
i--;
}
};
}
}
}
};
}
Instance of Symbol 72 MovieClip "inf" in Symbol 201 MovieClip [ml] Frame 1
onClipEvent (enterFrame) {
if (_root.sel == _parent) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 202 MovieClip [exploder] Frame 1
mhit = new Array();
onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if ((this.hitTest(obj) && (mhit[obj] != 1)) && (obj.spec == "air")) {
mhit[obj] = 1;
obj.hp = obj.hp - ((this.par.damage / obj.life) * 100);
}
i--;
}
};
Symbol 202 MovieClip [exploder] Frame 39
this.removeMovieClip();
Symbol 210 MovieClip Frame 80
_root.play();
Symbol 219 Button
on (release) {
diff = 0;
play();
}
Symbol 223 Button
on (release) {
diff = 1;
play();
}
Symbol 227 Button
on (release) {
diff = 2;
play();
}
Symbol 230 Button
on (release) {
counter = 0;
play();
}
Instance of Symbol 153 MovieClip in Symbol 242 MovieClip Frame 1
onClipEvent (load) {
this.onRelease = function () {
if (Key.isDown(17)) {
_root.gold = _root.gold + 500;
}
};
}
Instance of Symbol 232 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Mine";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "100 gold";
_parent.details.tdamage.text = "1000 damage";
_parent.details.tdesc.text = "Although this is one use only, it pretty well guarantees a one hit kill on any land units that walk on it.";
};
this.onRelease = function () {
if (_root.gold >= 100) {
tur = _root.attachMovie("mine", "mine" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.mine.placing = true;
this._alpha = 50;
for (i in _root.path) {
obj = _root.path[i];
if (this.hitTest(obj) == true) {
this._alpha = 100;
}
}
if (this.hitTest("_root.hitm") == true) {
this._alpha = 50;
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
_root.gold = _root.gold - 100;
stopDrag();
_root.tows.push(this);
this.mine.placing = false;
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.hitTest(obj) && (this.hitting)) {
if (obj.spec == "ground") {
obj.hp = obj.hp - 1000;
this.play();
_root.tows.remove(this);
delete this.onEnterFrame;
}
}
i--;
}
};
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 234 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "EMP tower";
_parent.details.trange.text = "60 range";
_parent.details.tspeed.text = "20 speed";
_parent.details.tgold.text = "500 gold";
_parent.details.tdamage.text = "Slows enemies";
_parent.details.tdesc.text = "This tower slows down enemies it hits with its electromagnetic pulse.";
};
this.onRelease = function () {
if (_root.gold >= 500) {
tur = _root.attachMovie("snow", "snow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 500;
_root.tows.push(this);
this.tower.fuse = 1;
this.tower.placing = false;
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 236 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Coil";
_parent.details.trange.text = "70 range";
_parent.details.tspeed.text = "7 speed";
_parent.details.tgold.text = "200 gold";
_parent.details.tdamage.text = "10 damage";
_parent.details.tdesc.text = "Fire basic bolts at all enemies to deal low amounts of damage.";
};
this.onRelease = function () {
if (_root.gold >= 200) {
tur = _root.attachMovie("sn1", "sn" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 200;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 238 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Grinder";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "800 gold";
_parent.details.tdamage.text = "20 damage/second";
_parent.details.tdesc.text = "This tower only damages land units and very close range, but it deals damage constantly and can kill a a tough enemy at maximum upgrade.";
};
this.onRelease = function () {
if (_root.gold >= 800) {
tur = _root.attachMovie("gr1", "gr" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 800;
this.tower.fuse = 2;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 240 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Electro";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "600 gold";
_parent.details.tdamage.text = "10 damage/second";
_parent.details.tdesc.text = "This tower deals a constant stream of low electrical damage at increasing ranges. It can damage both land and air units.";
};
this.onRelease = function () {
if (_root.gold >= 600) {
tur = _root.attachMovie("electro", "electro" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
_root.gold = _root.gold - 600;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 242 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Bank";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "500 gold";
_parent.details.tdamage.text = "-";
_parent.details.tdesc.text = "This building gives you an interest bonus of 15% per bank per game minute.";
};
this.onRelease = function () {
if (_root.gold >= 500) {
tur = _root.attachMovie("bank", "bank" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.gold = _root.gold - 500;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 244 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Explosive Mine";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "1000 gold";
_parent.details.tdamage.text = "500 damage";
_parent.details.tdesc.text = "This mine damages all the enemies that fall within its powerful explosion and almost guarantees a one hit kill for those enemies.";
};
this.onRelease = function () {
if (_root.gold >= 1000) {
tur = _root.attachMovie("mine2", "mine" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.mine.placing = true;
this._alpha = 50;
for (i in _root.path) {
obj = _root.path[i];
if (this.hitTest(obj) == true) {
this._alpha = 100;
}
}
if (this.hitTest("_root.hitm") == true) {
this._alpha = 50;
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
_root.gold = _root.gold - 1000;
stopDrag();
_root.tows.push(this);
this.mine.placing = false;
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.hitTest(obj) && (this.done != 1)) {
if (obj.spec == "ground") {
this.play();
this.done = 1;
_root.tows.remove(this);
delete this.onEnterFrame;
}
}
i--;
}
};
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 234 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "EMP tower";
_parent.details.trange.text = "60 range";
_parent.details.tspeed.text = "20 speed";
_parent.details.tgold.text = "500 gold";
_parent.details.tdamage.text = "Slows enemies";
_parent.details.tdesc.text = "This tower slows down enemies it hits with its electromagnetic pulse.";
};
this.onRelease = function () {
if (_root.gold >= 500) {
tur = _root.attachMovie("snow", "snow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 500;
_root.tows.push(this);
this.tower.fuse = 1;
this.tower.placing = false;
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 236 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Coil";
_parent.details.trange.text = "70 range";
_parent.details.tspeed.text = "7 speed";
_parent.details.tgold.text = "200 gold";
_parent.details.tdamage.text = "10 damage";
_parent.details.tdesc.text = "Fire basic bolts at all enemies to deal low amounts of damage.";
};
this.onRelease = function () {
if (_root.gold >= 200) {
tur = _root.attachMovie("sn1", "sn" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 200;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 238 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Grinder";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "800 gold";
_parent.details.tdamage.text = "20 damage/second";
_parent.details.tdesc.text = "This tower only damages land units and very close range, but it deals damage constantly and can kill a a tough enemy at maximum upgrade.";
};
this.onRelease = function () {
if (_root.gold >= 800) {
tur = _root.attachMovie("gr1", "gr" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 800;
this.tower.fuse = 2;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 240 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Electro";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "600 gold";
_parent.details.tdamage.text = "10 damage/second";
_parent.details.tdesc.text = "This tower deals a constant stream of low electrical damage at increasing ranges. It can damage both land and air units.";
};
this.onRelease = function () {
if (_root.gold >= 600) {
tur = _root.attachMovie("electro", "electro" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
_root.gold = _root.gold - 600;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 242 MovieClip in Symbol 246 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Bank";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "500 gold";
_parent.details.tdamage.text = "-";
_parent.details.tdesc.text = "This building gives you an interest bonus of 15% per bank per game minute.";
};
this.onRelease = function () {
if (_root.gold >= 500) {
tur = _root.attachMovie("bank", "bank" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.gold = _root.gold - 500;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Symbol 249 Button
on (release) {
ivalue = 0;
i = 0;
while (i < _parent.tower.innerLevel) {
ivalue = ivalue + (_parent.tower.cost * (i + 1));
i++;
}
ivalue = ivalue * 0.8;
ivalue = Math.round(ivalue);
_root.gold = _root.gold + ivalue;
val = _root.attachMovie("value", "value" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
val.price = ivalue;
val._x = _parent._x;
val._y = _parent._y;
_root.tows = _root.tows.remove(_parent);
_parent.removeMovieClip();
}
Instance of Symbol 49 MovieClip in Symbol 259 MovieClip Frame 1
onClipEvent (load) {
onEnterFrame = function () {
if (_parent._parent.tower.innerLevel == 5) {
_parent.amount.text = "Fully upgraded";
if (this._currentframe != 2) {
this.gotoAndPlay(2);
}
} else {
_parent.amount.text = (_parent._parent.tower.cost * _parent._parent.tower.innerLevel) + " gold";
if (_root.gold >= (_parent._parent.tower.cost * _parent._parent.tower.innerLevel)) {
if (this._currentframe != 1) {
this.gotoAndPlay(1);
}
} else if (this._currentframe != 2) {
this.gotoAndPlay(2);
}
}
};
onRelease = function () {
if (this._currentframe != 2) {
if (_root.gold >= (_parent._parent.tower.cost * _parent._parent.tower.innerLevel)) {
_root.gold = _root.gold - (_parent._parent.tower.cost * _parent._parent.tower.innerLevel);
_parent._parent.tower.upgrade();
_parent.refreshV();
if (_parent._parent.tower.innerLevel == 5) {
_parent._parent.tower.play();
}
}
}
};
}
Instance of Symbol 53 MovieClip in Symbol 259 MovieClip Frame 1
onClipEvent (enterFrame) {
this.onRelease = function () {
_root.sel = "none";
};
}
Symbol 265 MovieClip Frame 1
stop();
Symbol 265 MovieClip Frame 12
stop();
Symbol 265 MovieClip Frame 22
stop();
Symbol 269 Button
on (release) {
getURL ("http://www.play4all.net/download.php", "_self");
}
Symbol 272 Button
on (release) {
_root.sel = "none";
}
Symbol 276 Button
on (release) {
loading.play();
play();
}
Symbol 278 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 2
stop();
Symbol 279 MovieClip Frame 1
stop();
Symbol 279 MovieClip Frame 2
stop();
Symbol 285 MovieClip Frame 1
stop();
Instance of Symbol 291 MovieClip in Symbol 292 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 360 - _root.secs_perc;
}
Symbol 296 Button
on (release, keyPress "<Space>") {
_root.min_id = 1;
}
Symbol 300 MovieClip Frame 1
stop();
Symbol 300 MovieClip Frame 2
stop();
Symbol 300 MovieClip Frame 3
stop();
Symbol 300 MovieClip Frame 4
stop();
Symbol 300 MovieClip Frame 5
stop();
Symbol 300 MovieClip Frame 6
stop();
Symbol 300 MovieClip Frame 7
stop();
Symbol 300 MovieClip Frame 8
stop();
Symbol 300 MovieClip Frame 9
stop();
Symbol 300 MovieClip Frame 10
stop();
Symbol 303 MovieClip Frame 1
stop();
Symbol 303 MovieClip Frame 2
stop();
Instance of Symbol 308 MovieClip in Symbol 309 MovieClip Frame 1
onClipEvent (load) {
this.onPress = function () {
startDrag (this, true, -90, 0, 100, 0);
};
this.onMouseUp = function () {
stopDrag();
};
this.onEnterFrame = function () {
_root.gamespeed = (this._x / 100) + 1;
this.gs_txt.text = (Math.round(this._x) + 100) + "%";
};
}
Symbol 321 MovieClip Frame 1
onEnterFrame = function () {
gold_txt.text = _root.gold + " gold";
};
Instance of Symbol 232 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Mine";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "10 gold";
_parent.details.tdamage.text = "1000 damage";
_parent.details.tdesc.text = "Although this is one use only, it pretty well guarantees a one hit kill on any land units that walk on it.";
};
this.onRelease = function () {
if (_root.gold >= 10) {
tur = _root.attachMovie("mine", "mine" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.mine.placing = true;
this._alpha = 50;
for (i in _root.path) {
obj = _root.path[i];
if (this.hitTest(obj) == true) {
this._alpha = 100;
}
}
if (this.hitTest("_root.hitm") == true) {
this._alpha = 50;
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
_root.gold = _root.gold - 10;
stopDrag();
_root.tows.push(this);
this.mine.placing = false;
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.hitTest(obj) && (this.hitting)) {
if (obj.spec == "ground") {
obj.hp = obj.hp - 1000;
this.play();
_root.tows.remove(this);
delete this.onEnterFrame;
}
}
i--;
}
};
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 234 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "EMP tower";
_parent.details.trange.text = "60 range";
_parent.details.tspeed.text = "20 speed";
_parent.details.tgold.text = "50 gold";
_parent.details.tdamage.text = "Slows enemies";
_parent.details.tdesc.text = "This tower slows down enemies it hits with its electromagnetic pulse.";
};
this.onRelease = function () {
if (_root.gold >= 50) {
tur = _root.attachMovie("snow", "snow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 50;
_root.tows.push(this);
this.tower.fuse = 1;
this.tower.placing = false;
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 236 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Coil";
_parent.details.trange.text = "70 range";
_parent.details.tspeed.text = "7 speed";
_parent.details.tgold.text = "20 gold";
_parent.details.tdamage.text = "10 damage";
_parent.details.tdesc.text = "Fire basic bolts at all enemies to deal low amounts of damage.";
};
this.onRelease = function () {
if (_root.gold >= 20) {
tur = _root.attachMovie("sn1", "sn" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 20;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 238 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Grinder";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "80 gold";
_parent.details.tdamage.text = "20 damage/second";
_parent.details.tdesc.text = "This tower only damages land units and very close range, but it deals damage constantly and can kill a a tough enemy at maximum upgrade.";
};
this.onRelease = function () {
if (_root.gold >= 50) {
tur = _root.attachMovie("gr1", "gr" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 50;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 240 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Electro";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "60 gold";
_parent.details.tdamage.text = "10 damage/second";
_parent.details.tdesc.text = "This tower deals a constant stream of low electrical damage at increasing ranges. It can damage both land and air units.";
};
this.onRelease = function () {
if (_root.gold >= 60) {
tur = _root.attachMovie("electro", "electro" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
_root.gold = _root.gold - 60;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 242 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Bank";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "100 gold";
_parent.details.tdamage.text = "-";
_parent.details.tdesc.text = "This building gives you an interest bonus of 0.5% per bank per game minute.";
};
this.onRelease = function () {
if (_root.gold >= 100) {
tur = _root.attachMovie("bank", "bank" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
_root.gold = _root.gold - 100;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 244 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Explosive Mine";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "100 gold";
_parent.details.tdamage.text = "500 damage";
_parent.details.tdesc.text = "This mine damages all the enemies that fall within its powerful explosion and almost guarantees a one hit kill for those enemies.";
};
this.onRelease = function () {
if (_root.gold >= 10) {
tur = _root.attachMovie("mine2", "mine" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.mine.placing = true;
this._alpha = 50;
for (i in _root.path) {
obj = _root.path[i];
if (this.hitTest(obj) == true) {
this._alpha = 100;
}
}
if (this.hitTest("_root.hitm") == true) {
this._alpha = 50;
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
_root.gold = _root.gold - 100;
stopDrag();
_root.tows.push(this);
this.mine.placing = false;
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.hitTest(obj) && (this.done != 1)) {
if (obj.spec == "ground") {
this.play();
this.done = 1;
_root.tows.remove(this);
delete this.onEnterFrame;
}
}
i--;
}
};
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 232 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Mine";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "100 gold";
_parent.details.tdamage.text = "1000 damage";
_parent.details.tdesc.text = "Although this is one use only, it pretty well guarantees a one hit kill on any land units that walk on it.";
};
this.onRelease = function () {
if (_root.gold >= 100) {
tur = _root.attachMovie("mine", "mine" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.mine.placing = true;
this._alpha = 50;
for (i in _root.path) {
obj = _root.path[i];
if (this.hitTest(obj) == true) {
this._alpha = 100;
}
}
if (this.hitTest("_root.hitm") == true) {
this._alpha = 50;
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
_root.gold = _root.gold - 100;
stopDrag();
_root.tows.push(this);
this.mine.placing = false;
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.hitTest(obj) && (this.hitting)) {
if (obj.spec == "ground") {
obj.hp = obj.hp - 1000;
this.play();
_root.tows.remove(this);
delete this.onEnterFrame;
}
}
i--;
}
};
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 234 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "EMP tower";
_parent.details.trange.text = "60 range";
_parent.details.tspeed.text = "20 speed";
_parent.details.tgold.text = "500 gold";
_parent.details.tdamage.text = "Slows enemies";
_parent.details.tdesc.text = "This tower slows down enemies it hits with its electromagnetic pulse It also deals a bonus amount of damage to aeroplanes.";
};
this.onRelease = function () {
if (_root.gold >= 500) {
tur = _root.attachMovie("snow", "snow" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 500;
_root.tows.push(this);
this.tower.fuse = 1;
this.tower.placing = false;
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 236 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Turret";
_parent.details.trange.text = "70 range";
_parent.details.tspeed.text = "7 speed";
_parent.details.tgold.text = "200 gold";
_parent.details.tdamage.text = "10 damage";
_parent.details.tdesc.text = "Fire basic bolts at all enemies to deal low amounts of damage.";
};
this.onRelease = function () {
if (_root.gold >= 200) {
tur = _root.attachMovie("sn1", "sn" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 200;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 238 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Grinder";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "800 gold";
_parent.details.tdamage.text = "20 damage/second";
_parent.details.tdesc.text = "This tower only damages land units and very close range, but it deals damage constantly and can kill a a tough enemy at maximum upgrade.";
};
this.onRelease = function () {
if (_root.gold >= 800) {
tur = _root.attachMovie("gr1", "gr" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 800;
this.tower.fuse = 2;
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 240 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Electro";
_parent.details.trange.text = "50 range";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "350 gold";
_parent.details.tdamage.text = "10 damage/second";
_parent.details.tdesc.text = "This tower deals a constant stream of low electrical damage at increasing ranges. It can damage both land and air units.";
};
this.onRelease = function () {
if (_root.gold >= 350) {
tur = _root.attachMovie("electro", "electro" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.sel = this;
_root.gold = _root.gold - 350;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 242 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Bank";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "1000 gold";
_parent.details.tdamage.text = "-";
_parent.details.tdesc.text = "This building gives you an interest bonus of 15% per bank per game minute.";
};
this.onRelease = function () {
if (_root.gold >= 1000) {
tur = _root.attachMovie("bank", "bank" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
this.tower.placing = false;
_root.tows.push(this);
delete this.onEnterFrame;
_root.gold = _root.gold - 1000;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 244 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "Explosive Mine";
_parent.details.trange.text = "-";
_parent.details.tspeed.text = "-";
_parent.details.tgold.text = "1000 gold";
_parent.details.tdamage.text = "500 damage";
_parent.details.tdesc.text = "This mine damages all the enemies that fall within its powerful explosion and almost guarantees a one hit kill for those enemies.";
};
this.onRelease = function () {
if (_root.gold >= 1000) {
tur = _root.attachMovie("mine2", "mine" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.mine.placing = true;
this._alpha = 50;
for (i in _root.path) {
obj = _root.path[i];
if (this.hitTest(obj) == true) {
this._alpha = 100;
}
}
if (this.hitTest("_root.hitm") == true) {
this._alpha = 50;
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
_root.gold = _root.gold - 1000;
stopDrag();
_root.tows.push(this);
this.mine.placing = false;
this.onEnterFrame = function () {
i = _root.mins.length;
while (i > -1) {
obj = _root[_root.mins[i]._name];
if (this.hitTest(obj) && (this.done != 1)) {
if (obj.spec == "ground") {
this.play();
this.done = 1;
_root.tows.remove(this);
delete this.onEnterFrame;
}
}
i--;
}
};
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 312 MovieClip in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
_parent.details._visible = false;
};
this.onRollOver = function () {
_parent.details._visible = true;
_parent.details.tname.text = "SAM site";
_parent.details.trange.text = "100 range";
_parent.details.tspeed.text = "5 speed";
_parent.details.tgold.text = "550 gold";
_parent.details.tdamage.text = "50 damage";
_parent.details.tdesc.text = "This surface-to-air missile launcher can deal massive amounts of damage, but it only affects air units.";
};
this.onRelease = function () {
if (_root.gold >= 550) {
tur = _root.attachMovie("ml", "ml" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
startDrag (tur, true);
tur.onEnterFrame = function () {
this.tower.placing = true;
di = 0;
ni = 0;
for (i in _root.path) {
obj = _root.path[i];
if ((this.tower.base.hitTest(obj) == true) || (this.tower.base.hitTest("_root.hitm") == true)) {
this._alpha = 50;
} else {
di++;
}
ni++;
}
if (di >= ni) {
this._alpha = 100;
}
mi = 0;
if (_root.tows.length == 0) {
} else {
i = 0;
while (i <= _root.tows.length) {
obj = _root.tows[i];
if (this.tower.base.hitTest(obj.tower.base) == true) {
this._alpha = 50;
} else {
di++;
}
if ((mi >= _root.tows.length) && (di >= 11)) {
this._alpha = 100;
}
i++;
}
}
};
tur.onRelease = function () {
if (this._alpha == 100) {
stopDrag();
_root.gold = _root.gold - 550;
_root.tows.push(this);
this.tower.placing = false;
delete this.onEnterFrame;
_root.sel = this;
delete this.onRelease;
} else {
this.removeMovieClip();
}
};
}
};
}
Instance of Symbol 320 MovieClip "details" in Symbol 321 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 323 Button
on (release) {
_root.gotoAndPlay("menu");
}