Написал следующее:
Класс Main:

Код AS3:
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.TimerEvent;
import flash.utils.Timer;
import flash.ui.Keyboard;
public class Main extends Sprite
{
public var ground:Ground;
public var army:Array;
public var alien:Alien;
public var gameTimer:Timer;
public var archibald:Archibald;
public var downKeyIsBeingPressed:Boolean;
public var upKeyIsBeingPressed:Boolean;
public var leftKeyIsBeingPressed:Boolean;
public var rightKeyIsBeingPressed:Boolean;
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(event:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
leftKeyIsBeingPressed = false;
rightKeyIsBeingPressed = false;
downKeyIsBeingPressed = false;
upKeyIsBeingPressed = false;
ground = new Ground(stage.stageWidth, 100);
ground.y = stage.stageHeight - ground.height;
addChild(ground);
army = new Array();
var newAlien:Alien = new Alien(200, 50);
army.push(newAlien);
addChild(newAlien);
archibald = new Archibald();
addChild(archibald);
archibald.x = mouseX;
archibald.y = mouseY;
gameTimer = new Timer(25);
gameTimer.addEventListener(TimerEvent.TIMER, onTick);
gameTimer.start();
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPress);
stage.addEventListener(KeyboardEvent.KEY_UP, onKeyRelease);
}
public function onTick(timerEvent:TimerEvent):void
{
if (Math.random() < 0.01)
{
var randomX:Number = Math.random() * stage.stageWidth;
var newAlien:Alien = new Alien (randomX, 50);
army.push(newAlien);
addChild(newAlien);
}
for each(var alien:Alien in army)
{
if (alien.grounded && alien.hitTestObject(ground)) alien.grounded = false;
alien.grounded ? alien.moveABit(0,3) : alien.moveABit(3,0);
}
if (leftKeyIsBeingPressed)
{
archibald.moveABit(-3,0);
}
if (archibald.x < (archibald.width / 2))
{
archibald.x = archibald.width / 2;
}
else if (archibald.x > (stage.stageWidth - (archibald.width / 2)))
{
archibald.x = stage.stageWidth - (archibald.width / 2);
}
}
public function onKeyPress(event:KeyboardEvent):void
{
if (event.keyCode == Keyboard.LEFT)
{
leftKeyIsBeingPressed = true;
}
else if (event.keyCode == Keyboard.RIGHT)
{
rightKeyIsBeingPressed = true;
}
else if (event.keyCode == Keyboard.DOWN)
{
downKeyIsBeingPressed = true;
}
else if (event.keyCode == Keyboard.UP)
{
upKeyIsBeingPressed = true;
}
return;
}
public function onKeyRelease(event:KeyboardEvent):void
{
if (event.keyCode == Keyboard.LEFT)
{
leftKeyIsBeingPressed = false;
}
else if (event.keyCode == Keyboard.RIGHT)
{
rightKeyIsBeingPressed = false;
}
else if (event.keyCode == Keyboard.DOWN)
{
downKeyIsBeingPressed = false;
}
else if (event.keyCode == Keyboard.UP)
{
upKeyIsBeingPressed = false;
}
}
}
}
Класс Archibald:

Код AS3:
package
{
import flash.display.Sprite;
public class Archibald extends Sprite
{
public function Archibald()
{
graphics.lineStyle(1, 0x000000);
graphics.beginFill(0xFF0000);
graphics.drawCircle(0, 0, 25);
graphics.endFill();
}
public function moveABit(_x:int, _y:int):void
{
x += _x;
y += _y;
}
}
}
Класс Alien:

Код AS3:
package
{
import flash.display.Sprite;
public class Alien extends Sprite
{
public var grounded:Boolean = true;
public function Alien(_x:int, _y:int)
{
graphics.lineStyle(1, 0x000000);
graphics.beginFill(0x00FF00);
graphics.drawCircle(0, 0, 25);
graphics.endFill();
x = _x;
y = _y;
}
public function moveABit(_x:int, _y:int):void
{
x += _x;
y += _y;
}
}
}
Класс Ground:

Код AS3:
package
{
import flash.display.Sprite;
public class Ground extends Sprite
{
public function Ground(w:int, h:int)
{
graphics.lineStyle(1, 0x000000);
graphics.beginFill(0x666666);
graphics.drawRect(0, 0, w, h);
graphics.endFill();
}
}
}
Арчибальд бодро реагирует на клавишу LEFT. Видимо у вас была ошибка в строчке

Код AS3:
else if (archibald.x > 800 - (archibald.width / 2))
надо, видимо, так:

Код AS3:
else if (archibald.x > (800 - (archibald.width / 2)))
Добавлено через 1 минуту
Еще в сточке

Код AS3:
var newAlien = new Alien (randomX,50);
у переменной newAlien не объявлен тип (var newAlien
:Alien = new Alien (randomX,50))
Добавлено через 14 минут
Хотя, нет. Строчка с
else if (...) если и была ошибочной, то на перемещение Арчи в данной реализации никак не влияет, потому что он пока может ходить только влево.