Archive for August, 2008

Flex Authority Magazine

I think I can finally say I got something published! Gordon Smith and I contributed to the first issue of Flex Authority, a new magazine (made of actual paper!) that focuses on Flex and AIR. We hope to be regular contributors. The link to find out more is: http://www.flex-authority.com/. Buy your subscription today. We won’t make any money from it, but this post is to thank them for working with us and to help them get the word out so they can make some money.

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

DataGrid With PopUp Editor

Some folks seem to be in need of an itemEditor in the DataGrid that can popup or float over the DataGrid. The DataGrid currently limits the editor to fit within its size and if you need more space than that, you’ll need to popup an editor.
It is tricky to do so because of a bug in DataGrid plus the complexities of focus handlng and how it is normally used to end the edit session.
Here’s a workaround for the bug and my take on how to create popup editors. Usual caveats apply.
Download Source
Run Example

DataGrid ItemEditor with Two Input Fields

Several folks have been asking about how to have a DataGrid ItemEditor with two input fields (say you want to separately edit first name and last name or something like that).
It’s a bit tricky because of some missing pieces in the underlying Flash focus APIs and because of how Focus events work. Here is my take on how to do it. Usual caveats apply (i.e, code is not supported and may have bugs etc).
Download Source
Run Example