mx.containers
Class Container


Direct Known Subclasses
           mx.containers.Accordion, mx.containers.Box, mx.containers.Canvas, mx.containers.Form, mx.containers.FormItem, mx.containers.Tile, mx.containers.ViewStack

class Container
extends mx.core.View

The Container class is an abstract base class. You do not create an instance of Container in an application. Instead, you create an instance of one of Container`s subclasses, such as Canvas or HBox.

The Container class contains the logic for dynamic instantiation, the properties related to repeaters, the icon and label properties, and code for creating a clip mask.

MXML Syntax

The Container class inherits all the properties of its parent classes, and the following properties:

 <mx:tagname
autoLayout="true|false"
clipContent="true|false"
creationPolicy="auto|all|none"
defaultButton="No default."
hLineScrollSize="1"
hPageScrollSize="5"
hPosition="0"
hScrollPolicy="auto|on|off"
icon="No default."
vLineScrollSize="1"
vPageScrollSize="5"
vPosition="0"
vScrollPolicy="auto|on|off"
/>



Methods
      Constructor() : Void
Constructor.
      getViewMetrics() : Object
Thickness of the edges of the object, including the border and scroll bars, if visible.

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
staticversion:String  
ComponentVersion is for internal use only.
      className:String  
Name of the class.
      numRepeaters:Number   [Read-Only]
Number of Repeaters in this Container.
      icon:String   [Read-Write]
URL to an image file for an icon.
      autoLayout:Boolean   [Read-Write]
If true, measurement and layout are done whenever the position or size of a child is changed.
      defaultButton:String  
ID of the button that is designated as the default button in the container.
      childDescriptors:Array   [Read-Only]
Array of UIObjectDescriptors produced by the MXML compiler.
      creationPolicy:String   [Read-Write]
Policy for creating this Container`s children.
      clipContent:Boolean   [Read-Write]
Whether to clip content if the child is larger that its parent container.
      hScrollPolicy:String   [Read-Write]
Whether the horizontal scroll bar is always on, always off, or automatically changes.
      vScrollPolicy:String   [Read-Write]
Whether the vertical scroll bar is always on, always off, or automatically changes.
      maxVPosition:Number   [Read-Only]
Maximum offset into the content from the top edge.
      maxHPosition:Number   [Read-Only]
Maximum offset into the content from the left edge.
      vLineScrollSize:Number   [Read-Write]
Number of pixels to move when the Up or Down Arrow button in the vertical scroll bar is pressed.
      hLineScrollSize:Number   [Read-Write]
Number of pixels to move when the Up or Down Arrow button in the horizontal scroll bar is pressed.
      vPageScrollSize:Number   [Read-Write]
Number of pixels to move when the track in the vertical scroll bar is pressed.
      hPageScrollSize:Number   [Read-Write]
Number of pixels to move when the track in the horizontal scroll bar is pressed.
      hPosition:Number   [Read-Write]
Offset into the content from the left edge.
      vPosition:Number   [Read-Write]
Offset into the content from the top edge.

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
childrenCreatedBroadcast after a container creates its children. Target contains a reference to the component that triggered the event. Type contains the name of the event.
scrollBroadcast when the container is scrolled. The event object contains the following properties: - type Contains a string set to scroll.
- direction Contains the string vertical or horizontal, depending on the scroll direction.
- delta Change in position. - position New position. Target contains a reference to the component that triggered the event. Type contains the name of the event.

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

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

Constructor

Constructor() :  Void

Constructor.


getViewMetrics

getViewMetrics() : Object

Thickness of the edges of the object, including the border and scroll bars, if visible.

Returns
     Object with left, right, top, and bottom edge thickness in pixels.


Property Detail

autoLayout

autoLayout:Boolean   [Read-Write]

If true, measurement and layout are done whenever the position or size of a child is changed. If false, measurement and layout are done only once, when children are added to or removed from the container. The default value is true.


