Accordion container, IndexChangedEvent : Accordion « Components « Flex






Accordion container, IndexChangedEvent

Accordion container, IndexChangedEvent
      
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="300"
    height="280">
    <mx:Script>
        
            import mx.events.IndexChangedEvent;
            import mx.controls.Alert;
            private function handleChange(event:IndexChangedEvent):void {
                var currentIndex:int=event.newIndex;
            }
          
    </mx:Script>
    <mx:Accordion id="myAcc" height="60" width="200" change="handleChange(event);">
        <mx:HBox label="Box 1">
            <mx:Label text="A" />
        </mx:HBox>
        <mx:HBox label="Box 2">
            <mx:Label text="B" />
        </mx:HBox>
    </mx:Accordion>
</mx:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.Creating an accordion navigatorCreating an accordion navigator
2.Register an event listener in MXML for Accordion change eventRegister an event listener in MXML for Accordion change event
3.Define an event listener for Accordion initialize eventDefine an event listener for Accordion initialize event
4.Creating and removing children of an Accordion containerCreating and removing children of an Accordion container
5.Put Form inside an Accordion container
6.Creating an Accordion containerCreating an Accordion container
7.Open last panel in the Accordion containerOpen last panel in the Accordion container
8.Set a different text color for each Accordion buttonsSet a different text color for each Accordion buttons
9.Register an event listener in MXML that is processed when you change views in an Accordion container.Register an event listener in MXML that is processed when you change views in an Accordion container.
10.History management is Enabled for this AccordionHistory management is Enabled for this Accordion
11.History management is disabled for this AccordionHistory management is disabled for this Accordion
12.Define an event listener for the initialize event, which is dispatched when the user first navigates to Pane 2 of an MX Accordion navigator containerDefine an event listener for the initialize event, which is dispatched when the user first navigates to Pane 2 of an MX Accordion navigator container
13.Using the Spark NavigatorContent container as a child of an Accordion containerUsing the Spark NavigatorContent container as a child of an Accordion container
14.Accordion Button NavigationAccordion Button Navigation
15.Set a different text color for each of the Accordion buttonsSet a different text color for each of the Accordion buttons
16.Set Accordion creationPolicy to all, which instructs the container to instantiate all controls for every panel in the navigator container when the application startsSet Accordion creationPolicy to all, which instructs the container to instantiate all controls for every panel in the navigator container when the application starts
17.Accordion is opened to the panel corresponding to the value of the index fragmentAccordion is opened to the panel corresponding to the value of the index fragment
18.Use selectedChild propertyUse selectedChild property