ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
mx.events 

IndexChangedEvent  - AS3 Flex

Packagemx.events
Classpublic class IndexChangedEvent
InheritanceIndexChangedEvent Inheritance Event Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The IndexChangedEvent class represents events that are dispatched when an index changes. This event can indicate that the index value of a child of a container changed, the displayed child of a navigator container such as an Accordion or ViewStack changed, or the order of column headers in a DataGrid control changed.

More examples

Learn more

Related API Elements



Public Properties
 PropertyDefined By
 Inheritedbubbles : Boolean
[read-only] Indicates whether an event is a bubbling event.
Event
 Inheritedcancelable : Boolean
[read-only] Indicates whether the behavior associated with the event can be prevented.
Event
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheritedcurrentTarget : Object
[read-only] The object that is actively processing the Event object with an event listener.
Event
 InheritedeventPhase : uint
[read-only] The current phase in the event flow.
Event
  newIndex : Number
The zero-based index after the change.
IndexChangedEvent
  oldIndex : Number
The zero-based index before the change.
IndexChangedEvent
  relatedObject : DisplayObject
The child object whose index changed, or the object associated with the new index.
IndexChangedEvent
 Inheritedtarget : Object
[read-only] The event target.
Event
  triggerEvent : Event
The event that triggered this event.
IndexChangedEvent
 Inheritedtype : String
[read-only] The type of event.
Event
Public Methods
 MethodDefined By
  
IndexChangedEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, relatedObject:DisplayObject = null, oldIndex:Number = -1, newIndex:Number = -1, triggerEvent:Event = null)
Constructor.
IndexChangedEvent
 Inherited
Duplicates an instance of an Event subclass.
Event
 Inherited
formatToString(className:String, ... arguments):String
A utility function for implementing the toString() method in custom ActionScript 3.0 Event classes.
Event
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Checks whether the preventDefault() method has been called on the event.
Event
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Cancels an event's default behavior if that behavior can be canceled.
Event
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.
Event
 Inherited
Prevents processing of any event listeners in nodes subsequent to the current node in the event flow.
Event
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns a string containing all the properties of the Event object.
Event
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined By
  CHANGE : String = "change"
[static] The IndexChangedEvent.CHANGE constant defines the value of the type property of the event object for a change event, which indicates that an index has changed, such as when and Accordion control changes the displayed panel or a ViewStack changes views.
IndexChangedEvent
  CHILD_INDEX_CHANGE : String = "childIndexChange"
[static] The IndexChangedEvent.CHILD_INDEX_CHANGE constant defines the value of the type property of the event object for a childIndexChange event, which indicates that a component's index among a container's children has changed.
IndexChangedEvent
  HEADER_SHIFT : String = "headerShift"
[static] The IndexChangedEvent.HEADER_SHIFT constant defines the value of the type property of the event object for a headerShift event, which indicates that a header has changed its index, as when a user drags a DataGrid column to a new position.
IndexChangedEvent
Property Detail

newIndex

property
public var newIndex:Number

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The zero-based index after the change. For change events it is the index of the current child. For childIndexChange events, it is the new index of the child. For headerShift events, it is the new index of the header.

oldIndex

property 
public var oldIndex:Number

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The zero-based index before the change. For change events it is the index of the previous child. For childIndexChange events, it is the previous index of the child. For headerShift events, it is the previous index of the header.

relatedObject

property 
public var relatedObject:DisplayObject

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The child object whose index changed, or the object associated with the new index. This property is not set for header changes.

triggerEvent

property 
public var triggerEvent:Event

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The event that triggered this event. Indicates whether this event was caused by a mouse or keyboard interaction. The value is null when a container dispatches a childIndexChanged event.

Constructor Detail

IndexChangedEvent

()Constructor
public function IndexChangedEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, relatedObject:DisplayObject = null, oldIndex:Number = -1, newIndex:Number = -1, triggerEvent:Event = null)

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Constructor. Normally called by a Flex control and not used in application code.

Parameters
type:String — The event type; indicates the action that caused the event.
 
bubbles:Boolean (default = false) — Specifies whether the event can bubble up the display list hierarchy.
 
cancelable:Boolean (default = false) — Specifies whether the behavior associated with the event can be prevented.
 
relatedObject:DisplayObject (default = null) — The child object associated with the index change.
 
oldIndex:Number (default = -1) — The zero-based index before the change.
 
newIndex:Number (default = -1) — The zero-based index after the change.
 
triggerEvent:Event (default = null) — The event that triggered this event.
Constant Detail

CHANGE

Constant
public static const CHANGE:String = "change"

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The IndexChangedEvent.CHANGE constant defines the value of the type property of the event object for a change event, which indicates that an index has changed, such as when and Accordion control changes the displayed panel or a ViewStack changes views.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
inputTypeIndicates whether this event was caused by a mouse or keyboard interaction.
newIndexThe zero-based index after the change.
oldIndexThe zero-based index before the change.
relatedObjectContains a reference to the child object that corresponds to the new index.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
TriggerEventThe event that triggered this event.
TypeIndexChangedEvent.CHANGE

CHILD_INDEX_CHANGE

Constant 
public static const CHILD_INDEX_CHANGE:String = "childIndexChange"

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The IndexChangedEvent.CHILD_INDEX_CHANGE constant defines the value of the type property of the event object for a childIndexChange event, which indicates that a component's index among a container's children has changed.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
inputTypeIndicates whether this event was caused by a mouse or keyboard interaction.
newIndexThe zero-based index of the child after the change.
oldIndexThe zero-based index of the child before the change.
relatedObjectContains a reference to the child object whose index changed.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
TriggerEventnull
TypeIndexChangedEvent.CHILD_INDEX_CHANGE

HEADER_SHIFT

Constant 
public static const HEADER_SHIFT:String = "headerShift"

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The IndexChangedEvent.HEADER_SHIFT constant defines the value of the type property of the event object for a headerShift event, which indicates that a header has changed its index, as when a user drags a DataGrid column to a new position.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
inputTypeIndicates whether this event was caused by a mouse or keyboard interaction.
newIndexThe zero-based index of the header after the change.
oldIndexThe zero-based index of the header before the change.
relatedObjectnull
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
TriggerEventThe event that triggered this event.
TypeIndexChangedEvent.HEADER_SHIFT