Timeline frames and layers are two important parts of the Flash authoring environment.These areas show where assets are placed and determine how your document works.
GFx will still attempt to resolve this handler, as the member with the name on Enter Frame will still exist. It is especially important to do so inside functions, as the AS compiler optimizes access to local variables by using internal registers with direct access by index rather than putting them into hash tables and accessing by names.
Using the var keyword can double the AS function’s execution speed.
CNNSI had three goals for a minisite running in the weeks before the 2002 Winter Olympics: to gather names for a sweepstakes, to make sure the Olympics audience knew about Bud Greenspan, and to let users vote for their favorite all-time Winter Olympians.
In this case, you may use the undocumented event handler on Clip Event(construct) to install the on Enter Frame: Minimize the use of on Enter Frame event handlers, or at the very least install and remove them when necessary, rather than having them executed all the time.
Having too many on Enter Frame handlers may drop performance significantly.
As an alternative, consider using set Interval and set Timeout functions.
When using set Interval: Do not assign null or undefined to on Enter Frame (e.g., Enter Frame = null), as this operation does not remove the on Enter Frame handler completely.
Action Script is not compiled to native machine code; instead it is converted to byte code, which is faster than an interpreted language but not as fast as compiled native code.
Although Action Script can be slow, in most multimedia presentations, the assets such as graphics, audio, and video - and not the code - are often the limiting performance factor.
Many optimization techniques are not specific to Action Script but simply well-known techniques for writing code in any language without an optimizing compiler.
For example, loops are faster if items that don't change with every loop iteration are removed from within the loop and placed outside the loop instead.