May 2001
Intermediate to advanced
720 pages
23h 24m
English
The
names
of events (and their corresponding
event handlers) are predetermined by ActionScript. Button event
handlers are defined using on
(eventName), and movie clip
event handlers are defined using onClipEvent
(eventName), where
eventName is the name of the event to be
handled.
Hence, all button event handlers (except
keyPres
s, which also
requires a key parameter) take the form:
on (eventName) {statements}
A single button handler can respond to multiple events, separated by commas. For example:
on (rollover, rollOut) {
// Invoke a custom function in response to both the rollOver and rollOut events
playRandomSound( );
}All movie clip event handlers take the form:
onClipEvent (eventName) {statements}
Unlike button handlers, clip handlers can respond only to a single event.
Read now
Unlock full access