Accordion class

Inheritance MovieClip > UIObject class > UIComponent class > View > Accordion

ActionScript Class Name mx.containers.Accordion

An Accordion component contains children that are displayed one at a time. Each child has a corresponding header button that is created when the child is created. A child must be an instance of UIObject.

NOTE

 

The Accordion component is supported only if you are working in an ActionScript 2.0 document.

A movie clip symbol automatically becomes an instance of the UIObject class when it becomes a child of an accordion. However, to maintain tabbing order in an accordion's children, the children must also be instances of the View class. If you use a movie clip symbol as a child, set its Class field to mx.core.View so that it inherits from the View class.

Setting a property of the Accordion class with ActionScript overrides the parameter of the same name set in the Property inspector or Component inspector.

Each component class has a version property that is a class property. Class properties are available only on the class itself. The version property returns a string that indicates the version of the component. To access this property, use the following code:

trace(mx.containers.Accordion.version);

NOTE

 

The code trace(my_accInstance.version); returns undefined.

Method summary for the Accordion class

The following table lists methods of the Accordion class.

Method

Description

Accordion.createChild()

Creates a child for an Accordion instance.

Accordion.createSegment()

Creates a child for an Accordion instance. The parameters for this method are different from those of the createChild() method.

Accordion.destroyChildAt()

Destroys a child at a specified index position.

Accordion.getChildAt()

Gets a reference to a child at a specified index position.

Accordion.getHeaderAt()

Gets a reference to a header object at a specified index position.

Methods inherited from the UIObject class

The following table lists the methods the Accordion class inherits from the UIObject class. When calling these methods from the Accordion object, use the form accordionInstance.methodName.

Method

Description

UIObject.createClassObject()

Creates an object on the specified class.

UIObject.createObject()

Creates a subobject on an object.

UIObject.destroyObject()

Destroys a component instance.

UIObject.doLater()

Calls a function when parameters have been set in the Property and Component inspectors.

UIObject.getStyle()

Gets the style property from the style declaration or object.

UIObject.invalidate()

Marks the object so it is redrawn on the next frame interval.

UIObject.move()

Moves the object to the requested position.

UIObject.redraw()

Forces validation of the object so it is drawn in the current frame.

UIObject.setSize()

Resizes the object to the requested size.

UIObject.setSkin()

Sets a skin in the object.

UIObject.setStyle()

Sets the style property on the style declaration or object.

Methods inherited from UIComponent class

The following table lists the methods the Accordion class inherits from the UIComponent class. When calling these methods from the Accordion object, use the form accordionInstance.methodName.

Method

Description

UIComponent.getFocus()

Returns a reference to the object that has focus.

UIComponent.setFocus()

Sets focus to the component instance.

Property summary for the Accordion class

The following table lists properties of the Accordion class.

Property

Description

Accordion.numChildren

The number of children of an Accordion instance.

Accordion.selectedChild

A reference to the selected child.

Accordion.selectedIndex

The index position of the selected child.

Properties inherited from the UIObject class

The following table lists the properties the Accordion class inherits from the UIObject class. When accessing these properties, use the form accordionInstance.propertyName.

Property

Description

UIObject.bottom

Read-only; the position of the bottom edge of the object, relative to the bottom edge of its parent.

UIObject.height

Read-only; the height of the object, in pixels.

UIObject.left

Read-only; the left edge of the object, in pixels.

UIObject.right

Read-only; the position of the right edge of the object, relative to the right edge of its parent.

UIObject.scaleX

A number indicating the scaling factor in the x direction of the object, relative to its parent.

UIObject.scaleY

A number indicating the scaling factor in the y direction of the object, relative to its parent.

UIObject.top

Read-only; the position of the top edge of the object, relative to its parent.

UIObject.visible

A Boolean value indicating whether the object is visible (true) or not (false).

UIObject.width

Read-only; the width of the object, in pixels.

UIObject.x

Read-only; the left edge of the object, in pixels.

UIObject.y

Read-only; the top edge of the object, in pixels.

Properties inherited from the UIComponent class

The following table lists the properties the Accordion class inherits from the UIComponent class. When accessing these properties, use the form accordionInstance.propertyName.

Property

Description

UIComponent.enabled

Indicates whether the component can receive focus and input.

UIComponent.tabIndex

A number indicating the tabbing order for a component in a document.

Event summary for the Accordion class

The following table lists an event of the Accordion class.

Event

Description

Accordion.change

Broadcast to all registered listeners when the selectedIndex and selectedChild properties of an accordion change because of a user's mouse click or keypress.

Events inherited from the UIObject class

The following table lists the events the Accordion class inherits from the UIObject class.

Event

Description

UIObject.draw

Broadcast when an object is about to draw its graphics.

UIObject.hide

Broadcast when an object's state changes from visible to invisible.

UIObject.load

Broadcast when subobjects are being created.

UIObject.move

Broadcast when the object has moved.

UIObject.resize

Broadcast when an object has been resized.

UIObject.reveal

Broadcast when an object's state changes from invisible to visible.

UIObject.unload

Broadcast when the subobjects are being unloaded.

Events inherited from the UIComponent class

The following table lists the events the Accordion class inherits from the UIComponent class.

Event

Description

UIComponent.focusIn

Broadcast when an object receives focus.

UIComponent.focusOut

Broadcast when an object loses focus.

UIComponent.keyDown

Broadcast when a key is pressed.

UIComponent.keyUp

Broadcast when a key is released.


Flash CS3