0

I have a top application (which is built using the 4.6 SDK) that loads a sub-application (which is built using the 4.1 SDK). Most of the content, in this state of the app, is contained by the sub-app, with some UI elements up in the top app forming a frame (or "HUD") around the sub-app's contents.

At a point where there is no text input field to receive focus, pressing tab will cause Flash Player to crash horribly, with an Error #1023: Stack overflow occurred.

Here is an example stack trace:

Error: Error #1023: Stack overflow occurred.
at mx.managers.systemClasses::MarshallingSupport/get swfBridgeGroup()
at mx.managers.systemClasses::MarshallingSupport/getSWFBridgeOfDisplayObject()
at mx.managers.systemClasses::MarshallingSupport/isDisplayObjectInABridgedApplication()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/keyDownHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers::FocusManager/http://www.adobe.com/2006/flex/mx/internal::keyDownHandler()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/moveFocus()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/focusRequestMoveHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/moveFocusToParent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/focusRequestMoveHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/setFocusToComponentHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers::FocusManager/setFocusToComponent()
at mx.managers::FocusManager/setFocusToNextObject()
at mx.managers::FocusManager/http://www.adobe.com/2006/flex/mx/internal::keyFocusChangeHandler()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/moveFocus()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/focusRequestMoveHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/moveFocusToParent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/focusRequestMoveHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/setFocusToComponentHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers::FocusManager/setFocusToComponent()
at mx.managers::FocusManager/setFocusToNextObject()
at mx.managers::FocusManager/http://www.adobe.com/2006/flex/mx/internal::keyFocusChangeHandler()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/moveFocus()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/focusRequestMoveHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/moveFocusToParent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/focusRequestMoveHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/setFocusToComponentHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers::FocusManager/setFocusToComponent()
at mx.managers::FocusManager/setFocusToNextObject()
at mx.managers::FocusManager/http://www.adobe.com/2006/flex/mx/internal::keyFocusChangeHandler()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/moveFocus()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/focusRequestMoveHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/moveFocusToParent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/focusRequestMoveHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/setFocusToComponentHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.managers::FocusManager/setFocusToComponent()
at mx.managers::FocusManager/setFocusToNextObject()
at mx.managers::FocusManager/http://www.adobe.com/2006/flex/mx/internal::keyFocusChangeHandler()
at mx.managers.marshalClasses::FocusManagerMarshalMixin/moveFocus()

According to Adobe's guide for "Developing sandboxed applications", the FocusManager is just supposed to work, even across sandboxed, multi-versioned apps.

Anyone ever seen this? Any idea what I could be missing?

Noteworthy:

  • The sub-app is being loaded into a SWFLoader, which is set to use a separate ApplicationDomain
  • I don't need to support tabbing at all in the top-level application, but tabbing must work when there are editable text fields up in the sub-app. And it works fine when there are text fields there to tab to.

Any and all suggestions are welcome. Thank you!

  • From your description and stack trace, it sounds like it's trying (really hard) to find a place to set the focus when you press tab. Hard to say why it happens unless you step through the code in the debugger. There might be some hack to work around it, but that all depends on what you see in the debugger. Things that come to mind: play with the keyboard focus related properties (`tabEnabled`, `tabChildren`, etc), `FocusEvent`'s, and `KeyboardEvent`'s. – Sunil D. Dec 18 '12 at 07:51

1 Answers1

0

First of all, it seems that your stack trace does not contain default 1000 lines set in application's scriptRecursionLimit="1000". I don't know if your code limits is somehow or sandbox can limit this by default in more strict way. As I see, some lines are not repeadted, so it may mean that default behavior is correct, but can't be finished because of some limitations.

Second, you can use some workaround if you can't find good way to fix it:

try{
    dispatchTabPressEventThatCausesProblems();
}catch(e:Error){
    stage.focus = null;
}
user1875642
  • 1,303
  • 9
  • 18