January 28, 2011

The canonical Cairngorm 3 (among other frameworks) sample application appears to be insync by Christophe Coenraets. I say “canonical” because not only does Adobe use this as their model for explaining Cairngorm 3, but it’s also checked into the opensource.adobe.com/svn repository.

But nothing’s ever simple. When I try to build insync-basic from Christophe’s blog I get this error: “The children of Halo navigators must implement INavigatorContent”. And when I try to build insync-basic from Adobe’s SVN repository, I get this error “unable to open ‘\Observer\bin\Observer.swc'”.

Ah, life with open sores!

The problem with the insync-basic from Christophe’s blog would be easier to solve, but the version checked into SVN uses more current Cairngorm libraries, so I decided to attempt to fix that instead. This project referred to three missing SWCs: “Observer.swc”, “ObserverParsley.swc” and “Integration.swc”. I downloaded the latest versions from http://sourceforge.net/adobe/cairngorm/wiki/CairngormLibraries, added “observer-1.13.swc”, “observerParsley-1.13.swc” and “integration-0.15.swc” to the project’s lib folder, edited the project’s settings and removed the missing libraries from “Build path libraries”, discovered I really needed “integrationParsley-0.15.swc” so added that, and voila! it built without errors!

Feeling pretty smug, I clicked on “InsyncBasic.mxml”, pressed F11 to debug, selected Debug as Web Application and…nothing. Nada. Zero. No browser window opened, nothing appeared in the console, nothing at all apparently happened. Of course, I try this three more times, with no more luck.

But would Charlie Brown quit? Of course not. He’s going to keep on trying to kick that football no matter what. So channeling my hero, I created a brand-new Flex Project which I optimistically called “running-insync-basic” and copied everything in. And incredibly, in my new project, InsyncBasic.mxml launched!

The last step was to get InsyncBasicTestRunner.mxml to build. There were three steps to this:

  1. Adding “-includes asmock.integration.flexunit.ASMockClassRunner” to my project’s Additional compiler arguments.
  2. In Flex Build Path \ Source Path, adding the “test” folder (which is located in the project’s root at the same level as “src”)
  3. Getting mystifying build errors, looking for more Charlie Brown pictures, removing InsyncBasicTestRunner.mxml from my project and then adding it back. Boom, problem solved.

I also had to remind myself that, no matter how an experience like this makes me feel, I’m actually a highly competent software developer.

Okay, in the hopes that this might spare someone else the misery I just went through, here’s a project that builds. I didn’t write the code, only went through the steps listed above

Download a working insync-basic here.