mx.containers
Class Accordion



class Accordion
extends mx.containers.Container

The Accordion navigator container defines a sequence of child panels that contain containers. It displays the header of all the panels, but displays only one panel at a time. The Accordion container can greatly improve the look and navigation of a form.

MXML Syntax

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

 <mx:Accordion
headerHeight="22"
historyManagement="true|false"
marginTop="-1"
marginBottom="-1"
openDuration="250"
openEasing="Specifies the tweening function used by the animation; no default value."
selectedIndex=""
selectedChild=""
textSelectedColor="#005F33"
verticalGap="-1"
change="Specifies a change event handler; no default value.">
...
child tags
...
/>

See Also
mx.controls.SimpleButton
mx.controls.Button
mx.effects.Tween



Methods
      createChild(className, instanceName:String, props:Object) : MovieClip
Creates a child of the Accordion container.
      createSegment(classOrSymbol, instanceName:String, labelStr:String, iconStr:String) : MovieClip
Creates a new segment in the accordion.
      getHeaderAt(i:Number) : UIComponent
Returns the header object associated with the ith child.

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
staticversion:String  
ComponentVersion is for internal use only.
      historyManagement:Boolean   [Read-Write]
If true, enables history management.
      selectedChild:UIObject   [Read-Write]
Name of the active container.
      selectedIndex:Number   [Read-Write]
Index of the active 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
changeBroadcasts when the current view changes. The event object contains the following properties:
  • newValue contains the index of the child that is about to be selected.
  • prevValue contains the index of the child that was previously selected.
Target contains a reference to the component that triggered the event. Type contains the name of the event.

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
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 -1.
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 -1.
verticalGap Type: Number   Format: Length   CSS Inheritance: no
Number of pixels between children in the vertical direction. The default value is -1 pixels.
headerHeight Type: Number   Format: Length   CSS Inheritance: no
Height of the Accordion container buttons, in pixels. The default value is 22.
openDuration Type: Number   Format: Time   CSS Inheritance: no
Duration, in milliseconds, of the transition from one child panel to another. The default is 250.
textSelectedColor Type: Number   Format: Color   CSS Inheritance: yes
Color of selected text. The default is #005F33.
openEasing Type: String   CSS Inheritance: no
Tweening function used by the animation.

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

createChild

createChild(className, instanceName:String, props:Object) : MovieClip

Creates a child of the Accordion container.

Parameters
     className - Name of the class.
     instanceName - Instance name of the child.
     props - Object that contains initialization properties.


createSegment

createSegment(classOrSymbol, instanceName:String, labelStr:String, iconStr:String) : MovieClip

Creates a new segment in the accordion. This is a wrapper for the createChild method.

Parameters
     classOrSymbol - Reference to a class, the linkage ID or a symbol, or file path or URL to the external content.
Note: Specify the class name without using double quotation marks; do not specify the component as a String.
     instanceName - Instance name of the child.
     labelStr - Text to display in the segment header.
     iconStr - Icon to display in the segment header.


getHeaderAt

getHeaderAt(i:Number) : UIComponent

Returns the header object associated with the ith child.

Parameters
     i - Number that identifies the child.


Property Detail

historyManagement

historyManagement:Boolean   [Read-Write]

If true, enables history management.


selectedChild

selectedChild:UIObject   [Read-Write]

Name of the active container. The default is the identifier of the first child container defined in the Accordion container. You can only set this property in an ActionScript statement, not in MXML.


selectedIndex

selectedIndex:Number   [Read-Write]

Index of the active container. Indexes are in the range of 0, 1, 2, ... , n - 1, where n is the total number of child containers. The default is 0, corresponding to the first child container defined in the Accordion container.


version

static version:String  

ComponentVersion is for internal use only.