I have a Flex component embedded inside a JSP with some other HTML components. The flex component is a TextInput, included in a Vbox. What I need is when the focus is on the TextInput, and if I press TAB key, the focus should be moved out of Flex, into JSP to the next HTML component.
myTextInput.stage.focus = null;
On IE (7.0.5730.13), if I comment out this code, focus is moved to next HTML component successfully, but a mouse cursor remains in that Flex TextInput, looks like it's ready to accept user input, even the focus is actually on next HTML component. However, to result of running this code is, the Flex control gained focus automatically after lost it. I added focusIn and focusOut event handler to the Vbox and proved its happening.
Firefox (3.0.13) behaves different from this. The TextInput can't get focus automatically, it seems like the I need to press Tab twice to move the focus from the HTML component in front of Flex conponent, (On IE, one key stroke is fine). And same problem as IE after.
Does any one have the same issue?
I guess Flex faces the similar problem as Java, as they declared, "Write once, run anywhere", is actually became, "Write once, debug, or maybe guess everywhere".
The Flash Player does have some per-platform differences, and this is one of them. The Flash Player for IE can transfer focus to the Browser and back, but it can't on other browsers. The framework has different code paths on IE than other browsers.
The focusManager.browserMode property can be overridden in code to get more consistent behavior from the framework.
Flex SDK Developer
Adobe Systems Inc.
Thanks for your reply, Alex.
Does this mean I need to write my own code to transfer focus between Flex and HTML component for browser, but don't need to anything for IE?