I think what you are asking for is rather simplistic in concept.
For example if your enemy levels are 0-50, you can just have it create a new array with randomized numbers. I would think that you'd want to do it a little more intelligently and take into account the enemy strength, spawn order etc.
If you wanted to create a random level you could have a function to return an array containing a specified amount of random enemies in a level range :
function getLevelSpawns(amount:int, levelMin:int, levelMax:int):Array
{
var spawn:Array = new Array;
for (var index:int = 0;index < amount;index++)
{
var enemyType:int = Math.random() * (levelMax-levelMin) + levelMin;
spawn.push(enemyType);
}
return spawn;
}
and the usage would be :
var spawns:Array = getLevelSpawns(50, 5,10);
That would give you a random spawn array of 50 enemies of level 5 - 10.
This is just an example. You can make that getLevelSpawns
function more flexible and robust to handle grouping them and being more intelligent about creating a group via parameters and logic.