MovieClip.onMouseDown( ) Event Handler

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
MovieClip.onMouseDown( ) Event Handler Flash 6

handler executed when primary mouse button is depressed while the clip is on stageFlash 5; callback form introduced in
mc.onMouseDown()    onClipEvent (mouseDown) {   statements }

Description

The onMouseDown( ) event handler is the callback form (and more modern analogue) of the legacy onClipEvent (mouseDown) event handler. The onMouseDown( ) event handler is identical to the Mouse.onMouseDown( ) listener event, except that it allows for screen refreshes between frames via updateAfterEvent( ). It executes when mc is on stage and the primary mouse button is depressed. The MovieClip.onMouseDown( ) handler would be obsolete in Flash 6 if Mouse.onMouseDown( ) supported updateAfterEvent( ). For complete details, see Mouse.onMouseDown( ).

Example

// Callback form _root.onMouseDown = function () {   trace("The mouse was pressed"); }     // Flash 5-style onClipEvent() block placed directly on a movie clip instance onClipEvent (mouseDown) {   trace("The mouse was pressed"); }

See Also

Mouse.onMouseDown( ), MovieClip.onMouseMove( ), MovieClip.onMouseUp( )



    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