Highlighting the Accordion container’s currently selected header

by Peter deHaan on August 27, 2007

in Accordion

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.

{ 2 comments… read them below or add one }

1 Adam Adamczyk February 25, 2008 at 1:24 pm

Indeed in Flex 3 this example won’t work.

hereby updated example

.accHeader {
selectedFillColors: haloBlue, haloBlue;
}

Reply

2 BC January 17, 2010 at 11:59 pm

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

Reply

Leave a Comment

Sorry, this blog is terrible at eating HTML comments.
If you're pasting any HTML/XML/MXML code, you need to convert your < characters to &lt; and your > characters to &gt; .

You can 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

Previous post:

Next post: