Cairngorm event gotcha

The latest version of Cairngorm i.e. Cairngorm v2.2.1 has an added helper method in the CairngormEvent class. CairngormEvent->dispatch(e:CairngormEvent). The other day I was busy debugging an application and came across the following code inside one of the views:

var event:CairngormEvent = new CairngormEvent();
dispatchEvent(event);

At first glance this seems completely normal but will fail silently and cease to trigger the associated command.

While I do appreciate the new CairngormEvent helper method which should look like this:

var event:CairngormEvent = new CairngormEvent();
event.dispatch();

for clarity towards fellow team members who may not be familiar with Cairngorm and better distinction between Cairngorm application events and standard view events, I recommend still using the original syntax to dispatch your events:

var event:CairngormEvent = new CairngormEvent();
CairngormEventDispatcher.getInstance().dispatchEvent(event);

This will ensure that the event is clearly dispatched by the Cairngorm framework and not your view.

Use Apache Ant, Flex Builder or FDT to increase team collabiration

After taking the plunge and jumping into using Apache Ant to build my current project I can say that I highly recommend it to anyone who works in a team environment.

The advantage is that you can configure exactly how you would like your application to compile, build and deploy and share this same configuration with fellow colleagues.

The only configuration for other team members would be to set the path to their Flex 3 SDK directory.

To get started here is a tutorial worth reading.

When you have a moment I encourage you to give a sample project a test run compiling with Ant, and as a challenge see if you can set it up to email you if there were any build errors.

While you getting into it why not read through some Ant best practices.

Beta AIR application preview fix

Remote Synthesis posted a solution that fixes your AIR application preview in the latest version of Flex Builder 3.

Get started with AIR

No excuses now, Lee Brimlow has posted his session notes from FITC Amsterdam, download them and get started today.

Flex Unit Testing

If you have not started unit testing your code, here is a great article to get you started.

Next Previous