Quick Tips:EventObservers
From CASA Framework
You may be used to adding listeners like this:
myListener:Object = new Object();
myListener.onEvent = function():Void {
//
}
myControl.addListener(myListener);
Creating lambdas (anonymous functions) or delegates is a pain. So CASA is built around its own event dispatching model that tries to solve this. The CASA dispatcher should take the place of all events and listeners. Here is the basic usage:
function myUniqueName():Void {
//
}
eventObject.addEventObserver(this, 'onEvent', 'myUniqueName');
It follows the Macromedia EventDispatcher method but it also includes a third optional parameter. This parameter allows you to map the callback easily to a method not sharing the same name as the event. So you can have multiple functions in the same scope all receiving the dispatched events.
Along with the standardeventObject.removeEventObserver(this, 'onEvent', 'myUniqueName');CASA also contains the additional event removing methods:
removeEventObserversForEvent(eventName:String);
removeEventObserversForScope(scope:Object);
removeAllEventObservers();
All Objects where ActionScript requires you to use addListener have been wrapped in CASA allowing you to easily use CASA's EventDispatcher. So you never have to use addListener again!
This was an extremely quick overview; for more information see:
org.casaframework.event.EventDispatcher
Here are a few of the event wrappers:

