For those of you who haven't been following along, take a peek at this demo HERE
var enemyArray:Array = new Array();
function enterFrameLoop(event):void
{ var closestEnemy:Number = 25000000; for (var i:int = 0; i < enemyArray.length; i++) { var currentEnemy:Object = enemyArray[i]; var dist:Number = Math.pow(hero.x-currentEnemy.x,2)+Math.pow(hero.y-currentEnemy.y,2);
Considering you don't really need the euclidean distance specifically, why don't you just compare dist² instead? It saves you the potentially expensive square root when you have a ton of enemies.
See, for your function, you don't necessarily need to calculate the exact distance between objects. All you really need, is a value that's small for close enemies and large for enemies that are far away.
Keeping this in mind, you notice that you don't need to use the sqrt-operation, because Math.pow(hero.x-currentEnemy.x,2)+Math.pow(hero.y-currentEnemy.y,2) alone is still going to be small for close objects and big for far-away objects.
Mind you, if you need to use the exact distance for something else later on, you'd use your example. But just to test which object is closest, the square root is not needed.