# Flash app maxing the CPU - AS3 Optimization best practice?

**URL:** <https://forum.kirupa.com/t/flash-app-maxing-the-cpu-as3-optimization-best-practice/303398>\
**Category:** flash\
**Created:** [January 19, 2010, 7:50pm UTC](https://forum.kirupa.com/t/flash-app-maxing-the-cpu-as3-optimization-best-practice/303398 "2010-01-19T19:50:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cleay](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@cleay](https://forum.kirupa.com/u/cleay)\
**Post date:** [January 19, 2010, 7:50pm UTC](https://forum.kirupa.com/t/flash-app-maxing-the-cpu-as3-optimization-best-practice/303398/1 "2010-01-19T19:50:19Z")

</div>

I have experience in AS2, but am pretty green when it comes to OOP and AS3. Somewhat optimistically I’ve launched into AS3 by building this app: [http://www.irideparks.com/demo\_builder](http://www.irideparks.com/demo_builder) - as you can see it gets the CPU going!

Been racking my brains (and google) to figure out how to optimize/speed up this app - so a few questions:

Is it best/fastest to retrieve and loop through the display stack itself:

for (var i=0; i \< container.numChildren; i++) {  
var mc = container.getChildAt(i);  
}

- or create an array of references when adding the clips then looping through the array?

When there are a heap of clips on stage like this, is it be better to cache the parent clip (in this case the scrolled clip) as a bitmap? if so, how is best (link?)?

Is there an easy way to check for orphan events? i.e. a missing removeEvent.

These are the things that spring to (my AS3 limited!) mind that may be taxing the CPU, but any other advice would be appreciated too! Thanks in advance!
