Specifications
81ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
Improving effect performance
Effects let you add animation and motion to your application in response to user or programmatic action. For
example, you can use effects to cause a dialog box to bounce slightly when it receives focus, or to slowly fade in
when it becomes visible.
Effects can be one of the most processor-intensive tasks performed by a Flex application. Use the techniques
described in this section to improve the performance of effects. For more information, see āUsing Behaviorsā on
page 545 in the Adobe Flex 3 Developer Guide.
Increasing effect duration
Increase the duration of your effect with the duration property. Doing this spreads the distinct, choppy stages
over a longer period of time, which lets the human eye fill in the difference for a smoother effect.
Hiding parts of the target view
Make parts of the target view invisible when the effect starts, play the effect, and then make those parts visible
when the effect has completed. To do this, you add logic in the
effectStart and effectEnd event handlers that
controls what is visible before and after the effect.
When you apply a Resize effect to a Panel container, for example, the measurement and layout algorithm for the
effect executes repeatedly over the duration of the effect. When a Panel container has many children, the
animation can be jerky because Flex cannot update the screen quickly enough. Also, resizing one Panel container
often causes other Panel containers in the same view to resize.
To solve this problem, you can use the Resize effectās
hideChildrenTargets property to hide the children of
Panel containers while the Resize effect is playing. The value of the
hideChildrenTargets property is an Array
of Panel containers that should include the Panel containers that resize during the animation. When the
hideChildrenTargets property is true, and before the Resize effect plays, Flex iterates through the Array and
hides the children of each of the specified Panel containers.
Avoiding bitmap-based backgrounds
Designers often give their views background images that are solid colors with gradients, slight patterns, and so
forth. To ease what Flash Player redraws during an effect, try using a solid background color for your background
image. Or, if you want a slight gradient instead of a solid color, use a background image that is a SWF or SVG file.
These are easier for Flash Player to redraw than standard JPG or PNG files.










