CLIK buttons don't always exit their Over state.
CLIK buttons have Up / Over / Down and Disabled states that react to mouse input without having to set roll-over listeners. It's great, except that in some recent SWFs I am getting a bug where CLIK buttons are not exiting their Over state after being clicked and rolled-off of. Clicking on other CLIK buttons does NOT make the "stuck" button go back to it's Up state. After a few random erroneous stuck buttons, I have a screen full of buttons that all stuck in their Over states.
Has anyone else experienced this? I'm trying to narrow down if I'm making a error somewhere in by button setup or code, or if there is a workflow for getting around this bug, like forcing all CLIK buttons to Up or something.
I experience this as well, but didn't bother about it, but is it possible that it has something to do with the toggle parameters set to false in the inspectable properties?
I'm not using a Toggle button, just a regular one... but you did get me checking flags. I actually may have "fixed" it by un-checking focusable, indicating that the bug probably has to do with the button not losing focus... like focus is given to a new button before the old button can have it's focus removed, leaving mutliple buttons in a focussed state? In any case, because my game uses mouse-input driven I can un-check focusable safely, but this would prove problematic if we ever did a console version, or supported controller-input.
Focused is a special state for all Flash display objects. This is not unique to Scaleform CLIK. Focused means that the button "has focus", in which case, it can display a unique graphic to show it has focus. Just because you move your mouse away form that object, doesn't mean it loses focus. However, if your button does not have a focused movie clip, it may default to the over state of your button. Not ensuring that one of your buttons has focus at the start of your menu may cause unwanted focus behavior (such as what you are experiencing).
To start with, try insuring that one of your buttons has focus set from the very beginning using:
ActionScript 2 Example:
ActionScript 3 Example:
myButton.focused = true;
myButton.focused = 1;
Last edited by Matt Doyle; 08-23-2012 at 01:17 PM.
Thanks Matt. That totally worked.