MouseEvent
A MouseEvent object is dispatched into the event flow whenever mouse events occur. A mouse event is usually generated by a user input device, such as a mouse or a trackball, that uses a pointer.
When nested nodes are involved, mouse events target the deepest possible nested node that is visible in the display list. This node is called the target node. To have a target node's ancestor receive notification of a mouse event, use EventDispatcher.addEventListener() on the ancestor node with the type parameter set to the specific mouse event you want to detect.
Inherited from Event.
Can be created with method new:
Lib.Media.Events.MouseEvent.new(type, bubbles, cancelable, localX, localY, relatedObject, ctrlKey, altKey, shiftKey, buttonDown, delta, commandKey, clickCount) |
Creates an Event object that contains information about mouse events. |
type - The type of the event. Possible values are: MouseEvent.CLICK, MouseEvent.DOUBLE_CLICK, MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_MOVE, MouseEvent.MOUSE_OUT, MouseEvent.MOUSE_OVER, MouseEvent.MOUSE_UP, MouseEvent.MIDDLE_CLICK, MouseEvent.MIDDLE_MOUSE_DOWN, MouseEvent.MIDDLE_MOUSE_UP, MouseEvent.RIGHT_CLICK, MouseEvent.RIGHT_MOUSE_DOWN, MouseEvent.RIGHT_MOUSE_UP, MouseEvent.MOUSE_WHEEL, MouseEvent.ROLL_OUT, and MouseEvent.ROLL_OVER. bubbles - (default = true) - Determines whether the Event object participates in the bubbling phase of the event flow. cancelable - (default = false) - Determines whether the Event object can be canceled. localX - (default = 0) - The horizontal coordinate at which the event occurred relative to the containing sprite. localY - (default = 0) - The vertical coordinate at which the event occurred relative to the containing sprite. relatedObject - (default = nil) - The complementary InteractiveObject instance that is affected by the event. For example, when a mouseOut event occurs, relatedObject represents the display list object to which the pointing device now points. ctrlKey - (default = false) - On Windows, indicates whether the Ctrl key is activated. On Mac, indicates whether either the Ctrl key or the Command key is activated. altKey - (default = false) - Indicates whether the Alt key is activated (Windows). shiftKey - (default = false) - Indicates whether the Shift key is activated. buttonDown - (default = false) - Indicates whether the primary mouse button is pressed. delta - (default = 0) - Indicates how many lines should be scrolled for each unit the user rotates the mouse wheel. A positive delta value indicates an upward scroll; a negative value indicates a downward scroll. Typical values are 1 to 3, but faster rotation may produce larger values. This parameter is used only for the MouseEvent.mouseWheel event. commandKey - (default = false) - Indicates whether the Command key is activated (Mac). This parameter is used only for the MouseEvent.click, MouseEvent.mouseDown, MouseEvent.mouseUp, MouseEvent.middleClick, MouseEvent.middleMouseDown, MouseEvent.middleMouseUp, MouseEvent.rightClick, MouseEvent.rightMouseDown, MouseEvent.rightMouseUp, and MouseEvent.doubleClick events. clickCount - (default = 0) - Indicates whether or not the mouse event is part of a multi-click sequence. This parameter will be zero for all mouse events other than MouseEvent.mouseDown, MouseEvent.mouseUp, MouseEvent.middleMouseDown, MouseEvent.middleMouseUp, MouseEvent.rightMouseDown and MouseEvent.rightMouseUp. Listening for single clicks, double clicks, or any multi-click sequence is possible with the clickCount parameter. |
Created MouseEvent object has properties:
altKey |
Indicates whether the Alt key is active (true) or inactive (false). |
buttonDown |
Indicates whether the primary mouse button is pressed (true) or not (false). |
clickCount |
[read-only] Indicates whether or not the mouse down event is part of a multi-click sequence. |
commandKey |
Indicates whether the command key is activated (Mac) The value of property commandKey will have the same value as property ctrlKey on the Mac. |
ctrlKey |
On Windows, indicates whether the Ctrl key is active (true) or inactive (false). |
delta |
Indicates how many lines should be scrolled for each unit the user rotates the mouse wheel. |
localX |
When mouse locking is disabled, the horizontal coordinate at which the event occurred relative to the containing sprite. |
localY |
When mouse locking is disabled, the vertical coordinate at which the event occurred relative to the containing sprite. |
relatedObject |
A reference to a display list object that is related to the event. |
shiftKey |
Indicates whether the Shift key is active (true) or inactive (false). |
stageX |
[read-only] The horizontal coordinate at which the event occurred in global Stage coordinates. |
stageY |
[read-only] The vertical coordinate at which the event occurred in global Stage coordinates. |
methods:
clone() |
Creates a copy of the MouseEvent object and sets the value of each property to match that of the original. |
|
toString() |
Returns a string that contains all the properties of the MouseEvent object. |
|
Event types:
Lib.Media.Events.MouseEvent.CLICK |
Defines the value of the type property of a click event object. |
Lib.Media.Events.MouseEvent.DOUBLE_CLICK |
Defines the value of the type property of a doubleClick event object. |
Lib.Media.Events.MouseEvent.MIDDLE_CLICK |
Defines the value of the type property of a middleClick event object. |
Lib.Media.Events.MouseEvent.MIDDLE_MOUSE_DOWN |
Defines the value of the type property of a middleMouseDown event object. |
Lib.Media.Events.MouseEvent.MIDDLE_MOUSE_UP |
Defines the value of the type property of a middleMouseUp event object. |
Lib.Media.Events.MouseEvent.MOUSE_DOWN |
Defines the value of the type property of a mouseDown event object. |
Lib.Media.Events.MouseEvent.MOUSE_MOVE |
Defines the value of the type property of a mouseMove event object. |
Lib.Media.Events.MouseEvent.MOUSE_OUT |
Defines the value of the type property of a mouseOut event object. |
Lib.Media.Events.MouseEvent.MOUSE_OVER |
Defines the value of the type property of a mouseOver event object. |
Lib.Media.Events.MouseEvent.MOUSE_UP |
Defines the value of the type property of a mouseUp event object. |
Lib.Media.Events.MouseEvent.MOUSE_WHEEL |
Defines the value of the type property of a mouseWheel event object. |
Lib.Media.Events.MouseEvent.RIGHT_CLICK |
Defines the value of the type property of a rightClick event object. |
Lib.Media.Events.MouseEvent.RIGHT_MOUSE_DOWN |
Defines the value of the type property of a rightMouseDown event object. |
Lib.Media.Events.MouseEvent.RIGHT_MOUSE_UP |
Defines the value of the type property of a rightMouseUp event object. |
Lib.Media.Events.MouseEvent.ROLL_OUT |
Defines the value of the type property of a rollOut event object. |
Lib.Media.Events.MouseEvent.ROLL_OVER |
Defines the value of the type property of a rollOver event object. |
Created with the Personal Edition of HelpNDoc: Easily create HTML Help documents