Marshall Plan At 360Flex Conference

Today I presented more information about the Marshall Plan at the 360Flex conference in San Jose. The PowerPoint presentation can be downloaded here.
Download Presentation
There is a series of demos in the presentation. The code and source are linked below. To get the third child to load you will need to download zoomer.swf and copy it to a server somewhere and fix the URL that loads it
Zoomer is a simple app that has a rectangle you drag around and it will magnify the area under the rectangle. The demo shows how it needs to be modified for being loaded by a main application in different applicationDomain and securityDomain configurations
Pattern 1 would the the standard first attempt. You can run zoomer.swf and see how it works on its own, run mainApplication.swf and see how, when zoomer is loaded, you can’t drag the rectangle out of the area owned by zoomer. See slide Demo #1.
Run Zoomer
Run Zoomer as a sub-app
Pattern 2 works for the first copy of Zoomer, but not for the second or third. See the slides for Demo#2
Run Zoomer
Run Zoomer as a sub-app
Pattern 3 uses getSandboxRoot() so the first and second copy of Zoomer works, but still the third is broken. See slide for Demo#3.
Run Zoomer
Run Zoomer as a sub-app
THe Final Pattern fixes that by listening for MarshalMouseEvent. See slide Demo#4
Run Zoomer
Run Zoomer as a sub-app
Source code is here:
Download Source
You will need a pre-release of 3.2 to build the source.
Preliminary write-up on the Marshall Plan is here:
Marshall Plan Wiki
As usual, caveats apply to all content

6 Responses to Marshall Plan At 360Flex Conference

  1. Alex Harui says:

    Just so you know, the presentation is a pptx file which seems to want to be downloaded as a .zip. Save it with a pptx file suffix before viewing it in PowerPoint. Don’t unzip it.

  2. RobMcM says:

    Thanks for the examples on this.
    Can you tell me more about the “compatibleLoad” property of the SWFLoader? It doesn’t appear to exist.
    Also the “mouse up somewhere” pattern you talk of in the wiki, are there any examples of this? Are there any examples of how to modify the various Flex Classes that are broken by the Marshall Plan?
    ————————–
    Alex responds:
    There were some API name changes before we ship. That flag is called loadForCompatibility
    The source code for Flex 3.2 will have examples where we used MOUSE_UP_SOMEWHERE

  3. RobMcM says:

    Hi again.
    I have read through the PDF on the Wiki, and it answered a lot of my questions 🙂
    However I am worried that communicating between my main application and a sand boxed sub application will be very hard without a bridge or shared model.
    It would be great if you could create an example of applications communicating with complex types.
    If I can create a prototype I will be sure to post it up to help others in the future.
    Thanks
    Rob

  4. RobMcM says:

    I have created an example of communication between sub and parent apps in seperate security domains.
    http://www.pixelbox.net/2009/02/11/sub-application-communication-in-air/
    The documentation could do with an update as it wasn’t easy!
    Hope this helps some other people

  5. Alex, on page 33 of your presentation, will having a bootstrap with shared classes actually work across flex versions? For our application we are building, this may work great, but I don’t want to go down that path without knowing the gotchas. It would seem that the bootstrap would always be at the latest version, but does a class defined that way actually work for a previous version of flash? If the bootstrap is flex 4 and one of the sub applications is 3.2, does that really work to share classes (I assume it means you just can’t change the class properties/api)

    • Alex Harui says:

      It will only work if the classes have not changed in some incompatible way between versions. Basically there is no guarantee and bootstraps are not really recommended for that reason