ActionScript for Flash MX: The Definitive Guide, Second Edition
ActionScript for Flash MX: The Definitive Guide, 2nd EditionBy Colin Moock
Chapter 18. ActionScript Language Reference
Mouse.addListener( ) Method
Flash 6
register an object to receive onMouseDown( ), onMouseMove( ), and onMouseUp( ) events
Mouse.addListener(listener)
Arguments
listener
An object with onMouseDown( ), onMouseMove( ), and/or onMouseUp( ) methods defined.
Description
The addListener( ) method adds listener to the list of objects notified when Mouse's onMouseDown( ), onMouseMove( ), and onMouseUp( ) events occur. The listener parameter is an object of any class that defines methods by the names onMouseDown, onMouseMove, and/or onMouseUp; the methods are invoked when the corresponding event occurs for Mouse. Instances of built-in classes, such as TextField or Button, can respond to Mouse events. To stop a listener object from receiving events, use Mouse.removeListener( ).
Multiple objects can respond independently to each Mouse event. When multiple listeners are registered to Mouse, their methods are invoked in the order the listeners were added.
For general information on how listeners and callback functions work, see Chapter 10. For sample Mouse listener code, see Mouse.onMouseDown( ).