As the title states, I'm wondering what the best way to handle several movieclips on the stage at one time, each with their own onEnterFrame functions. Lets say we have 50 enemies on the screen at once, constantly playing a walking animation. The onEnterFrame function would consist of getting a direction, moving X/Y values, checking the distance between the player and itself, checking if it is in an attackable distance, etc. As you can imagine a lot of lag occures.
An type of a game where this problem is usually overcome would be in zombie games where you would have multiple zombies on the screen at one time.
What would be the best way to reduce lag when handling multiple movieclips like this?