User Guide

Creating the ActionScript class file 167
You can explicitly build an event object before dispatching the event, as the following
example shows:
var eventObj = new Object();
eventObj.type = "myEvent";
eventObj.target = this;
dispatchEvent(eventObj);
You can also use a shortcut syntax that sets the value of the type property and the target
property and dispatches the event in a single line:
ancestorSlide.dispatchEvent({type:"revealChild", target:this});
In the preceding example, setting the target property is optional, because it is implicit.
The description of each event in the Flash 8 documentation lists the event properties that are
optional and required. For example, the
ScrollBar.scroll event takes a detail property in
addition to the
type and target properties. For more information, see the event descriptions
in Components Language Reference.
Common events
The following table lists the common events that are broadcast by various classes. Every
component should broadcast these events if they make sense for that component. This is not a
complete list of events for all components, just ones that are likely to be reused by other
components. Even though some events specify no parameters, all events have an implicit
parameter: a reference to the object broadcasting the event.
Event Use
click
Used by the Button component, or whenever a mouse click has no other
meaning.
change
Used by List, ComboBox, and other text-entry components.
scroll
Used by ScrollBar and other controls that cause scrolling (scroll “bumpers
on a scrolling pop-up menu).