The following example shows how you can set the Accordion container’s selectedFillColors style to highlight the currently selected header.

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/08/27/highlighting-the-accordion-containers-currently-selected-header/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Style>
        Accordion {
            selectedFillColors: haloBlue, haloBlue;
        }
    </mx:Style>

    <mx:Accordion width="400" height="120">
        <mx:VBox id="child1" label="Child 1" />
        <mx:VBox id="child2" label="Child 2" />
        <mx:VBox id="child3" label="Child 3" />
    </mx:Accordion>

</mx:Application>

View source is enabled in the following example.

The previous example was built using Flex 2.0.1 Hotfix 2. This style seems to be deprecated in Flex 3.

 
Tagged with:
 
About The Author

Peter deHaan

Peter deHaan currently works for Adobe on the Flex SDK QA team. While not working on Flex, Flash, and ColdFusion applications, Peter enjoys making up bios and writing in 3rd person. Peter's rarely updated blog can be found at blogs.adobe.com/pdehaan/, actionscriptexamples.com, airexamples.com, and coldfusionexamples.com.

2 Responses to Highlighting the Accordion container’s currently selected header

  1. Indeed in Flex 3 this example won’t work.

    hereby updated example

    .accHeader {
    selectedFillColors: haloBlue, haloBlue;
    }

  2. BC says:

    Thank you Adam Adamczyk,
    The accordion need call the stely name.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Anti-Spam Protection by WP-SpamFree