How to keep flash from focussing on child object, which messes up tabindex
I have a button with a tabIndex. The button contains a textfield. When I click on the edge o开发者_运维问答f the button and hit tab, the next item is correctly focussed. But when I click on the textfield (non-editable,not tab-enabled, no tabindex), and then hit tab, it focusses on the first object on the page, even though the parents focusIn function is triggered, in which I'm setting the focus to the parent object:
parentObject:
addEventListener(FocusEvent.FOCUS_IN, focusIn);
private function focusIn(e:FocusEvent):void
{
//shows the child object (a textfield) has the focus
FlashConnect.trace(Main.instance.stage.focus);
//causes this focusIn function to be called again, but only once again, since then the focus does not change anymore
Main.instance.stage.focus = this;
//shows THIS parent object now has the focus
FlashConnect.trace(Main.instance.stage.focus);
//shows the correct tabIndex, which makes me expect the next item should be selected when I hit tab right?
FlashConnect.trace(Main.instance.stage.focus.tabIndex);
}
Any ideas how to solve this?
Have you tried setting mouseEnabled, mouseChildren, and tabChildren? Also, I have to point out that a Singleton View is even more bad practice than other Singletons. You're likely to really regret this architectural choice long term.
精彩评论