First: array.length won't work, there is no array. But if that is the array you want to use, make it like this: (array.length - 1). If you have 4 items in an array, the length is 4. But a array uses: 0, 1, 2, 3. So if the random thingie get's 4 it will prompt an error.
Second: So what's the problem... Won't it spawn 4 diffrent types? Then maybe try:
public var enemyArray:Array = new Array(new enemy1(),new enemy2(), new enemy3(), new enemy4());
Hope that it helps