Event: Using Custom Events
The Custom Event framework is one of the principle communication mechanisms
in YUI. An object can be augmented with EventTarget, enabling it
to be both a host and a target for Custom Events. Custom Events fire from
their host and optionally bubble up to one or more targets. This allows you to
make the interesting moments of your applications broadly available within a
module, within a set of modules, or throughout a complex interface populated
with rich elements.
In this example, a simple Custom Event is illustrated:
testEvent. This Custom Event is hosted on a Publisher object and
bubbles up to a BubbleTarget object.

Custom Events, like DOM events, can be stopped
(stopPropagation) and their default behavior can be suppressed
(preventDefault).
- Custom Event log messages will appear here.
Source Code
The full source code for this example follows. Read through the comments and code to get an understanding of how you can make use of Custom Events in your own application development.
