Search code examples
apache-flexflex4.5tabnavigator

Flex 4.5 TabNavigator KeyDownHandler error on focusChange


I have 2 states in my application, state-A and state-B and in them I have state-A -> tabNavigator ; state-B->something else (no tab navigator).

When my application starts, first state is see would be state-A. When I choose to open state-B and when I use Alt+Tab (ie. move out of my browser and tab to another application on the whole), my flex application from the browser throws an error saying

"TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.containers::TabNavigator/keyDownHandler()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\containers\TabNavigator.as:895]"

Can anyone please tell me a solutions to this.

Thank you in advance


Solution

  • I'm not sure if this is the right way to do it, but I at least have a fix for now.

    myTabNavigator.stage.focus = null;

    I use the above when even I navigate away from the state which has a tabnavigator