User Guide
108 Chapter 6: Components Dictionary
Events inherited from the UIComponent class
The following table lists the events the Accordion class inherits from the UIComponent class.
Accordion.change
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
listenerObject = new Object();
listenerObject.change = function(eventObject){
// insert your code here
}
myAccordionInstance.addEventListener("change", listenerObject)
Description
Event; broadcast to all registered listeners when the selectedIndex and selectedChild
properties of an accordion change. This event is broadcast only when a user’s mouse click or
keypress changes the value of
selectedChild or selectedIndex—not when the value is
changed with ActionScript. This event is broadcast before the transition animation occurs.
Version 2 components use a dispatcher/listener event model. The Accordion component
dispatches a
change event when one of its buttons is clicked and the event is handled by a
function (also called a handler) on a listener object (
listenerObject) that you create. You call
the
addEventListener() method and pass it a reference to the handler as a parameter.
When the event is triggered, it automatically passes an event object (
eventObject) to the
handler. Each event object has properties that contain information about the event. You can use
these properties to write code that handles the event. For more information, see “EventDispatcher
class” on page 415.
The Accordion change event also contains two unique event object properties:
• newValue Number; the index of the child that is about to be selected.
• prevValue Number; the index of the child that was previously selected.
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.