Flex Accordion导航收缩

package components.common
{
import flash.events.MouseEvent;

import mx.containers.Accordion;
import mx.containers.accordionClasses.AccordionHeader;

public class MyAccordionHeader extends AccordionHeader
{
public function MyAccordionHeader()
{
super();
this.addEventListener(MouseEvent.CLICK,func);
}
private function func(e:MouseEvent):void{
(this.parent as Accordion).selectedIndex = (this.parent as Accordion).getChildren().length -1;
}

}
}
在<Accordion></Accordion>中添加headerRenderer="components.common.MyAccordionHeader"即可实现Accordion导航收缩功能。

你可能感兴趣的:(Flex,Flash)