childDescriptors

childDescriptors:Array   [Read-Only]

Array of UIObjectDescriptors produced by the MXML compiler. Each UIObjectDescriptor contains the information specified in one child MXML tag of the container`s MXML tag. The order of the UIObjectDescriptors in the array is the same as the order of the child tags. Use childDescriptors to create the container`s child UIObjects and its Repeaters, and to give them the appropriate property values, event handlers, and so on, that were specified in MXML.


className

className:String  

Name of the class.


clipContent

clipContent:Boolean   [Read-Write]

Whether to clip content if the child is larger that its parent container. If false, configures a parent to let the child extend past its boundaries. The default value is true.


creationPolicy

creationPolicy:String   [Read-Write]

Policy for creating this Container`s children. Values can be auto, all, or none. If no creationPolicy is specified for a container, that container inherits its parent`s creationPolicy. If no creationPolicy is specified for the Application, it defaults to auto.

A creationPolicy of auto means that the container is to delay creating descendants until they are needed, which is deferred instantiation. This policy produces the best startup time because fewer UIObjects are created initially. However, this introduces navigation delays when a user navigates to other parts of the application for the first time. Navigator containers such as Accordion, TabNavigator, and ViewStack implement the auto policy by creating all their children immediately, but wait to create the deeper descendants of a child until it becomes the selectedChild of the navigator container.

A creationPolicy of all means that the navigator containers immediately create deeper descendants for each child, rather than waiting until that child become selected.

For single-view containers such as VBox, there is no difference betweeen the auto and all policies.

A creationPolicy of none means that the container creates none of its children. It is the responsibility of the MXML author to create the children by calling the createComponent method.


defaultButton

defaultButton:String  

ID of the button that is designated as the default button in the container. When controls in the container have focus, pressing Enter is the same as clicking this button.


hLineScrollSize

hLineScrollSize:Number   [Read-Write]

Number of pixels to move when the Up or Down Arrow button in the horizontal scroll bar is pressed. The default value is 1.


hPageScrollSize

hPageScrollSize:Number   [Read-Write]

Number of pixels to move when the track in the horizontal scroll bar is pressed. The default value is 5.


hPosition

hPosition:Number   [Read-Write]

Offset into the content from the left edge. The default value is 0.


hScrollPolicy

hScrollPolicy:String   [Read-Write]

Whether the horizontal scroll bar is always on, always off, or automatically changes. The default value is auto.


icon

icon:String   [Read-Write]

URL to an image file for an icon. Image types include JPEG, GIF, PNG, SVG image, and SWF file. Use this property with a container referenced by a LinkBar, TabBar, or TabNavigator container. The icon appears in the tab of the TabBar or TabNavigator, or in the link of the LinkBar that corresponds to the container. The container scales the image to fit the tab size of a TabBar or TabNavigator container, or the link size of the LinkBar container. Use the format icon=`@Embed(`relOrAbsoluteURL;)" with this property.


maxHPosition

maxHPosition:Number   [Read-Only]

Maximum offset into the content from the left edge.


maxVPosition

maxVPosition:Number   [Read-Only]

Maximum offset into the content from the top edge.


numRepeaters

numRepeaters:Number   [Read-Only]

Number of Repeaters in this Container.


version

static version:String  

ComponentVersion is for internal use only.


vLineScrollSize

vLineScrollSize:Number   [Read-Write]

Number of pixels to move when the Up or Down Arrow button in the vertical scroll bar is pressed. The default is 1.


vPageScrollSize

vPageScrollSize:Number   [Read-Write]

Number of pixels to move when the track in the vertical scroll bar is pressed. The default value is 5.


vPosition

vPosition:Number   [Read-Write]

Offset into the content from the top edge. The default value is 0.


vScrollPolicy

vScrollPolicy:String   [Read-Write]

Whether the vertical scroll bar is always on, always off, or automatically changes. The default value is auto.