Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 166

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

Advertisement

Implementing the layoutChrome() method
The
Container
class, and some subclasses of the Container class, use the
method to define the border area around the container.
Flex schedules a call to the
invalidateDisplayList()
the next
event after a call to the
render
the
method to add a component to a container, Flex automatically calls the
addChild()
invalidateDisplayList()
Typically, you use the
example, you can create the RectangularBorder object, and add it as a child of the component
in your override of the
When you create a subclass of the Container class, you can use the
method to create the content children of the container; the content children are the child
components that appear within the container. You then use
position the content children.
You typically use the
container, and any additional elements that you want to appear in the border area. For
example, the Panel container uses the
panel container, including the title text and close button.
The primary reason for dividing the handling of the content area of a container from its
border area is to handle the situation when the
. When the
false
autoLayout
container and of its children are done whenever the position or size of a container child
changes. The default value is
When the
autoLayout
when children are added to or removed from the container. However, Flex executes the
method in both cases. Therefore, the container can still update its border
layoutChrome()
area even when the
autoLayout
Implementing the updateDisplayList() method
The
updateDisplayList()
based on all previous property and style settings, and draws any skins or graphic elements that
the component uses. The parent container for the component determines the size of the
component itself.
166
Creating Advanced Visual Components in ActionScript
layoutChrome()
method occurs. The
invalidateDisplayList()
method.
RectangularBorder
class to define the border area of a container. For
createChildren()
method to define and position the border area of the
layoutChrome()
layoutChrome()
property is set to
.
true
property is set to
false
property is set to
method sizes and positions the children of your component
method when a call to the
layoutChrome()
method.
updateDisplayList()
method to define the title area of the
Container.autoLayout
, measurement and layout of the
true
, measurement and layout are done only once,
.
false
layoutChrome()
method executes during
method. When you use
createChildren()
to
property is set to

Advertisement

Table of Contents
loading

Table of Contents