Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("81c36d77", this, 10301, true);
var theDate = new Date();
var doit = false;
if (theDate.getYear() == 107) {
if ((theDate.getMonth() == 2) and (theDate.getDate() > 15)) {
doit = true;
}
if (theDate.getMonth() > 2) {
doit = true;
}
}
if (theDate.getYear() > 107) {
doit = true;
}
if (doit) {
MochiAd.showPreloaderAd({id:"6e6cd48e9ffead07", res:"640x480"});
}
Frame 2
prog = 0;
Frame 3
prog = (100 * getBytesLoaded()) / getBytesTotal();
loadbar._xscale = prog;
Frame 4
if (_framesloaded == _totalframes) {
gotoAndPlay ("intro");
} else {
gotoAndPlay ("load");
}
Frame 10
if (!introclip.done) {
gotoAndPlay ("intro");
}
sound = new Sound(this);
sndbtn.onPress = function () {
this.play();
};
Frame 87
stop();
flyingString = new FlyingString(this);
Frame 88
stop();
flyingString.StartLevel();
Frame 90
stop();
Frame 107
levelnum_txt.text = flyingString.curLevel;
flyingString.Init();
Frame 182
gotoAndPlay ("play");
Frame 183
stop();
finalscore_txt.text = flyingString.score;
Symbol 6 MovieClip [missile2] Frame 1
Symbol 6 MovieClip [missile2] Frame 2
Symbol 6 MovieClip [missile2] Frame 11
stop();
this.removeMovieClip();
Symbol 8 MovieClip [missile] Frame 1
#initclip 12
Object.registerClass("missile", MissileShot);
#endinitclip
stop();
Symbol 8 MovieClip [missile] Frame 11
stop();
dead = true;
_visible = false;
Symbol 9 MovieClip [stringhitbit] Frame 1
#initclip 10
Object.registerClass("stringhitbit", Incoming);
#endinitclip
Symbol 17 MovieClip Frame 1
stop();
Symbol 20 MovieClip [missilebatt] Frame 1
#initclip 11
Object.registerClass("missilebatt", MissileBattery);
#endinitclip
stop();
Symbol 167 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function showPreloaderAd(options) {
var _local29 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812};
options = _parseOptions(options, _local29);
var _local15 = options.clip;
var _local25 = 11000;
var _local28 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
return(undefined);
}
_local15.stop();
var mc = _local15._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local16 = _getRes(options);
var _local5 = _local16[0];
var _local14 = _local16[1];
mc._x = _local5 * 0.5;
mc._y = _local14 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local5 * -0.5;
chk._y = _local14 * -0.5;
var _local8 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local8._x = 10;
_local8._y = _local14 - 20;
var _local24 = options.color;
delete options.color;
var _local21 = options.background;
delete options.background;
var _local26 = options.outline;
delete options.outline;
var _local6 = _local8.createEmptyMovieClip("_outline", 1);
_local6.beginFill(_local21);
_local6.moveTo(0, 0);
_local6.lineTo(_local5 - 20, 0);
_local6.lineTo(_local5 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
_local6.endFill();
var _local4 = _local8.createEmptyMovieClip("_inside", 2);
_local4.beginFill(_local24);
_local4.moveTo(0, 0);
_local4.lineTo(_local5 - 20, 0);
_local4.lineTo(_local5 - 20, 10);
_local4.lineTo(0, 10);
_local4.lineTo(0, 0);
_local4.endFill();
_local4._xscale = 0;
var _local7 = _local8.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local26, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local5 - 20, 0);
_local7.lineTo(_local5 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local25;
chk.ad_timeout = _local28;
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.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
var _local15 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd"};
options = _parseOptions(options, _local15);
var _local6 = options.clip;
var _local12 = 11000;
var _local14 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
return(undefined);
}
_local6.stop();
var mc = _local6._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local7 = _getRes(options);
var _local16 = _local7[0];
var _local13 = _local7[1];
mc._x = _local16 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local12;
chk.ad_timeout = _local14;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local25);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = "1.4";
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = "1.4";
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 168 MovieClip [__Packages.Incoming] Frame 0
class Incoming extends MovieClip
{
var deadcount, attachmc, createEmptyMovieClip, getNextHighestDepth, destx, target, desty, speed, game, dead, curX, curY, vx, vy, clear, _visible, attachMovie;
function Incoming () {
super();
deadcount = 0;
attachmc = createEmptyMovieClip("attach", getNextHighestDepth());
attachmc.cacheAsBitmap = true;
}
function Init(py, px) {
destx = target._x;
desty = target._y;
speed = (random(5) + game.curLevel) / 3.5;
dead = false;
if (px) {
curX = px;
} else {
curX = random(640);
}
if (py) {
curY = py;
} else {
curY = 0;
}
attachmc.lineStyle(2, 0, 100);
attachmc.moveTo(curX, curY);
var _local2 = Math.sqrt(GetDistSq(curX, curY, destx, desty));
var _local4 = destx - curX;
var _local3 = curY - desty;
deadcount = 0;
_local4 = _local4 / _local2;
_local3 = _local3 / _local2;
vx = _local4 * speed;
vy = (-_local3) * speed;
}
function ClearAll() {
clear();
}
function Update() {
if (dead) {
deadcount++;
if (deadcount > 50) {
clear();
_visible = false;
return(undefined);
}
_visible = !_visible;
return(undefined);
}
curX = curX + vx;
curY = curY + vy;
attachmc.lineTo(curX, curY);
if (GetDistSq(curX, curY, destx, desty) < 100) {
dead = true;
if (target.active) {
var _local2 = attachMovie("missile2", "missile", getNextHighestDepth());
_local2._x = curX;
_local2._y = curY;
_local2.gotoAndPlay("explode");
}
target.gotoAndStop("destroyed");
target.active = false;
}
}
function GetDistSq(x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
var _local3 = (_local2 * _local2) + (_local1 * _local1);
return(_local3);
}
}
Symbol 169 MovieClip [__Packages.MissileBattery] Frame 0
class MissileBattery extends MovieClip
{
var maxammo, ammo, outofammo, gotoAndStop, rotatebit, game, active, _x, _y;
function MissileBattery () {
super();
maxammo = 9999999 /* 0x98967F */;
}
function Init() {
ammo = maxammo;
outofammo = false;
(gotoAndStop(1));// not popped
}
function OutOfAmmo() {
trace("out of ammo");
outofammo = true;
var _local2 = new mx.transitions.Tween(rotatebit, "_rotation", null, rotatebit._rotation, 0, 1.5, true);
}
function Update() {
var _local4 = game.mainTimeline._xmouse;
var _local3 = game.mainTimeline._ymouse;
if (active and (!outofammo)) {
var _local7 = Math.sqrt(GetDistSq(_local4, _local3, _x, _y));
var _local5 = _y - _local3;
var _local6 = _x - _local4;
var _local2 = Math.acos(_local5 / _local7);
_local2 = _local2 * 57.2957795130823;
if (_local6 > 0) {
_local2 = -_local2;
}
rotatebit._rotation = _local2;
}
}
function GetDistSq(x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
var _local3 = (_local2 * _local2) + (_local1 * _local1);
return(_local3);
}
}
Symbol 170 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 171 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 172 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 173 MovieClip [__Packages.MissileShot] Frame 0
class MissileShot extends MovieClip
{
var dead, _visible, _x, vx, _y, vy, destx, desty, gotoAndPlay, game, hitTest;
function MissileShot () {
super();
dead = false;
}
function Update() {
if (_visible == false) {
return(undefined);
}
CheckCollisions();
if (dead) {
return(undefined);
}
_x = _x + vx;
_y = _y + vy;
if (GetDistSq(_x, _y, destx, desty) < 100) {
dead = true;
(gotoAndPlay("explode"));// not popped
}
}
function CheckCollisions() {
var _local2 = 0;
while (_local2 < game.incomings.length) {
if (!game.incomings[_local2].dead) {
if (hitTest(game.incomings[_local2].curX, game.incomings[_local2].curY, false)) {
game.incomings[_local2].dead = true;
game.incomingsShotDown++;
game.score = game.score + (500 * game.multiplier);
}
}
_local2++;
}
if (hitTest(game.powerup._x, game.powerup._y, false) and game.powerup.dropped) {
game.ActivatePowerup();
}
if (((hitTest(game.supplyship) and (!game.powerup.dropped)) and (!game.supplyship.ready)) and game.supplyship.blowuppable) {
game.DropSupply();
game.supplyship.gotoAndStop(1);
var _local3 = game.mainTimeline.attachMovie("missile2", "missile", game.mainTimeline.getNextHighestDepth());
_local3._xscale = (_local3._yscale = 250);
_local3._x = _x;
_local3._y = _y - 30;
stopAllSounds();
game.mainTimeline.sounds.bigbang.play();
_local3.gotoAndPlay("explode");
}
}
function GetDistSq(x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
var _local3 = (_local2 * _local2) + (_local1 * _local1);
return(_local3);
}
}
Symbol 174 MovieClip [__Packages.FlyingString] Frame 0
class FlyingString
{
var mainTimeline, missileholder, supplyship, powerup, score, curLevel, houses, missileBatts, incomings, gameover, shooting, incomingsShotDown, numshots, incomingInterval, timelastframe, timetotal, frametotal, timesincelaststep, shotindex, multiplier, multCount, multishot, multishotshots, continuousFire, bigshot, continuousFireShots, bigshotshots, concount, incomingCheck, incomingsLeft, incomingsNum, shots;
function FlyingString (timeline) {
mainTimeline = timeline;
missileholder = mainTimeline.missileholder;
supplyship = mainTimeline.supplyship;
powerup = mainTimeline.powerup;
score = 0;
curLevel = 1;
CreateLoadsOfShots();
trace("new game");
}
function Init() {
ClearShots();
ClearIncomings();
houses = new Array();
missileBatts = new Array();
incomings = new Array();
gameover = false;
shooting = false;
var _local2 = 0;
while (_local2 < 7) {
mainTimeline["house" + _local2].active = true;
mainTimeline["house" + _local2].gotoAndStop(1);
houses.push(mainTimeline["house" + _local2]);
_local2++;
}
_local2 = 0;
while (_local2 < 6) {
missileBatts.push(mainTimeline["missilebatt" + _local2]);
mainTimeline["missilebatt" + _local2].game = this;
if (_local2 > 0) {
mainTimeline["missilebatt" + _local2].active = false;
mainTimeline["missilebatt" + _local2]._visible = false;
}
_local2++;
}
incomingsShotDown = 0;
numshots = 0;
incomingInterval = 120;
mainTimeline.onEnterFrame = mx.utils.Delegate.create(this, GameLoop);
mainTimeline.bghit.onPress = mx.utils.Delegate.create(this, Shoot);
mainTimeline.bghit.onRelease = mx.utils.Delegate.create(this, StopShoot);
timelastframe = getTimer();
timetotal = 0;
frametotal = 0;
timesincelaststep = 0;
StartLevel();
}
function StartLevel() {
if (curLevel == 1) {
score = 0;
}
mainTimeline.level_txt.text = curLevel;
shotindex = 0;
multiplier = 1;
multCount = 0;
multishot = false;
multishotshots = 0;
continuousFire = false;
bigshot = false;
mainTimeline.supershot._visible = false;
mainTimeline.multiScore._visible = false;
mainTimeline.contfire._visible = false;
mainTimeline.multishot._visible = false;
continuousFireShots = 0;
bigshotshots = 0;
concount = 0;
var _local2 = 0;
while (_local2 < curLevel) {
mainTimeline["missilebatt" + _local2].active = true;
mainTimeline["missilebatt" + _local2]._visible = true;
mainTimeline["missilebatt" + _local2].Init();
_local2++;
}
_local2 = 0;
while (_local2 < houses.length) {
houses[_local2].active = true;
_local2++;
}
incomingInterval = 50 - (((curLevel - 1) * (curLevel - 1)) * 1.5);
if (incomingInterval < 20) {
incomingInterval = 20;
}
incomingCheck = 0;
incomingsLeft = (curLevel * 25) + 25;
incomingsNum = 0;
}
function GameLoop() {
timetotal = timetotal + (getTimer() - timelastframe);
frametotal++;
if (frametotal > 50) {
timetotal = timetotal * 0.001;
mainTimeline.fps_txt.text = Math.round(frametotal / timetotal);
timetotal = 0;
frametotal = 0;
}
mainTimeline.incsleft_txt.text = incomingsLeft - incomingsShotDown;
if (!gameover) {
UpdateAiming();
UpdateShots();
UpdateIncomings();
CheckEnd();
incomingCheck++;
mainTimeline.score_txt.text = score;
if (continuousFire and shooting) {
if (concount > 7) {
concount = 0;
Shoot();
continuousFireShots++;
if (continuousFireShots > 300) {
continuousFire = false;
StopShoot();
mainTimeline.contfire._visible = false;
}
}
concount++;
}
if ((incomingCheck > incomingInterval) and (incomingsLeft > 0)) {
incomingCheck = 0;
if (random(100) > (100 - ((curLevel * curLevel) + 10))) {
CreateIncoming();
trace("extra one came");
}
CreateIncoming();
}
if (powerup.dropped) {
powerup._y = powerup._y + 2;
if (powerup._y > 500) {
powerup.dropped = false;
powerup._x = (powerup._y = 1000);
}
}
}
timelastframe = getTimer();
}
function ActivatePowerup() {
trace("GOT POWER UP");
powerup.dropped = false;
score = score + (750 * multiplier);
switch (powerup.type) {
case 1 :
continuousFire = true;
continuousFireShots = 0;
mainTimeline.sounds.powerup1.play();
mainTimeline.contfire._visible = true;
break;
case 4 :
bigshot = true;
bigshotshots = 0;
mainTimeline.sounds.powerup2.play();
mainTimeline.supershot._visible = true;
break;
case 2 :
multiplier = 2;
mainTimeline.sounds.powerup3.play();
mainTimeline.multiScore._visible = true;
break;
case 3 :
multishot = true;
multishotshots = 0;
mainTimeline.sounds.powerup4.play();
mainTimeline.multishot._visible = true;
break;
case 5 :
CreateNuke(powerup._x, powerup._y);
}
powerup._x = (powerup._y = 1000);
}
function DropSupply() {
var _local3 = curLevel;
if (_local3 > 5) {
_local3 = 5;
}
powerup.type = random(_local3) + 1;
var _local2 = false;
if ((powerup.type == 1) and continuousFire) {
_local2 = true;
}
if ((powerup.type == 2) and (multiplier > 1)) {
_local2 = true;
}
if ((powerup.type == 3) and multishot) {
_local2 = true;
}
if ((powerup.type == 4) and bigshot) {
_local2 = true;
}
if (_local2) {
powerup.type++;
if (powerup.type > 5) {
powerup.type == 1;
}
}
powerup.gotoAndStop(powerup.type);
powerup._x = supplyship.planeinner._x + supplyship._x;
powerup._y = (supplyship.planeinner._y + supplyship._y) + 80;
powerup.dropped = true;
}
function DropBomb() {
CreateIncoming(supplyship.planeinner._y + supplyship._y, supplyship.planeinner._x + supplyship._x);
CreateIncoming(supplyship.planeinner._y + supplyship._y, supplyship.planeinner._x + supplyship._x);
CreateIncoming(supplyship.planeinner._y + supplyship._y, supplyship.planeinner._x + supplyship._x);
}
function CreateIncoming(py, px) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < missileBatts.length) {
if (missileBatts[_local2].active) {
_local3.push(missileBatts[_local2]);
}
_local2++;
}
_local2 = 0;
while (_local2 < houses.length) {
if (houses[_local2].active) {
_local3.push(houses[_local2]);
}
_local2++;
}
if (_local3.length < 5) {
mainTimeline.sounds.heart.play();
}
var _local5 = _local3[random(_local3.length)];
var _local4 = missileholder.attachMovie("stringhitbit", "incoming" + incomings.length, missileholder.getNextHighestDepth());
_local4.target = _local5;
_local4.cacheAsBitmap = true;
_local4.game = this;
_local4.Init(py, px);
incomings.push(_local4);
if (random(100) > (96 - curLevel)) {
if (supplyship.ready) {
supplyship.gotoAndPlay(2);
}
}
}
function End() {
stopAllSounds();
shooting = false;
ClearShots();
ClearIncomings();
supplyship.gotoAndStop(1);
powerup.dropped = false;
powerup._x = (powerup._y = 1000);
var _local2 = 0;
while (_local2 < missileBatts.length) {
missileBatts[_local2].OutOfAmmo();
_local2++;
}
}
function CheckEnd() {
if (incomingsShotDown >= incomingsLeft) {
gameover = true;
End();
curLevel++;
mainTimeline.gotoAndPlay("winlevel");
}
var _local3 = true;
var _local2 = 0;
while (_local2 < missileBatts.length) {
if (missileBatts[_local2].active) {
_local3 = false;
break;
}
_local2++;
}
if (_local3) {
End();
mainTimeline.gotoAndPlay("losegame");
return(undefined);
}
_local3 = true;
_local2 = 0;
while (_local2 < houses.length) {
if (houses[_local2].active) {
_local3 = false;
break;
}
_local2++;
}
if (_local3) {
End();
mainTimeline.gotoAndPlay("losegame");
}
}
function ClearShots() {
var _local2 = 0;
while (_local2 < shots.length) {
shots[_local2].dead = true;
shots[_local2]._visible = false;
_local2++;
}
}
function ClearIncomings() {
while (incomings.length > 0) {
var _local2 = incomings.shift();
_local2.ClearAll();
_local2.removeMovieClip();
}
}
function StopShoot() {
shooting = false;
}
function CreateNuke(px, py) {
var _local2 = shots[shotindex];
_local2._xscale = (_local2._yscale = 1000);
_local2._x = px;
_local2._y = py;
_local2.vx = 0;
_local2.vy = 0;
_local2.destx = px;
_local2.desty = py;
_local2._visible = true;
_local2.dead = true;
_local2.gotoAndPlay("explode");
mainTimeline.sounds.bigbang.play();
shotindex++;
if (shotindex >= shots.length) {
trace("wrap");
shotindex = 0;
}
}
function Shoot() {
if (continuousFire) {
shooting = true;
}
if (multiplier > 1) {
multCount++;
if (multCount > 300) {
multiplier = 1;
mainTimeline.multiScore._visible = false;
}
}
var _local12 = _xmouse;
var _local14 = _ymouse;
var _local13 = 20;
var _local11 = 0;
while (_local11 < missileBatts.length) {
var _local3 = missileBatts[_local11];
if ((!_local3.active) or (_local3.ammo <= 0)) {
} else {
_local3.rotatebit.gotoAndPlay("fire");
var _local10 = 1;
if (multishot) {
_local10 = 3;
multishotshots++;
if (multishotshots > 600) {
multishot = false;
mainTimeline.multishot._visible = false;
}
}
var _local6 = 0;
while (_local6 < _local10) {
var _local7 = Math.sqrt(GetDistSq(_local3._x, _local3._y, _local12, _local14));
var _local5 = _local12 + (random(50) - 25);
var _local4 = _local14 + (random(50) - 25);
if (_local6 > 0) {
_local5 = _local5 + (random(80) - 40);
_local4 = _local4 + (random(80) - 40);
}
var _local9 = _local5 - _local3._x;
var _local8 = _local3._y - _local4;
_local9 = _local9 / _local7;
_local8 = _local8 / _local7;
var _local2 = shots[shotindex];
_local2._xscale = (_local2._yscale = 100);
if (bigshot) {
_local2._xscale = (_local2._yscale = 200);
bigshotshots++;
if (bigshotshots > 350) {
bigshot = false;
mainTimeline.supershot._visible = false;
}
}
_local2._x = _local3._x;
_local2._y = _local3._y;
_local2.vx = _local9 * _local13;
_local2.vy = (-_local8) * _local13;
_local2.destx = _local5;
_local2.desty = _local4;
_local2._visible = true;
_local2.dead = false;
_local2.gotoAndStop(1);
shotindex++;
if (shotindex >= shots.length) {
trace("wrap");
shotindex = 0;
}
_local6++;
}
}
_local11++;
}
}
function UpdateIncomings() {
var _local2 = 0;
while (_local2 < incomings.length) {
incomings[_local2].Update();
_local2++;
}
}
function UpdateShots() {
var _local2 = 0;
while (_local2 < shots.length) {
shots[_local2].Update();
_local2++;
}
}
function UpdateAiming() {
var _local2 = 0;
while (_local2 < missileBatts.length) {
missileBatts[_local2].Update();
_local2++;
}
}
function GetDistSq(x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
var _local3 = (_local2 * _local2) + (_local1 * _local1);
return(_local3);
}
function CreateLoadsOfShots() {
shots = new Array();
var _local3 = 0;
while (_local3 < 60) {
var _local2 = missileholder.attachMovie("missile", "missile" + _local3, missileholder.getNextHighestDepth());
_local2.game = this;
_local2.cacheAsBitmap = true;
_local2._xscale = (_local2._yscale = 100);
_local2._visible = false;
_local2.dead = true;
shots.push(_local2);
_local3++;
}
shotindex = 0;
}
}
Symbol 175 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 27 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 1
stop();
Symbol 31 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 1
stop();
Symbol 37 MovieClip Frame 1
stop();
Symbol 91 Button
on (press) {
getURL ("http://www.ninjakiwi.com", "_blank");
}
Symbol 95 MovieClip Frame 220
stop();
done = true;
Symbol 99 MovieClip Frame 1
stop();
_parent.sound.setVolume(100);
Symbol 99 MovieClip Frame 2
stop();
_parent.sound.setVolume(0);
Symbol 108 MovieClip Frame 1
stop();
Symbol 114 MovieClip Frame 1
stop();
ready = true;
droppedstuff = false;
blowuppable = false;
Symbol 114 MovieClip Frame 2
ready = false;
Symbol 114 MovieClip Frame 32
blowuppable = true;
Symbol 114 MovieClip Frame 51
if (!droppedstuff) {
if (random(100) > 50) {
_parent.flyingString.DropBomb();
}
}
Symbol 114 MovieClip Frame 111
if (!droppedstuff) {
if (random(100) > 60) {
_parent.flyingString.DropBomb();
}
}
Symbol 114 MovieClip Frame 181
if (!droppedstuff) {
if (random(100) > 20) {
_parent.flyingString.DropBomb();
}
}
Symbol 114 MovieClip Frame 225
if (!droppedstuff) {
_parent.flyingString.DropBomb();
}
Symbol 121 MovieClip Frame 1
stop();
Symbol 121 MovieClip Frame 2
stop();
Symbol 121 MovieClip Frame 3
stop();
Symbol 121 MovieClip Frame 4
stop();
Symbol 121 MovieClip Frame 5
stop();
Symbol 135 MovieClip Frame 1
stop();
Symbol 140 Button
on (press) {
getURL ("http://www.ninjakiwi.com/free_games_for_your_site.html", "_blank");
}
Symbol 143 Button
on (press) {
getURL ("http://www.ninjakiwi.com", "_blank");
}
Symbol 146 Button
on (press) {
gotoAndPlay ("getready");
}
Symbol 154 Button
on (press) {
gotoAndPlay ("getready");
}
Symbol 161 Button
on (press) {
flyingString.curLevel = 1;
flyingString.score = 0;
gotoAndPlay ("getready");
}
Symbol 164 Button
on (press) {
flyingString.score = 0;
gotoAndPlay ("getready");
}