mx.containers
Class Box


Direct Known Subclasses
           mx.containers.DividedBox, mx.containers.Grid, mx.containers.GridRow, mx.containers.HBox, mx.containers.NavBar, mx.containers.VBox, mx.core.Application

class Box
extends mx.containers.Container

The Box class is the base class for HBox and VBox. A Box container lays out its children in either a single vertical column or a single horizontal row. The direction attribute determines whether to use vertical (default) or horizontal layout. You use the <mx:Box>, <mx:VBox>, and <mx:HBox> tags to define Box containers.

MXML Syntax

The <Box> container inherits all the properties of its parent classes, and the following properties:

 <mx:Box
direction="vertical|horizontal"
horizontaAlign="left|center|right"
horizontalGap="6"
marginBottom="0"
marginTop="0"
verticalAlign="top|middle|bottom"
verticalGap="6">
...
child tags
...
/>

See Also
mx.containers.HBox
mx.containers.VBox



Methods
      setRelativeChildHeights() : Void
Assigns a heightFlex to each child, and makes the preferred height of each one 0, so that together they occupy the entire height of a VBox but have the specified relative heights.
      setRelativeChildWidths() : Void
Assigns a widthFlex to each child, and makes the preferred width of each one 0, so that together the children occupy the entire width of an HBox but have the specified relative widths.

Methods inherited from class mx.containers.Container
Constructor  getViewMetrics 

Methods inherited from class mx.core.View
init  draw  createChild  getChildAt  getChildIndex  setChildIndex  destroyAllChildren  destroyChild  destroyChildAt  getViewMetrics 

Methods inherited from class mx.core.UIComponent
getFocus  setFocus  getFocusManager 

Methods inherited from class mx.core.UIObject
createAccessibilityImplementation  measure  doLater  cancelAllDoLaters  invalidate  invalidateStyle  invalidateProperties  invalidateSize  redraw  move  setSize  setSizeNoLayout  drawRect  fillRect  destroyLabel  createClassObject  createEmptyObject  destroyObject  getStyle  setMask  swapDepths 


Properties
      direction:String   [Read/Write]
Orientation of a Box container.

Properties inherited from class mx.containers.Container
version  className  numRepeaters  icon  autoLayout  defaultButton  childDescriptors  creationPolicy  clipContent  hScrollPolicy  vScrollPolicy  maxVPosition  maxHPosition  vLineScrollSize  hLineScrollSize  vPageScrollSize  hPageScrollSize  hPosition  vPosition 

Properties inherited from class mx.core.View
version  className  numChildren 

Properties inherited from class mx.core.UIComponent
version  enabled  tabIndex 

Properties inherited from class mx.core.UIObject
version  nestLevel  dispatchEvent  addEventListener  handleEvent  removeEventListener  kStretch  styleName  className  setStyle  parentApplication  isDocument  parentDocument  documentDescriptor  descriptor  instanceIndices  repeaterIndices  getRepeaterItem  id  width  height  x  y  minHeight  minWidth  preferredHeight  preferredWidth  maxHeight  maxWidth  widthFlex  heightFlex  visible  scaleX  scaleY  alpha  depth  mouseX  mouseY  toolTip  baselinePosition 


Effects

Effects inherited from class mx.core.UIComponent
showEffect  hideEffect  focusInEffect  focusOutEffect 

Effects inherited from class mx.core.UIObject
creationCompleteEffect  moveEffect  resizeEffect  mouseDownEffect  mouseOverEffect  mouseOutEffect  mouseUpEffect 


Events

Events inherited from class: mx.containers.Container
childrenCreated  scroll 

Events inherited from class: mx.core.View
childCreated  childIndexChanged  childDestroyed 

Events inherited from class: mx.core.UIComponent
focusIn  focusOut  keyDown  keyUp  show  hide  valid  invalid  valueCommitted 

Events inherited from class: mx.core.UIObject
initialize  creationComplete  resize  move  draw  load  unload  mouseDown  mouseUp  mouseMove  mouseOver  mouseOut  mouseDownSomewhere  mouseUpSomewhere  mouseMoveSomewhere  mouseChangeSomewhere  effectStart  effectEnd  dragBegin  dragComplete  dragEnter  dragOver  dragExit  dragDrop 


Styles
marginBottom Type: Number   Format: Length   CSS Inheritance: no
Number of pixels between the container`s bottom border and its content area. The default value is 0.
marginTop Type: Number   Format: Length   CSS Inheritance: no
Number of pixels between the container`s top border and its content area. The default value is 0.
horizontalAlign CSS Inheritance: no
Horizontal alignment of children in the container. The default is left. Possible values are left, center, and right.
verticalAlign CSS Inheritance: no
Vertical alignment of children in the container. The default is top. Possible values are top, middle, and bottom.
horizontalGap Type: Number   Format: Length   CSS Inheritance: no
Number of pixels between children in the horizontal direction. The default value is 8.
verticalGap Type: Number   Format: Length   CSS Inheritance: no
Number of pixels between children in the vertical direction. The default value is 8.

Styles inherited from class mx.core.UIComponent
backgroundColor  backgroundDisabledColor  backgroundImage  backgroundAlpha  backgroundSize  barColor  borderCapColor  borderColor  buttonColor  borderStyle  disabledColor  errorColor  highlightColor  lineHeight  modalTransparency  scrollTrackColor  shadowColor  shadowCapColor  symbolColor  symbolBackgroundColor  symbolBackgroundDisabledColor  symbolBackgroundPressedColor  symbolDisabledColor  themeColor 

Styles inherited from class mx.core.UIObject
color  fontFamily  fontSize  fontStyle  fontWeight  textAlign  textDecoration  textIndent  marginLeft  marginRight  horizontalGap  verticalGap 


Method Detail

setRelativeChildHeights

setRelativeChildHeights() : Void

Assigns a heightFlex to each child, and makes the preferred height of each one 0, so that together they occupy the entire height of a VBox but have the specified relative heights. This function expects as many parameters, each of type Number, as there are children. For example, setRelativeChildHeights(2, 1, 1) makes the first child occupy half of the available height of the HBox; the second and third children each occupy one fourth of the available height.


setRelativeChildWidths

setRelativeChildWidths() : Void

Assigns a widthFlex to each child, and makes the preferred width of each one 0, so that together the children occupy the entire width of an HBox but have the specified relative widths. This function expects as many parameters, each of type Number, as there are children. For example, setRelativeChildWidths(2, 1, 1) makes the first child occupy half of the available width of the HBox; the second and third children each occupy one fourth of the available width.


Property Detail

direction

direction:String   [Read/Write]

Orientation of a Box container. Possible values are horizontal and vertical. The default value is vertical.