Skip navigation
Currently Being Moderated

Load a component from Flex sub-application

May 14, 2012 3:23 AM

Tags: #problem #flash #flash_builder #as3 #4.5 #actionscript #flex4 #flex4.5 #4.6

Situation: I load flex sub-application into the main application through the default SWFLoader. The sub-application is loaded into the separate ApplicationDomain and SWFLoader's trustContent is set to false.


Question: Is it possible to get a child component (element) from the sub-application and add it to the main application? If it is possible, how would I do this? If not please post the ideas or alternative ways.


Thanks in advance.

  • Currently Being Moderated
    May 14, 2012 9:04 AM   in reply to EricKhrypko

    If you are loading into a sibling ApplicationDomain then no, you can’t directly parent Flex components from the sub-app in the main app.  The SWFLoader should be able to show the components as children of the SWFLoader.

    Mark as:
  • Currently Being Moderated
    May 14, 2012 1:45 PM   in reply to EricKhrypko

    We might need more info about the scenario.  If you are using a Marshall Plan config, for example, the sub-app can put up a popup dialog over the main app.


    The key principles are that for a Flex app, a UIComponent must be parented by another UIComponent, and a Flex container’s children must implement IUIComponent.  When you have sibling ApplicationDomains, it is essentially impossible to fulfill those requirements.  Since a UIComponent’s children can be any sort of display object, then I suppose you could create custom wrappers for the sub-apps UIComponents, but the first principle would still be broken and while you might be able to hack around that, lots of other things like styles, invalidation/validation timing and focus might be broken.

    Mark as:
  • Currently Being Moderated
    May 14, 2012 10:10 PM   in reply to EricKhrypko

    You said you are loading into a sibling ApplicationDomain.  Why do you need to do that?  If you load as a child ApplicationDomain it should work.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points