// of the VBox.
var yOfComp:Number = height-vm.bottom;
// Temp variable for a container child.
var obj:UIComponent;
for (var i:int = 0; i < numChildren; i++)
{
// Get the first container child.
obj = UIComponent(getChildAt(i));
// Determine the y coordinate of the child.
yOfComp = yOfComp - obj.height;
// Set the x and y coordinate of the child.
// Note that you do not change the x coordinate.
obj.move(obj.x, yOfComp);
// Save the y coordinate of the child,
// plus the vertical gap between children.
// This is used to calculate the coordinate
// of the next child.
yOfComp = yOfComp - gap;
}
}
}
}
In this example, you use the
the container. You can also use the
these coordinates. The difference is that the
component and then dispatches a
the
and
properties changes the location of the component and dispatches the event on the
x
y
next screen update.
UIComponent.move()
UIComponent.x
move()
event when you call the method immediately; setting
move
method to set the position of each child in
and
UIComponent.y
method changes the location of the
Implementing the component
properties to set
169
Need help?
Do you have a question about the FLEX 2 - CREATING AND EXTENDING COMPONENTS and is the answer not in the manual?