-1

So what i want to do is to change the style of an iconitemrenderer when the item is selected. i have tried checking the state of my item but it does not seem to worki.

<s:IconItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"  creationComplete="onStart()" stateChangeComplete="stateChangedHandler()"
                xmlns:s="library://ns.adobe.com/flex/spark"  labelField="name"  decorator="/assets/highres/customerArrow.png" iconFunction="getIcon" iconWidth="60" iconHeight="60" iconField="icon" labelFunction="getName" >

stateChangedHandler() has a trace in it which is never triggered. My final goal is to change the label from black color on normal state to white color on selected. Any ideas?

leokan
  • 662
  • 5
  • 22

1 Answers1

0

Try something like this (not tested):

<s:IconItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"  creationComplete="onStart()" stateChangeComplete="stateChangedHandler()"
                xmlns:s="library://ns.adobe.com/flex/spark"  labelField="name"  decorator="/assets/highres/customerArrow.png" iconFunction="getIcon" iconWidth="60" iconHeight="60" iconField="icon" color.normal="0x000000" color.selected="0xffffff" labelFunction="getName">
    <s:states>
        <s:State name="normal" />
        <s:State name="selected" />
    </s:states>
</s:IconItemRenderer>
Crabar
  • 1,829
  • 1
  • 14
  • 26
  • hi Crabar, thanks for your answer. unfortunately i already have tried this one and it does not work. it looks like the event for changing the state does not work. I am using flex 4.13 and im not sure if this is a bug or there is a different implementation method. – leokan Nov 12 '14 at 14:34