Tag Archives: getHeaderAt()

Adding icons to a Flex Accordion control (redux)

In a previous example, “Adding icons to a Flex Accordion control”, we saw how you could add embedded icons to a Flex Accordion container by setting the icon style.

The following example shows how you can set a separate icon on an Accordion header when the header is selected by looping over each header using the getHeaderAt() method and setting the selectedUpIcon, selectedOverIcon, and selectedDownIcon styles.

Full code after the jump.

Continue reading Adding icons to a Flex Accordion control (redux)

Setting styles on individual Flex Accordion headers

Loyal reader, Madhu, asked the following question the other day:

Is it possible to color individual headers of the accordion?

Well, I played around with it briefly this evening and it seems that you can get individual accordion headings using the Accordion class’s getHeaderAt() method, then it is just a matter of saving that reference in a variable, or applying a style directly to the returned Button reference.

The example itself is pretty simple, but I’m sure the same principles apply to other styles as well.

Full code after the jump.

Continue reading Setting styles on individual Flex Accordion headers