Package | flexlib.baseClasses |
Class | public class AccordionBase |
Inheritance | AccordionBase ![]() |
Implements | mx.managers.IFocusManagerComponent, mx.managers.IHistoryManagerClient |
Subclasses | HAccordion, VAccordion |
The only modifications made to this class were to change some properties and methods from private to protected so we can override them in a subclass.
An Accordion navigator container has a collection of child containers, but only one of them at a time is visible. It creates and manages navigator buttons (accordion headers), which you use to navigate between the children. There is one navigator button associated with each child container, and each navigator button belongs to the Accordion container, not to the child. When the user clicks a navigator button, the associated child container is displayed. The transition to the new child uses an animation to make it clear to the user that one child is disappearing and a different one is appearing.
The Accordion container does not extend the ViewStack container,
but it implements all the properties, methods, styles, and events
of the ViewStack container, such as selectedIndex
and selectedChild
.
The <mx:Accordion>
tag inherits all of the
tag attributes of its superclass, with the exception of scrolling-related
attributes, and adds the following tag attributes:
<mx:Accordion Properties headerRenderer="IFactory" historyManagementEnabled="true|false" resizeToContent="false|true" selectedIndex="undefined" Styles fillAlphas="[0.60, 0.40, 0.75, 0.65]" fillColors="[0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE]" focusAlpha="0.5" focusRoundedCorners="tl tr bl br" headerHeight="depends on header font styles" headerStyleName="No default" horizontalGap="8" openDuration="250" openEasingFunction="undefined" paddingBottom="-1" paddingTop="-1" selectedFillColors="undefined" textRollOverColor="0xB333C" textSelectedColor="0xB333C" verticalGap="-1" Events change="No default" > ... child tags ... </mx:Accordion>
See also
Property | Defined by | ||
---|---|---|---|
headerRenderer : IFactory
A factory used to create the navigation buttons for each child.
| AccordionBase | ||
historyManagementEnabled : Boolean
If set to
true , this property enables history management
within this Accordion container. | AccordionBase | ||
resizeToContent : Boolean
If set to
true , this Accordion automatically resizes to
the size of its current child. | AccordionBase | ||
selectedChild : Container
A reference to the currently visible child container.
| AccordionBase | ||
selectedIndex : int
The zero-based index of the currently visible child container.
| AccordionBase |
Property | Defined by | ||
---|---|---|---|
accMinHeight : Number | AccordionBase | ||
accPreferredHeight : Number | AccordionBase | ||
accPreferredWidth : Number | AccordionBase | ||
contentHeight : Number [read-only]
The height of the area, in pixels, in which content is displayed.
| AccordionBase | ||
contentWidth : Number [read-only]
The width of the area, in pixels, in which content is displayed.
| AccordionBase | ||
tween : Tween | AccordionBase | ||
tweenContentHeight : Number | AccordionBase | ||
tweenContentWidth : Number | AccordionBase | ||
tweenNewSelectedIndex : int | AccordionBase | ||
tweenOldSelectedIndex : int | AccordionBase |
Method | Defined by | ||
---|---|---|---|
Constructor.
| AccordionBase | ||
getHeaderAt(index:int):Button
Returns a reference to the navigator button for a child container.
| AccordionBase | ||
loadState(state:Object):void
| AccordionBase | ||
saveState():Object
| AccordionBase |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched when the selected child container changes. | AccordionBase |
accMinHeight | property |
protected var accMinHeight:Number
accPreferredHeight | property |
protected var accPreferredHeight:Number
accPreferredWidth | property |
protected var accPreferredWidth:Number
contentHeight | property |
contentHeight:Number
[read-only]The height of the area, in pixels, in which content is displayed. You can override this getter if your content does not occupy the entire area of the container.
Implementation protected function get contentHeight():Number
contentWidth | property |
contentWidth:Number
[read-only]The width of the area, in pixels, in which content is displayed. You can override this getter if your content does not occupy the entire area of the container.
Implementation protected function get contentWidth():Number
headerRenderer | property |
headerRenderer:IFactory
[read-write]
A factory used to create the navigation buttons for each child.
The default value is a factory which creates a
mx.containers.accordionClasses.AccordionHeader
. The
created object must be a subclass of Button and implement the
mx.core.IDataRenderer
interface. The data
property is set to the content associated with the header.
This property can be used as the source for data binding.
Implementation public function get headerRenderer():IFactory
public function set headerRenderer(value:IFactory):void
See also
historyManagementEnabled | property |
historyManagementEnabled:Boolean
[read-write]
If set to true
, this property enables history management
within this Accordion container.
As the user navigates from one child to another,
the browser remembers which children were visited.
The user can then click the browser's Back and Forward buttons
to move through this navigation history.
The default value is true
.
public function get historyManagementEnabled():Boolean
public function set historyManagementEnabled(value:Boolean):void
See also
resizeToContent | property |
resizeToContent:Boolean
[read-write]
If set to true
, this Accordion automatically resizes to
the size of its current child.
The default value is false
.
public function get resizeToContent():Boolean
public function set resizeToContent(value:Boolean):void
selectedChild | property |
selectedChild:Container
[read-write]
A reference to the currently visible child container.
The default value is a reference to the first child.
If there are no children, this property is null
.
Note: You can only set this property in an ActionScript statement, not in MXML.
This property can be used as the source for data binding.
Implementation public function get selectedChild():Container
public function set selectedChild(value:Container):void
selectedIndex | property |
selectedIndex:int
[read-write]
The zero-based index of the currently visible child container.
Child indexes are in the range 0, 1, 2, ... , n - 1, where n is the number
of children.
The default value is 0, corresponding to the first child.
If there are no children, this property is -1
.
The default value is 0
.
This property can be used as the source for data binding.
Implementation public function get selectedIndex():int
public function set selectedIndex(value:int):void
tween | property |
protected var tween:Tween
tweenContentHeight | property |
protected var tweenContentHeight:Number
tweenContentWidth | property |
protected var tweenContentWidth:Number
tweenNewSelectedIndex | property |
protected var tweenNewSelectedIndex:int
tweenOldSelectedIndex | property |
protected var tweenOldSelectedIndex:int
AccordionBase | () | constructor |
public function AccordionBase()
Constructor.
getHeaderAt | () | method |
public function getHeaderAt(index:int):Button
Returns a reference to the navigator button for a child container.
Parametersindex:int — Zero-based index of the child.
|
Button — Button object representing the navigator button.
|
loadState | () | method |
public function loadState(state:Object):void
Parameters
state:Object |
saveState | () | method |
public function saveState():Object
Returns
Object |
change | event |
mx.events.IndexChangedEvent
Dispatched when the selected child container changes.