About Creating Advanced Components - Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

Component users do not call these methods directly; Flex calls them as part of the
initialization process of creating a component, or when other method calls occur. For more
information, see
"About the component instantiation life cycle" on page
150.
About the invalidation methods
During the lifetime of a component, your application might modify the component by
changing its size or position, modifying a property that controls its display, or modifying a
style or skin property of the component. For example, you might change the font size of the
text displayed in a component. As part of changing the font size, the component's size might
also change, which requires Flex to update the layout of the application. The layout operation
might require Flex to invoke the
,
,
, and
commitProperties()
measure()
layoutChrome()
the
methods of your component.
updateDisplayList()
Your application can programmatically change the font size of a component much faster than
Flex can update the layout of an application. Therefore, you only want to update the layout
after you are sure that you determined the final value of the font size.
In another scenario, when you set multiple properties of a component, such as the
and
label
properties of a Button control, you want the
,
, and
icon
commitProperties()
measure()
methods to execute only once, after all properties are set. You do not
updateDisplayList()
want these methods to execute when you set the
property, and then execute again when
label
you set the
property.
icon
Also, several components might change their font size at the same time. Rather than updating
the application layout after each component changes its font size, you want Flex to coordinate
the layout operation to eliminate any redundant processing.
Flex uses an invalidation mechanism to synchronize modifications to components. Flex
implements the invalidation mechanism as a set of methods that you call to signal that
something about the component has changed and requires Flex to call the component's
,
,
, or
methods.
commitProperties()
measure()
layoutChrome()
updateDisplayList()

About creating advanced components

149

Advertisement

Table of Contents
loading

Table of Contents