Actionscript Code:
onClipEvent (load) {
var a = 100;
}
onClipEvent (enterFrame) {
function goblinspawn() {
a++;
var newname = "goblin" + a;
_root.attachMovie ("goblin", gob, this.getNextHighestDepth())
if (this._xscale == +scale) {
_root[gob]._x = 1400;
_root[gob]._y = 250;
}else{
_root[gob]._x = 1400;
_root[gob]._y = 250;
}
_root[gob].onEnterFrame = function() {
if (_root.knight._x < this._x) {
this._x -= 8
}
if (_root.knight._x > this._x) {
this._x += 8
}
}
}
function goblinspawn1() {
var newname = "goblin" + a;
_root.attachMovie ("goblin", gob, this.getNextHighestDepth())
if (this._xscale == +scale) {
_root[gob]._x = 100;
_root[gob]._y = 250;
}else{
_root[gob]._x = 100;
_root[gob]._y = 250;
}
}
//nonfunction
//nonfunction
if (a == 100) {
goblinspawn();
a++;
}
if (a == 101) {
goblinspawn1();
a++;
}
if (a == 102) {
goblinspawn();
a++;
}
}