Monthly Archives: August, 2008

The Magic of the Marshall Plan

For the past few months, I’ve been testing a feature for the next release of Flex (not Gumbo, but sooner than that) called the “Marshall Plan”. This feature will allow cross versioning and cross domain applications to be loaded into a parent application using a SWFLoader.

First, let’s talk about cross-versioning. In the future, if you were to have a parent application compiled in Flex 3 load a Flex 2 application using a SWFLoader, you will likely get some unexpected errors. If Flex 3 had changed anything in some of the shared managers like the DragManager, SystemManager, PopUpManager, FocusManager etc, then, your Flex 2 application may not know how to react. Before the Marshall Plan, loaded applications always shared all of these managers, so, you would often get errors because of changes made to these managers in newer versions. With the Marshall Plan feature, we have added a new boolean property to the SWFLoader component, currently called “loadForCompatibility”. When this property is set to TRUE, the SWFLoader will load your child application into its own Application domain. In this Application domain, the child application will have its own version of the managers. Therefore, if you had a parent application compiled in Flex 4 and a child compiled in Flex 3.x (which includes the Marshall Plan), the child application will have its own 3.x DragManager, 3.x PopUpManager etc. while the Flex 4 parent has the 4 DragManager and so on.

In this “compatible” scenario, the Marshall Plan has created the communication between the managers in the parent and child, so, the application should run seamlessly.

In the past, cross domain loading of Flex applications in a SWFLoader were not allowed. You got a runtime error. With the Marshall Plan, you are now allowed to do it. When the child swf is from a different domain, it is considered “untrusted” and is therefore forced to comply to some rules. These boundaries include limiting access to various events like keyboard or mouse information from the parent or being able to drag items or pop ups outside of the SWFLoader boundaries.

I’ve only given a short overview of this new feature, but, you can find a ton of details on how it will work on Adobe’s open source site: http://opensource.adobe.com/wiki/display/flexsdk/Marshall+Plan

Alex Harui who is one of two developers on the Marshall Plan has some information on his blog, but, he is also giving a very detailed talk at Flex 360 this coming week. Alex’s talk is at the unfortunate time of 8:30 AM on Tuesday, but, this is one of those rare opportunities for Flex developers to get access to Alex who can pretty much answer any framework question you decide to throw at him.