User Guide
816 Chapter 6: Components Dictionary
Example
The following handler displays a message in the Output panel when the object it’s attached to
becomes invisible.
on(hide) {
trace("I’ve become invisible.");
}
See also
UIObject.reveal
UIObject.invalidate()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
componentInstance.invalidate()
Parameters
None.
Returns
Nothing.
Description
Method; marks the object so it will be redrawn on the next frame interval.
This method is primarily useful to developers of new custom components. A custom component
is likely to support a number of operations that change the component’s appearance.
Often, the best way to build a component is to centralize the logic for updating the component’s
appearance in the
draw() method. If the component has a draw() method, you can call
invalidate() on the component to redraw it. (For information on defining a draw() method,
see “Defining core functions” on page 944.)
All operations that change the component’s appearance can call
invalidate() instead of
redrawing the component themselves. This has some advantages: code isn’t duplicated
unnecessarily, and multiple changes can easily be batched up into one redraw, instead of causing
multiple, redundant redraws.
Example
The following example marks the ProgressBar instance pBar for redrawing:
pBar.invalidate();