• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Advanced Buttons and Event De... > A Summary of Events and Event Handle...

A Summary of Events and Event Handlers

Table 4.5 organizes and compares the many ways you can create event handlers to detect and respond to events.

A Summary of Events and Event Handlers
Object Event Handler Assigned on Instance Event Handler Assigned on Main Timeline Anonymous Function Assigned to Listener
Button on(press)

on(release)

on(releaseOutside)

on(rollOver)

on(rollOut)

on(dragOver)

on(dragOut)

on(keyPress “whatkey”)

-

-
onPress

onRelease

onReleaseOutside

onRollover

onRollOut

onDragOver

onDragOut

-

onSetFocus

onKillFocus
button instance No
Mouse No onMouseUp

onMouseDown

onMouseMove
Listener or _root Yes [*]

Yes[*]

Yes[*]
Key No onKeyUp onKeyDown Listener Yes Yes
Movie Clip (may also receive Button events) onClipEvent(load)

onClipEvent(unload)

onClipEvent(data)

onClipEvent(enterFrame)

onClipEvent(mouseDown)

onClipEvent(mouseUp)

onClipEvent(mouseMove)

onClipEvent(keyUp)

onClipEvent(keyDown)
onLoad

onUnload

onData

onEnterFrame

onMouseDown

onMouseUp

onMouseMove

onKeyUp

onKeyDown
MC/_root

MC/_root

MC/_root

MC/_root

MC/_root/L

MC/_root/L

MC/_root/L

Listener

Listener
No

No

No

No

Yes[*]

Yes[*]

Yes[*]

Yes

Yes


[*] not required

MC = movie-clip instance

_root = main Timeline

L = Listener

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint