EaselJS

EaselJS  0.4.1

EaselJS > EaselJS > MouseEvent
Search:
 
Filters

Class MouseEvent

This is passed as the parameter to onPress, onMouseMove, onMouseUp, onMouseDown, and onClick handlers on DisplayObject instances. By default, mouse events are disabled for performance reasons. In order to enabled them for a specified stage set mouseEventsEnabled to true on your stage instance.

Constructor

MouseEvent ( type , stageX , stageY , target , nativeEvent )
Parameters:
type <String> The event type.
stageX <Number> The mouseX position relative to the stage.
stageY <Number> The mouseY position relative to the stage.
target <DisplayObject> The display object this event relates to.
nativeEvent <MouseEvent> The native DOM event related to this mouse event.

Properties

nativeEvent - MouseEvent

The native MouseEvent generated by the browser. The properties and API for this event may differ between browsers. This property will be null if the EaselJS property was not directly generated from a native MouseEvent.
Default Value: null

stageX - Number

The mouseX position on the stage.

stageY - Number

The mouseY position on the stage.

target - DisplayObject

The display object this event relates to.
Default Value: null

type - String

The type of mouse event. This will be the same as the handler it maps to (onPress, onMouseDown, onMouseUp, onMouseMove, or onClick).

Methods

clone

MouseEvent clone ( )
Returns a clone of the MouseEvent instance.
Returns: MouseEvent
a clone of the MouseEvent instance.

initialize

protected void initialize ( )
Initialization method.
Returns: void

toString

String toString ( )
Returns a string representation of this object.
Returns: String
a string representation of the instance.

Events

onMouseMove

onMouseMove ( event )
For events of type "onPress" and "onMouseDown" only you can assign a handler to the onMouseMove property. This handler will be called every time the mouse is moved until the mouse is released. This is useful for operations such as drag and drop.
Parameters:
event <MouseEvent> A MouseEvent instance with information about the current mouse event.

onMouseUp

onMouseUp ( event )
For events of type "onPress" and "onMouseDown" only you can assign a handler to the onMouseUp property. This handler will be called every time the mouse is moved until the mouse is released. This is useful for operations such as drag and drop.
Parameters:
event <MouseEvent> A MouseEvent instance with information about the current mouse event.