On 27/05/2010 07:34, Harbs wrote:
I'm trying to implement a tri-state checkbox. I found a previous
implementation which was way to complicated for my taste. I have the
implementation mostly done, but there's one issue which I'm having a
hard time with:
I created a Sprite which draws the mid-state indicator over the
checkbox icon. Moving the mouse over the checkbox or away from the
checkbox seem to move the checkbox icon on top of my Sprite. I was
able to handle the Mouse Overs by adding an additional MOUSE_OVER
event which moves the Sprite back up to the top of the stack. For some
reason this only works for MOUSE_OVER. I added a MOUSE_OUT event
listener as well, which did not do anything. The icon still appears
above the Sprite when the mouse moves away from the checkbox.
Any ideas why?
I don't see why you are having the problem, but suspect it may be due to
dynamically drawing components in response to mouseover/out, etc.
My approach would be to create a component that has as part of the
initialisation, all of the components for the visual state created. Then
I would show/hide these according to the three states of the component -
either by toggling visibility/changing alpha/changing state.
For components like this, I generally toggle the visibility according to
state (though I rarely use Flex states) except when I need a more
sophisticated transition between component states.
Paul
Thanks,
Harbs