<?XML version= "1.0" encoding= "Utf-8"?><!--examples of how Flex uses the Getheaderat () function and the Selectedupicon,selectedovericon and Selecteddownicon styles to set a split icon for the accordion head -<s:applicationname= "Accordion_getheaderat_selectedupicon_test"Xmlns:fx= "http://ns.adobe.com/mxml/2009"xmlns:s= "Library://ns.adobe.com/flex/spark"xmlns:mx= "Library://ns.adobe.com/flex/mx"MinWidth= "955"MinHeight= "All"> <Fx:script> <![cdata[import mx.events.FlexEvent; Import Mx.controls.Button; [Embed ("Assets/bullet_red.png")] Private Const redicon:class; [Embed ("Assets/bullet_orange.png")] Private Const orangeicon:class; [Embed ("Assets/bullet_yellow.png")] Private Const yellowicon:class; [Embed ("Assets/bullet_green.png")] Private Const greenicon:class; [Embed ("Assets/bullet_blue.png")] Private Const blueicon:class; [Embed ("Assets/bullet_star.png")] Private Const staricon:class; protected function Accordion_creationcompletehandler (event:flexevent): void {var idx:uint; var len:uint = Accordion.numchildren; var Btn:button; for (idx=0; idx<len; idx++) {btn = Accordion.getheaderat (idx); Btn.usehandcursor = true; Btn.buttonmode = true; Btn.setstyle ("Selectedupicon", Staricon); Btn.setstyle ("Selectedovericon", Staricon); Btn.setstyle ("Selecteddownicon", Staricon); } } ]]> </Fx:script> <fx:declarations> <!--Place non-visual elements (such as services, value objects) here - </fx:declarations> <mx:accordionID= "Accordion"openduration= "+"width= "100%"Height= "100%"Creationcomplete= "Accordion_creationcompletehandler (event)"> <Mx:vboxID= "Redvbox"label= "Red"icon= "{Redicon}" /> <Mx:vboxID= "Orangevbox"label= "Orange"icon= "{Orangeicon}" /> <Mx:vboxID= "Yellowvbox"label= "Yellow"icon= "{Yellowicon}" /> <Mx:vboxID= "Greenvbox"label= "Green"icon= "{Greenicon}" /> <Mx:vboxID= "Bluevbox"label= "Blue"icon= "{Blueicon}" /> </mx:accordion></s:application>
[Flex] Accordion Series-Header icon settings