Frame 1
stop();
Frame 2
stop();
Frame 3
_root.end_l.text = "Level: " + _root.level;
_root.end_s.text = "Score: " + _root.points;
_root.aircraft.removeMovieClip();
_root.aircraft1.removeMovieClip();
level = 1;
points = 0;
Frame 4
bullet_Depth = 200;
bullet_speed = 7;
SW = 500;
SH = 350;
level = 1;
_root.lev.text = "Level: " + _root.level;
points = 0;
_root.score.text = "Score: " + points;
fighter_Depth = 500;
total_fighters = 1;
bomb_Speed = 3;
bomb_Depth = 1000;
m = 0;
k = 0;
set_fighters = function () {
j = 0;
while (j < total_fighters) {
container = _root.attachMovie("aircraft", "aircraft" + j, fighter_Depth + j);
container.reset = reset_fighters;
container.reset();
j++;
}
};
reset_fighters = function () {
this.isExploding = false;
fighter_life = 3;
this.gotoAndStop(1);
this.decider = random(2);
if (this.decider == 0) {
if (this._xscale < 0) {
this._xscale = 100;
}
left = true;
this._x = SW + random(SW);
this.xspeed = -(random(6) + 2);
} else if (this.decider == 1) {
right = true;
this._xscale = -100;
this._x = -random(SW);
this.xspeed = random(6) + 2;
}
this._y = random(150) + 20;
this.onEnterFrame = move_fighters;
};
move_fighters = function () {
this._x = this._x + this.xspeed;
if ((this._x <= -30) && ((left = true))) {
this.reset();
}
if ((this._x >= (SW + 30)) && ((right = true))) {
this.reset();
}
l = 0;
while (l <= 10) {
if (_root["bullet_" + l].hitTest(this) && (!this.isExploding)) {
fighter_life--;
if (fighter_life <= 0) {
this.gotoAndPlay(2);
this.isExploding = true;
_root["bullet_" + l].removeMovieClip();
points = points + 50;
_root.score.text = "Score: " + points;
}
_root["bullet_" + l].removeMovieClip();
}
l++;
}
};
gun_reset = function () {
shooting = false;
clearInterval(pauser);
};
fire_gun = function () {
m++;
shooting = true;
pauser = setInterval(gun_reset, 400);
container = _root.attachMovie("bullet", "bullet_" + m, bullet_Depth + m);
container._rotation = _root.gun._rotation;
container._x = _root.gun._x;
container._y = _root.gun._y - 5;
container.onEnterFrame = bullet_move;
};
bullet_move = function () {
this._x = this._x + (bullet_speed * Math.sin(this._rotation * (Math.PI/180)));
this._y = this._y - (bullet_speed * Math.cos(this._rotation * (Math.PI/180)));
if (this._y < -10) {
this.removeMovieClip();
} else if (this._y >= SH) {
this.removeMovieClip();
} else if (this._x >= SW) {
this.removeMovieClip();
} else if (this._x <= -10) {
this.removeMovieClip();
}
if (m >= 10) {
m = 0;
}
};
set_fighters();
_root.onMouseDown = function () {
if (!shooting) {
fire_gun();
}
};
Mouse.addListener(_root);
stop();
Instance of Symbol 109 MovieClip "damage" in Frame 4
onClipEvent (load) {
this._xscale = 0;
}
Instance of Symbol 111 MovieClip "gun" in Frame 4
onClipEvent (load) {
toDeg = 57.2957795130823;
}
onClipEvent (enterFrame) {
xd = _root._xmouse - _x;
yd = _root._ymouse - _y;
rot = Math.atan2(yd, xd);
_root.gun._rotation = (rot * toDeg) + 90;
if ((_root.points >= 500) && (_root.level == 1)) {
_root.attachMovie("nextLevel", "nextLevel", 1000);
b = 0;
while (b < _root.total_fighters) {
_root["aircraft" + b].removeMovieClip();
b++;
}
}
}
Frame 5
bullet_Depth = 200;
bullet_speed = 7;
SW = 500;
SH = 350;
_root.lev.text = "Level: " + _root.level;
_root.score.text = "Score: " + points;
fighter_Depth = 500;
total_fighters = 2;
bomb_Speed = 3;
bomb_Depth = 1000;
m = 0;
k = 0;
set_fighters = function () {
j = 0;
while (j < total_fighters) {
container = _root.attachMovie("aircraft", "aircraft" + j, fighter_Depth + j);
container.reset = reset_fighters;
container.reset();
j++;
}
};
reset_fighters = function () {
this.isExploding = false;
fighter_life = 3;
this.gotoAndStop(1);
this.decider = random(2);
if (this.decider == 0) {
if (this._xscale < 0) {
this._xscale = 100;
}
left = true;
this._x = SW + random(SW);
this.xspeed = -(random(6) + 2);
} else if (this.decider == 1) {
right = true;
this._xscale = -100;
this._x = -random(SW);
this.xspeed = random(6) + 2;
}
this._y = random(150) + 20;
this.onEnterFrame = move_fighters;
};
move_fighters = function () {
this._x = this._x + this.xspeed;
if ((this._x <= -30) && ((left = true))) {
this.reset();
}
if ((this._x >= (SW + 30)) && ((right = true))) {
this.reset();
}
l = 0;
while (l <= 10) {
if (_root["bullet_" + l].hitTest(this) && (!this.isExploding)) {
fighter_life--;
if (fighter_life <= 0) {
this.gotoAndPlay(2);
this.isExploding = true;
_root["bullet_" + l].removeMovieClip();
points = points + 50;
_root.score.text = "Score: " + points;
}
_root["bullet_" + l].removeMovieClip();
}
l++;
}
};
gun_reset = function () {
shooting = false;
clearInterval(pauser);
};
fire_gun = function () {
m++;
shooting = true;
pauser = setInterval(gun_reset, 400);
container = _root.attachMovie("bullet", "bullet_" + m, bullet_Depth + m);
container._rotation = _root.gun._rotation;
container._x = _root.gun._x;
container._y = _root.gun._y - 5;
container.onEnterFrame = bullet_move;
};
bullet_move = function () {
this._x = this._x + (bullet_speed * Math.sin(this._rotation * (Math.PI/180)));
this._y = this._y - (bullet_speed * Math.cos(this._rotation * (Math.PI/180)));
if (this._y < -10) {
this.removeMovieClip();
} else if (this._y >= SH) {
this.removeMovieClip();
} else if (this._x >= SW) {
this.removeMovieClip();
} else if (this._x <= -10) {
this.removeMovieClip();
}
if (m >= 10) {
m = 0;
}
};
set_fighters();
_root.onMouseDown = function () {
if (!shooting) {
fire_gun();
}
};
Mouse.addListener(_root);
stop();
Instance of Symbol 111 MovieClip "gun" in Frame 5
onClipEvent (load) {
toDeg = 57.2957795130823;
}
onClipEvent (enterFrame) {
xd = _root._xmouse - _x;
yd = _root._ymouse - _y;
rot = Math.atan2(yd, xd);
_root.gun._rotation = (rot * toDeg) + 90;
if ((_root.points >= 2000) && (_root.level == 2)) {
_root.attachMovie("nextLevel", "nextLevel", 1000);
b = 0;
while (b < _root.total_fighters) {
_root["aircraft" + b].removeMovieClip();
b++;
}
}
}
Frame 6
bullet_Depth = 200;
bullet_speed = 7;
SW = 500;
SH = 350;
_root.lev.text = "Level: " + _root.level;
_root.score.text = "Score: " + points;
fighter_Depth = 500;
total_fighters = 2;
bomb_Speed = 4;
bomb_Depth = 1000;
m = 0;
k = 0;
set_fighters = function () {
j = 0;
while (j < total_fighters) {
container = _root.attachMovie("aircraft", "aircraft" + j, fighter_Depth + j);
container.reset = reset_fighters;
container.reset();
j++;
}
};
reset_fighters = function () {
this.isExploding = false;
fighter_life = 3;
this.gotoAndStop(1);
this.decider = random(2);
if (this.decider == 0) {
if (this._xscale < 0) {
this._xscale = 100;
}
left = true;
this._x = SW + random(SW);
this.xspeed = -(random(6) + 2);
} else if (this.decider == 1) {
right = true;
this._xscale = -100;
this._x = -random(SW);
this.xspeed = random(6) + 2;
}
this._y = random(150) + 20;
this.onEnterFrame = move_fighters;
};
move_fighters = function () {
this._x = this._x + this.xspeed;
if ((this._x <= -30) && ((left = true))) {
this.reset();
}
if ((this._x >= (SW + 30)) && ((right = true))) {
this.reset();
}
l = 0;
while (l <= 10) {
if (_root["bullet_" + l].hitTest(this) && (!this.isExploding)) {
fighter_life--;
if (fighter_life <= 0) {
this.gotoAndPlay(2);
this.isExploding = true;
_root["bullet_" + l].removeMovieClip();
points = points + 50;
_root.score.text = "Score: " + points;
}
_root["bullet_" + l].removeMovieClip();
}
l++;
}
};
gun_reset = function () {
shooting = false;
clearInterval(pauser);
};
fire_gun = function () {
m++;
shooting = true;
pauser = setInterval(gun_reset, 400);
container = _root.attachMovie("bullet", "bullet_" + m, bullet_Depth + m);
container._rotation = _root.gun._rotation;
container._x = _root.gun._x;
container._y = _root.gun._y - 5;
container.onEnterFrame = bullet_move;
};
bullet_move = function () {
this._x = this._x + (bullet_speed * Math.sin(this._rotation * (Math.PI/180)));
this._y = this._y - (bullet_speed * Math.cos(this._rotation * (Math.PI/180)));
if (this._y < -10) {
this.removeMovieClip();
} else if (this._y >= SH) {
this.removeMovieClip();
} else if (this._x >= SW) {
this.removeMovieClip();
} else if (this._x <= -10) {
this.removeMovieClip();
}
if (m >= 10) {
m = 0;
}
};
set_fighters();
_root.onMouseDown = function () {
if (!shooting) {
fire_gun();
}
};
Mouse.addListener(_root);
stop();
Instance of Symbol 109 MovieClip "damage" in Frame 6
onClipEvent (load) {
this._xscale = 0;
}
Instance of Symbol 111 MovieClip "gun" in Frame 6
onClipEvent (load) {
toDeg = 57.2957795130823;
}
onClipEvent (enterFrame) {
xd = _root._xmouse - _x;
yd = _root._ymouse - _y;
rot = Math.atan2(yd, xd);
_root.gun._rotation = (rot * toDeg) + 90;
if ((_root.points >= 3500) && (_root.level == 3)) {
_root.attachMovie("nextLevel", "nextLevel", 1000);
b = 0;
while (b < _root.total_fighters) {
_root["aircraft" + b].removeMovieClip();
b++;
}
}
}
Frame 7
bullet_Depth = 200;
bullet_speed = 7;
SW = 500;
SH = 350;
_root.lev.text = "Level: " + _root.level;
_root.score.text = "Score: " + points;
fighter_Depth = 500;
total_fighters = 3;
bomb_Speed = 4;
bomb_Depth = 1000;
m = 0;
k = 0;
set_fighters = function () {
j = 0;
while (j < total_fighters) {
container = _root.attachMovie("aircraft", "aircraft" + j, fighter_Depth + j);
container.reset = reset_fighters;
container.reset();
j++;
}
};
reset_fighters = function () {
this.isExploding = false;
fighter_life = 3;
this.decider = random(2);
if (this.decider == 0) {
if (this._xscale < 0) {
this._xscale = 100;
}
left = true;
this._x = SW + random(SW);
this.xspeed = -(random(6) + 2);
} else if (this.decider == 1) {
right = true;
this._xscale = -100;
this._x = -random(SW);
this.xspeed = random(6) + 2;
}
this._y = random(150) + 20;
this.onEnterFrame = move_fighters;
};
move_fighters = function () {
this._x = this._x + this.xspeed;
if ((this._x <= -30) && ((left = true))) {
this.reset();
}
if ((this._x >= (SW + 30)) && ((right = true))) {
this.reset();
}
l = 0;
while (l <= 10) {
if (_root["bullet_" + l].hitTest(this) && (!this.isExploding)) {
fighter_life--;
if (fighter_life <= 0) {
this.gotoAndPlay(2);
this.isExploding = true;
_root["bullet_" + l].removeMovieClip();
points = points + 50;
_root.score.text = "Score: " + points;
}
_root["bullet_" + l].removeMovieClip();
}
l++;
}
};
gun_reset = function () {
shooting = false;
clearInterval(pauser);
};
fire_gun = function () {
m++;
shooting = true;
pauser = setInterval(gun_reset, 400);
container = _root.attachMovie("bullet", "bullet_" + m, bullet_Depth + m);
container._rotation = _root.gun._rotation;
container._x = _root.gun._x;
container._y = _root.gun._y - 5;
container.onEnterFrame = bullet_move;
};
bullet_move = function () {
this._x = this._x + (bullet_speed * Math.sin(this._rotation * (Math.PI/180)));
this._y = this._y - (bullet_speed * Math.cos(this._rotation * (Math.PI/180)));
if (this._y < -10) {
this.removeMovieClip();
} else if (this._y >= SH) {
this.removeMovieClip();
} else if (this._x >= SW) {
this.removeMovieClip();
} else if (this._x <= -10) {
this.removeMovieClip();
}
if (m >= 10) {
m = 0;
}
};
set_fighters();
_root.onMouseDown = function () {
if (!shooting) {
fire_gun();
}
};
Mouse.addListener(_root);
stop();
Instance of Symbol 111 MovieClip "gun" in Frame 7
onClipEvent (load) {
toDeg = 57.2957795130823;
}
onClipEvent (enterFrame) {
xd = _root._xmouse - _x;
yd = _root._ymouse - _y;
rot = Math.atan2(yd, xd);
_root.gun._rotation = (rot * toDeg) + 90;
if ((_root.points >= 5000) && (_root.level == 4)) {
_root.attachMovie("nextLevel", "nextLevel", 1000);
b = 0;
while (b < _root.total_fighters) {
_root["aircraft" + b].removeMovieClip();
b++;
}
}
}
Frame 8
bullet_Depth = 200;
bullet_speed = 7;
SW = 500;
SH = 350;
_root.lev.text = "Level: " + _root.level;
_root.score.text = "Score: " + points;
fighter_Depth = 500;
total_fighters = 3;
bomb_Speed = 5;
bomb_Depth = 1000;
m = 0;
k = 0;
set_fighters = function () {
j = 0;
while (j < total_fighters) {
container = _root.attachMovie("aircraft", "aircraft" + j, fighter_Depth + j);
container.reset = reset_fighters;
container.reset();
j++;
}
};
reset_fighters = function () {
this.isExploding = false;
fighter_life = 3;
this.gotoAndStop(1);
this.decider = random(2);
if (this.decider == 0) {
if (this._xscale < 0) {
this._xscale = 100;
}
left = true;
this._x = SW + random(SW);
this.xspeed = -(random(6) + 2);
} else if (this.decider == 1) {
right = true;
this._xscale = -100;
this._x = -random(SW);
this.xspeed = random(6) + 2;
}
this._y = random(150) + 20;
this.onEnterFrame = move_fighters;
};
move_fighters = function () {
this._x = this._x + this.xspeed;
if ((this._x <= -30) && ((left = true))) {
this.reset();
}
if ((this._x >= (SW + 30)) && ((right = true))) {
this.reset();
}
l = 0;
while (l <= 10) {
if (_root["bullet_" + l].hitTest(this) && (!this.isExploding)) {
fighter_life--;
if (fighter_life <= 0) {
this.gotoAndPlay(2);
this.isExploding = true;
_root["bullet_" + l].removeMovieClip();
points = points + 50;
_root.score.text = "Score: " + points;
}
_root["bullet_" + l].removeMovieClip();
}
l++;
}
};
gun_reset = function () {
shooting = false;
clearInterval(pauser);
};
fire_gun = function () {
m++;
shooting = true;
pauser = setInterval(gun_reset, 400);
container = _root.attachMovie("bullet", "bullet_" + m, bullet_Depth + m);
container._rotation = _root.gun._rotation;
container._x = _root.gun._x;
container._y = _root.gun._y - 5;
container.onEnterFrame = bullet_move;
};
bullet_move = function () {
this._x = this._x + (bullet_speed * Math.sin(this._rotation * (Math.PI/180)));
this._y = this._y - (bullet_speed * Math.cos(this._rotation * (Math.PI/180)));
if (this._y < -10) {
this.removeMovieClip();
} else if (this._y >= SH) {
this.removeMovieClip();
} else if (this._x >= SW) {
this.removeMovieClip();
} else if (this._x <= -10) {
this.removeMovieClip();
}
if (m >= 10) {
m = 0;
}
};
set_fighters();
_root.onMouseDown = function () {
if (!shooting) {
fire_gun();
}
};
Mouse.addListener(_root);
stop();
Instance of Symbol 111 MovieClip "gun" in Frame 8
onClipEvent (load) {
toDeg = 57.2957795130823;
}
onClipEvent (enterFrame) {
xd = _root._xmouse - _x;
yd = _root._ymouse - _y;
rot = Math.atan2(yd, xd);
_root.gun._rotation = (rot * toDeg) + 90;
if ((_root.points >= 7500) && (_root.level == 5)) {
_root.attachMovie("nextLevel", "nextLevel", 1000);
b = 0;
while (b < _root.total_fighters) {
_root["aircraft" + b].removeMovieClip();
b++;
}
}
}
Frame 9
bullet_Depth = 200;
bullet_speed = 7;
SW = 500;
SH = 350;
_root.lev.text = "Level: " + _root.level;
_root.score.text = "Score: " + points;
fighter_Depth = 500;
total_fighters = 4;
bomb_Speed = 5;
bomb_Depth = 1000;
m = 0;
k = 0;
set_fighters = function () {
j = 0;
while (j < total_fighters) {
container = _root.attachMovie("aircraft", "aircraft" + j, fighter_Depth + j);
container.reset = reset_fighters;
container.reset();
j++;
}
};
reset_fighters = function () {
this.isExploding = false;
fighter_life = 3;
this.gotoAndStop(1);
this.decider = random(2);
if (this.decider == 0) {
if (this._xscale < 0) {
this._xscale = 100;
}
left = true;
this._x = SW + random(SW);
this.xspeed = -(random(6) + 2);
} else if (this.decider == 1) {
right = true;
this._xscale = -100;
this._x = -random(SW);
this.xspeed = random(6) + 2;
}
this._y = random(150) + 20;
this.onEnterFrame = move_fighters;
};
move_fighters = function () {
this._x = this._x + this.xspeed;
if ((this._x <= -30) && ((left = true))) {
this.reset();
}
if ((this._x >= (SW + 30)) && ((right = true))) {
this.reset();
}
l = 0;
while (l <= 10) {
if (_root["bullet_" + l].hitTest(this) && (!this.isExploding)) {
fighter_life--;
if (fighter_life <= 0) {
this.gotoAndPlay(2);
this.isExploding = true;
_root["bullet_" + l].removeMovieClip();
points = points + 50;
_root.score.text = "Score: " + points;
}
_root["bullet_" + l].removeMovieClip();
}
l++;
}
};
gun_reset = function () {
shooting = false;
clearInterval(pauser);
};
fire_gun = function () {
m++;
shooting = true;
pauser = setInterval(gun_reset, 400);
container = _root.attachMovie("bullet", "bullet_" + m, bullet_Depth + m);
container._rotation = _root.gun._rotation;
container._x = _root.gun._x;
container._y = _root.gun._y - 5;
container.onEnterFrame = bullet_move;
};
bullet_move = function () {
this._x = this._x + (bullet_speed * Math.sin(this._rotation * (Math.PI/180)));
this._y = this._y - (bullet_speed * Math.cos(this._rotation * (Math.PI/180)));
if (this._y < -10) {
this.removeMovieClip();
} else if (this._y >= SH) {
this.removeMovieClip();
} else if (this._x >= SW) {
this.removeMovieClip();
} else if (this._x <= -10) {
this.removeMovieClip();
}
if (m >= 10) {
m = 0;
}
};
set_fighters();
_root.onMouseDown = function () {
if (!shooting) {
fire_gun();
}
};
Mouse.addListener(_root);
stop();
Instance of Symbol 111 MovieClip "gun" in Frame 9
onClipEvent (load) {
toDeg = 57.2957795130823;
}
onClipEvent (enterFrame) {
xd = _root._xmouse - _x;
yd = _root._ymouse - _y;
rot = Math.atan2(yd, xd);
_root.gun._rotation = (rot * toDeg) + 90;
if ((_root.points >= 10000) && (_root.level == 6)) {
_root.attachMovie("nextLevel", "nextLevel", 1000);
b = 0;
while (b < _root.total_fighters) {
_root["aircraft" + b].removeMovieClip();
b++;
}
}
}
Instance of Symbol 3 MovieClip in Symbol 5 MovieClip [bullet] Frame 1
onClipEvent (enterFrame) {
i = 0;
while (i <= _root.total_fighters) {
aicraft = _root["aircraft" + i].jet;
if (this.hitTest(aircraft)) {
this.removeMovieClip();
}
i++;
}
}
Instance of Symbol 3 MovieClip in Symbol 5 MovieClip [bullet] Frame 1
onClipEvent (enterFrame) {
i = 0;
while (i <= _root.total_fighters) {
aicraft = _root["aircraft" + i].jet;
if (this.hitTest(aircraft)) {
this.removeMovieClip();
}
i++;
}
}
Symbol 53 MovieClip Frame 15
stop();
_parent.reset();
Symbol 54 MovieClip [aircraft] Frame 1
k = 0;
explode_set = function () {
this.isExploding = false;
this.Speed = _root.bomb_Speed;
this.onEnterFrame = move_bomb;
};
move_bomb = function () {
this._y = this._y + this.Speed;
if (_root.ground.hitTest(this) && (!this.isExploding)) {
this.isExploding = true;
this.gotoAndPlay(2);
this.Speed = 0;
_root.damage._xscale = _root.damage._xscale + 10;
if (_root.damage._xscale >= 100) {
_root.gotoAndStop("lose");
}
}
if (this._y > SH) {
this.removeMovieClip();
}
z = 0;
while (z <= 10) {
if (_root["bullet_" + z].hitTest(this) && (!this.isExploding)) {
this.gotoAndPlay(2);
this.isExploding = true;
this.Speed = 0;
_root.points = _root.points + 15;
_root.score.text = "Score: " + _root.points;
}
z++;
}
};
drop_bomb = function () {
k++;
container = _root.attachMovie("missile", "missile" + k, _root.bomb_Depth + k);
container._x = this._x;
container._y = this._y;
if (k >= 40) {
k = 1;
}
container.explode = explode_set;
container.explode();
};
call_bomb = function () {
maxtime = 50;
var _local1 = random(maxtime);
if (_local1 == 1) {
drop_bomb();
_local1 = 0;
} else {
_local1 = 0;
}
};
stop();
Instance of Symbol 9 MovieClip "jet" in Symbol 54 MovieClip [aircraft] Frame 1
onClipEvent (enterFrame) {
_parent.call_bomb();
}
Symbol 54 MovieClip [aircraft] Frame 2
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 2
stop();
Symbol 59 MovieClip Frame 15
stop();
_parent.removeMovieClip();
Symbol 60 MovieClip [missile] Frame 1
stop();
Symbol 60 MovieClip [missile] Frame 2
stop();
Symbol 65 MovieClip [nextLevel] Frame 1
this._x = _root.SW / 2;
this._y = _root.SH / 2;
_root.level = _root.level + 1;
_root.lev.text = "Level: " + _root.level;
Symbol 65 MovieClip [nextLevel] Frame 70
_root.gotoAndStop(_root._currentframe + 1);
this.removeMovieClip();
Symbol 79 Button
on (release) {
getURL ("http://www.java-gaming.com");
}
Symbol 83 Button
on (release) {
getURL ("http://www.flashninjaclan.com");
}
Symbol 85 MovieClip Frame 180
_root.gotoAndStop(2);
_root.introduction.removeMovieClip();
stop();
Symbol 93 Button
on (release) {
_root.gotoAndStop(4);
}
Symbol 103 Button
on (release) {
score = _root.points;
_root.thename = _root.scorename;
loadVariablesNum ("http://www.flashninjaclan.com/games/earthdefender/newscore.php", 0, "POST");
play();
}