EaselJS

EaselJS  0.5.0

EaselJS > EaselJS > MouseEvent
Search:
 
Filters

Class MouseEvent

This is passed as the parameter to onPress, onMouseMove, onMouseUp, onMouseDown, onMouseOver, onMouseOut and onClick handlers on DisplayObject instances.

Constructor

MouseEvent ( type , stageX , stageY , target , nativeEvent , pointerID , primary , rawX , rawY )
Parameters:
type <String> The event type.
stageX <Number> The normalized x position relative to the stage.
stageY <Number> The normalized y 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.
pointerID <Number> The unique id for the pointer.
primary <Boolean> Indicates whether this is the primary pointer in a multitouch environment.
rawX <Number> The raw x position relative to the stage.
rawY <Number> The raw y position relative to the stage.

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

pointerID - {Number}

The unique id for the pointer (touch point or cursor). This will be either -1 for the mouse, or the system supplied id value.

primaryPointer - {Boolean}

Indicates whether this is the primary pointer in a multitouch environment. This will always be true for the mouse. For touch pointers, the first pointer in the current stack will be considered the primary pointer.

rawX - Number

The raw x position relative to the stage. Normally this will be the same as the stageX value, unless stage.mouseMoveOutside is true and the pointer is outside of the stage bounds.

rawY - Number

The raw y position relative to the stage. Normally this will be the same as the stageY value, unless stage.mouseMoveOutside is true and the pointer is outside of the stage bounds.

stageX - Number

The normalized x position on the stage. This will always be within the range 0 to stage width.

stageY - Number

The normalized y position on the stage. This will always be within the range 0 to stage height.

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" 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" 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.