Sunday, May 30, 2010

FocusManager getIndexOfNextObject in Flex Application

mx.managers::FocusManager/getIndexOfNextObject

Error means FocusManager is looking for mxml component to set focus, when hit tab from flash object and fun part you don't have any mxml component to set focus.

Here is the trick create mx.button component and setStyle to null. It will invisible and focus manager can find the component to focus. Now application won't crash or hung.

myButton.setStyle('skin', null);

(mx:Button skin='{null}' )

.myButtonStyle {
skin: ClassReference(null);
}

(mx:Button id="myButton" styleName='myButtonStyle')

Enjoy.

No comments: