You will have to create a custom header renderer, add a button to it and position it manually. Try something like this:
<mx:Accordion>
<mx:headerRenderer>
<mx:Component>
<AccordionHeader xmlns="mx.containers.accordionClasses.*">
<mx:Script>
<![CDATA[
import mx.controls.Button;
private var extraButton : Button;
override protected function createChildren( ) : void {
super.createChildren();
if ( extraButton == null ) {
extraButton = new Button();
addChild(extraButton);
}
}
override protected function updateDisplayList( unscaledWidth : Number, unscaledHeight : Number ) : void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
extraButton.setActualSize(unscaledHeight - 6, unscaledHeight - 6);
extraButton.move(unscaledWidth - extraButton.width - 3, (unscaledHeight - extraButton.height)/2);
}
]]>
</mx:Script>
</AccordionHeader>
</mx:Component>
</mx:headerRenderer>
<mx:HBox label="1"><Label text="Text 1"/></HBox>
<mx:HBox label="1"><Label text="Text 2"/></HBox>
<mx:HBox label="1"><Label text="Text 3"/></HBox>
</mx:Accordion>
Theo
2008-08-15 14:00:53