Dispatching Events with Cairngorm 2.2.1

While trawling through the CairngormEvent.as I noticed the distpatch() method which in essence calls the same code that was needed in the previous versions of Cairngorm.

Pre Cairngorm 2.2 example

var userVO : UserVO = ModelLocator.getInstance().userVO;
var event : LoginChangeEvent = new LoginChangeEvent(LoginChangeEvent.LOGOUT_EVENT,userVO);

/* dispatch the event */
CairngormEventDispatcher.getInstance().dispatchEvent( event );

Latest example

var userVO : UserVO = ModelLocator.getInstance().userVO;
var event : LoginChangeEvent = new LoginChangeEvent(LoginChangeEvent.LOGOUT_EVENT,userVO);

/* dispatch the event */
event.dispatch();

It just saves having to import the CairngormEventDispatcher and typing those extra characters. Which can save a lot of time if you’re a chicken pecker typist 🙂

Ha ha ha I’ve caught you… you http request.

Have you ever been sick and tired of trying to use the flash remote debugger to debug those nasty remote errors. Well don’t pull your hair out any longer. Why don’t you try Service Capture, the ultimate tool for seeing http requests from your browser.

Service Capture has to be one of my favourite tools in RIA Development. It is especially helpful when dealing heavily with remote packets being sent to and from flex and flash. One is able to browse the specific arguments and view any server side errors returned to the UI.

It runs on both Windows and Mac and for the small price of $30 it’ll save you 3.33 times the amount in your time when it comes to debug that problem and double as your alibi when your standing toe to toe with your server side buddy arguing the fact that flex is indeed sending the correct information.

You can read more about it here