tabEnabled
Quick demonstration of a weird bug in Flash that I just re-encountered. If you create a button and do not tabEnable it (myButton_mc.tabEnabled=true), it can become unresponsive for multiple clicks when you don’t move your mouse. Huh? Check out the swf. The two rectangles are buttons. Click them. Then select the combo box. Then, click the “not tab enabled” button multiple times without moving your mouse. Only the first click registers. This always seems to happen with components. And I just had it happen on a more complex swf without components. Setting the button to tabEnabled solves the problem.
Source.
Comments
10 Responses to “tabEnabled”
Leave a Reply
Seems to work for me, Doug. Firefox 1.5.0.4. Not sure what version of Flash player. (How do I check this?) WinXP.
Flash Player version – right click swf “About Flash Player {version}”
That is strange it works for you. I’ve tried on MIE, Firefox, Players 8 and 9 – and I still only get the initial click registering on the gray rect after choosing something in the combo. If you click the green rect after combo, then multiple gray rect clicks DO work.
Okay, now I see it. I must have been moving my mouse a bit.
Great solution! This “bug” had me puzzled for hours.. (I was certain it was probably a glitch in my script or some sort of timing problem).
After a bit of googling i found i’m not the only one.
So far I found that this problem only occurs when you use the built in combobox.
This solution doesn’t always work. Here’s a better one:
myButton.onRelease=function(){
do something....
Selection.setFocus(this);
};
Thanks for posting this! I’ve been searching for a solution to this for a while now and was beginning to think it was somehow just me. :)
I agree with Doug that the initial solution didn’t always work. BTW, to get rid of the yellow focus borders introduced by setFocus, use _focusrect = false
myButton.onRelease=function(){
do something….
this._focusrect = false;
Selection.setFocus(this);
};
Thanks for the extra info Travis,
I actually think the best solution would be
//don’t need to call the focusrect all the time
myButton._focusrect = false;
myButton.onRelease=function(){
//put the selection at the start of the function, in case the function is supposed to set focus elsewhere
Selection.setFocus(this);
do something….
};
Thanks guys — this thread helped me greatly!
More thanks! This has solved a problem bothering us for days.