I've got a listener for KeyboardEvent.KEY_DOWN registered in my application. I'm used to needing to click the app in order for it to get keyboard focus the first time - but this is happening [i]every time[/i] I switch states.
I made some minimal code that demonstrates the problem and put it up at http://pastebin.com/4bE7Z8gc
If you run this, you'll see a button that says 'press me for state two'. If you click anywhere else in the app and hit keys, you'll see the events fire. Press the button to change states, however, and that all stops. You have to click elsewhere again in order to get it to register.
Is there any way around this?
the one thing in the demo that you give focus to disappears, so the whole application loses focus, if you replace both of your button codes with this, it works just fine, giving the same button focus the entire time.
<s:Button label.one="Go to state two" label.two="Go to state one" click.one="currentState='two'" click.two="currentState='one'"/>
Ah, thank you very much! I'll have to see if there's a way I can adapt my application to your example.