onEnterFrame and Event.ENTER_FRAME

Minimize the use of onEnterFrame (AS2) or Event.ENTER_FRAME (AS3) event handlers, or at the very least install and remove them when necessary, rather than having them executed all the time. Having too many onEnterFrame/Event.ENTER_FRAME handlers may drop performance significantly. As an alternative, consider using setInterval and setTimeout functions. When using setInterval:

Cleaning up onEnterFrame

To remove onEnterFrame handlers use the delete operator:

delete this.onEnterFrame;
delete mc.onEnterFrame;

Do not assign null or undefined to onEnterFrame (e.g., this.onEnterFrame = null;), as this operation does not remove the onEnterFrame handler completely. Scaleform will still attempt to resolve this handler, as the member with the name onEnterFrame will still exist.