Mouse.addListener( ) Method

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By 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( ).

See Also

Mouse.onMouseDown( ), Mouse.onMouseMove( ), Mouse.onMouseUp( ), Mouse.removeListener( ); Chapter 10

     
       About Safari   |   Terms of Service   |   Privacy Policy   |   Contact Us   |   Help   |   Submit a Problem
    Copyright 2002 O'Reilly & Associates, Inc. All rights reserved.
    1005 Gravenstein Highway North
    Sebastopol, CA 95472
     


    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net