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 event : LoginChangeEvent = new LoginChangeEvent(LoginChangeEvent.LOGOUT_EVENT,userVO);
/* dispatch the event */
CairngormEventDispatcher.getInstance().dispatchEvent( event );
Latest example
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 :)


There are no comments for this entry.
[Add Comment]