Advance

If advance is taking too long to execute, there are seven possible optimizations:

  1. Do not execute AS code on every frame. Avoid continuous onEnterFrame/Event.ENTER_FRAME handlers as well, which invoke code on each frame.
  2. Use event-driven programming practices, changing text field and UI state values through an explicit Invoke notification only when a change takes place.
  3. Stop animation in invisible movie clips (_visible (AS2) or visible (AS3) property should be set to true; use the stop() function to stop animation). This will exclude such movie clips from the Advance list. Note that it is necessary to stop every single movie clip in the hierarchy, including children, even if the parent movie clip has stopped.
  4. There is an alternative technique that involves usage of _global.noInvisibleAdvance (AS2) or scaleform.gfx.Extensions.noInvisibleAdvance (AS3) extension. This extension might be useful to exclude groups of invisible movie clips from the Advance list without stopping each of them. If this extension property is set to "true" then invisible movie clips are not added into the Advance list (including their children) and therefore performance is improved. Keep in mind that this technique is not fully Flash compatible. Ensure that the Flash file does not rely on any type of per frame processing within hidden movies. Don’t forget to turn on Scaleform extensions on by setting _global.gfxExtensions (AS2) or scaleform.gfx.Extensions.enabled (AS3) to true to use this (and any other) extension.
  5. Reduce the number of movie clips on stage. Limit unnecessary nesting of movie clips, as each nested clip incurs a small amount of overhead during advance.
  6. Reduce timeline animation, number of keyframes, and shape tweens.