# More ENTER\_FRAME events?

**URL:** <https://forum.kirupa.com/t/more-enter-frame-events/325624>\
**Category:** flash\
**Created:** [October 26, 2011, 4:21pm UTC](https://forum.kirupa.com/t/more-enter-frame-events/325624 "2011-10-26T16:21:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mufanza](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@Mufanza](https://forum.kirupa.com/u/Mufanza)\
**Post date:** [October 26, 2011, 4:21pm UTC](https://forum.kirupa.com/t/more-enter-frame-events/325624/1 "2011-10-26T16:21:56Z")

</div>

Hi! I’ve just started learning AS3 and was thinking that my first creation could be a simple game. 🙂  
I have the project planned out and I’m starting to code now. There’s just one question I’ve stumbled upon:

I’m going to have a lot of enemy units on the stage. I will need to check for collision, aggression, movement etc for each one of them. The obvious way of doing this is putting an ENTER\_FRAME evented-function into their class. The code in this function would take care of all those things I mentioned before (collision, movement…).

But wouldn’t it be CPU consuming to have that many ENTER\_FRAMES? Wouldn’t it be better to put all enemy units into an array, then create an ENTER\_FRAME function at the main timeline and loop the code of all enemies through there, using just one ENTER\_FRAME function?  
Or is Flash already doing this in a similar way when I use more ENTER\_FRAMES?  
Or it doesn’t matter how many ENTER\_FRAMES I use, because they don’t affect CPU that much?
