Here is an ActionScript 2 enemy ai script that allows you to create enemies that move around randomly inside a container movieclip and randomly change direction.
Here is a simple AS2 enemy creation/ai script that allows you to create enemies that move about randomly inside a container movieclip. You can set custom movement boundaries/borders. When an enemy hits the border, it will “bounce off” and move in the opposite direction.