# AddChildAt, performance?

**URL:** <https://forum.kirupa.com/t/addchildat-performance/306918>\
**Category:** flash\
**Created:** [March 24, 2010, 2:42pm UTC](https://forum.kirupa.com/t/addchildat-performance/306918 "2010-03-24T14:42:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maqrkk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Maqrkk](https://forum.kirupa.com/u/Maqrkk)\
**Post date:** [March 24, 2010, 2:42pm UTC](https://forum.kirupa.com/t/addchildat-performance/306918/1 "2010-03-24T14:42:52Z")

</div>

Hello everyone,

I was wondering if addChildAt is slower than addChild, and if so, how bad it is. I want to add objects at runtime, constantly, but they must be behind the player, so I’d use addChildAt to index 0, I figured. However, would this damage my performance?

It’s for my scrolling platform engine, I want buildings in the ‘background’ only on the display list when they actually can be seen (code for this is working fine, runs at about 160 FPS last time I checked).

So, should I look into another solution? The only other solution I know of is to have a second ‘layer’ sprite in the engine, but since it’s scrolling, I’d have to scroll 2 sprites all the time. Don’t know the best thing to do here 🙂

Thanks in advance.
