# onEnterFrame = function() vs onClipEvent(enterFrame) performance

**URL:** <https://forum.kirupa.com/t/onenterframe-function-vs-onclipevent-enterframe-performance/329754>\
**Category:** flash\
**Created:** [October 11, 2012, 11:31am UTC](https://forum.kirupa.com/t/onenterframe-function-vs-onclipevent-enterframe-performance/329754 "2012-10-11T11:31:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kicker1810](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@kicker1810](https://forum.kirupa.com/u/kicker1810)\
**Post date:** [October 11, 2012, 11:31am UTC](https://forum.kirupa.com/t/onenterframe-function-vs-onclipevent-enterframe-performance/329754/1 "2012-10-11T11:31:26Z")

</div>

Hello.  
I’m developing a game right now and after I did a lot of coding I started to notice some lag.  
I have only one onEnterFrame = function() in the main timeline but about 30 onClipEvent(enterFrame) that run simultaneous and I think that this is the problem.

I was wandering if replacing onClipEvent(enterFrame) with function called from the main onEnterFrame could help a bit.

Moving the codes from onClipEvent to the main timeline is not a very good option since it’s very hard to do but if there is no other solution and if this may improve performance I shall do it.

Please help me with a suggestion. If you know any means of improving performance I want to hear them.
