views:

32

answers:

1

My itemrenderer has 2 custom states, no hovered state, and no normal state

<s:states>
    <s:State name="state1" />
    <s:State name="state2" />
</s:states>

When I initialize it, I force it to go to state2. The problem is that when the mouse rolls out away from the item, it relapses back to the first state state1. It's kind of weird since I don't really have a hovered/unhover state. Anyone knows how to prevent this from happening? maybe by somehow disabling the rollout effect?

A: 

I'd look into doing something with the mouse events, such as MouseOver

http://docs.huihoo.com/flex/4/flash/display/InteractiveObject.html#event:mouseOver

However, I'm pretty sure that when you use something as an itemRenderer, the list class can exert some control over the itemRenderer. It is entirely possible the List class is causing the behaviour you see. What class are you using? What is your renderer?

www.Flextras.com
It's an itemrenderer in a list. After careful observation, it seems it resets when it's rolled out from. Is there a way I can reset the built-in rollout effect to not do anything.
duder
I'm not sure what you mean by "reset" . You probably want to look at the styles selectionColor and rollOverColor. http://docs.huihoo.com/flex/4/spark/components/List.html#styleSummary
www.Flextras.com