Apache Flex 4.16.1 API Reference | All Packages | All Classes | Index | Frames No Frames |
FlowElementMouseEvent

Package | flashx.textLayout.events
Class | public class FlowElementMouseEvent
Inheritance | FlowElementMouseEvent flash.events.Event

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

A link element dispatches this event when it detects mouse activity. The Text Layout Framework includes this special version of mouse events because mouse events are generally unwanted when a flow element is embedded in an editable text flow, and because link elements are not in the display list (they are not DisplayObjects).

You can add an event listener to a link element to listen for this type of event. If you choose to cancel the event by calling `Event.preventDefault()`, the default behavior associated with the event will not occur.

If you choose not to add an event listener to the link element, or your event listener function does not cancel the behavior, the event is again dispatched, but this time by the link element's associated TextFlow instance rather than by the link element itself. This provides a second opportunity to listen for this event with an event listener attached to the TextFlow.

FlowElementMouseEvents are dispatched only when the text cannot be edited or when the control key is pressed concurrently with the mouse activity.

The following six event types are dispatched only when the text cannot be edited or when the control key is pressed:

- `FlowElementMouseEvent.CLICK`
- `FlowElementMouseEvent.MOUSE_DOWN`
- `FlowElementMouseEvent.MOUSE_UP`
- `FlowElementMouseEvent.MOUSE_MOVE`
- `FlowElementMouseEvent.ROLL_OVER`
- `FlowElementMouseEvent.ROLL_OUT`

See also

flashx.textLayout.elements.LinkElement
flash.events.MouseEvent

Public Properties

| Property | Defined By
--- | --- | ---
|  | flowElement : FlowElement The FlowElement that dispatched the event. | FlowElementMouseEvent
|  | originalEvent : MouseEvent The original mouse event generated by the mouse activity. | FlowElementMouseEvent

Public Methods

| Method | Defined By
--- | --- | ---
|  | FlowElementMouseEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = true, flowElement:FlowElement = null, originalEvent:MouseEvent = null) Creates an event object that contains information about mouse activity. | FlowElementMouseEvent

Public Constants

| Constant | Defined By
--- | --- | ---
|  | CLICK : String = click [static] Defines the value of the type property of a click event object. | FlowElementMouseEvent
|  | MOUSE_DOWN : String = mouseDown [static] Defines the value of the type property of a mouseDown event object. | FlowElementMouseEvent
|  | MOUSE_MOVE : String = mouseMove [static] Defines the value of the type property of a mouseMove event object. | FlowElementMouseEvent
|  | MOUSE_UP : String = mouseUp [static] Defines the value of the type property of a mouseUp event object. | FlowElementMouseEvent
|  | ROLL_OUT : String = rollOut [static] Defines the value of the type property of a rollOut event object. | FlowElementMouseEvent
|  | ROLL_OVER : String = rollOver [static] Defines the value of the type property of a rollOver event object. | FlowElementMouseEvent

Property Detail

flowElement | property

`flowElement:FlowElement`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The FlowElement that dispatched the event.

Implementation
`public function get flowElement():FlowElement`
`public function set flowElement(value:FlowElement):void`

See also

flashx.textLayout.elements.FlowElement

originalEvent | property |

`originalEvent:MouseEvent`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

The original mouse event generated by the mouse activity. This property can contain any of the following values:

- `MouseEvent.CLICK`
- `MouseEvent.MOUSE_DOWN`
- `MouseEvent.MOUSE_UP`
- `MouseEvent.MOUSE_MOVE`
- `MouseEvent.MOUSE_OVER`
- `MouseEvent.MOUSE_OUT`

In most cases the original event matches the event that the link element dispatches. The events match for the `click`, `mouseDown`, `mouseOut`, and `mouseOver` events. There are two cases, however, in which the original event is converted by the link element to a related event. If a link element detects a `mouseOver` event, it dispatches a `rollOver` event. Likewise, if a link element detects a `mouseOut` event, it dispatches a `rollOut` event. Usually, the event target and the mouse coordinates are related to the TextLine instance containing the link element.

Implementation
`public function get originalEvent():MouseEvent`
`public function set originalEvent(value:MouseEvent):void`

See also

flash.events.MouseEvent
Constructor Detail

FlowElementMouseEvent | () | Constructor

`public function FlowElementMouseEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = true, flowElement:FlowElement = null, originalEvent:MouseEvent = null)`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Creates an event object that contains information about mouse activity. Event objects are passed as parameters to event listeners. Use the constructor if you plan to manually dispatch an event. You do not need to use the constructor to listen for FlowElementMouseEvent objects generated by a FlowElement.

Parameters

| `type:String` — The type of the event. Event listeners can access this information through the inherited `type` property. There are six types: `FlowElementMouseEvent.CLICK`; `FlowElementMouseEvent.MOUSE_DOWN`; `FlowElementMouseEvent.MOUSE_MOVE`; `FlowElementMouseEvent.MOUSE_UP`; `FlowElementMouseEvent.ROLL_OVER`; and `FlowElementMouseEvent.ROLL_OUT`.
| `bubbles:Boolean` (default = `false`)`` — Determines whether the Event object participates in the bubbling phase of the event flow. FlowElementMouseEvent objects do not bubble.
| `cancelable:Boolean` (default = `true`)`` — Determines whether the Event object can be canceled. Event listeners can access this information through the inherited `cancelable` property. FlowElementMouseEvent objects can be cancelled. You can cancel the default behavior associated with this event by calling the `preventDefault()` method in your event listener.
| `flowElement:FlowElement` (default = `null`)`` — The instance of FlowElement, currently a LinkElement, associated with this event. Event listeners can access this information through the `flowElement` property.
| `originalEvent:MouseEvent` (default = `null`)`` — The original mouse event that occurred on the flowElement. Event listeners can access this information through the `originalEvent` property.

Constant Detail

CLICK | Constant

`public static const CLICK:String = click`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Defines the value of the `type` property of a `click` event object.

See also

flash.events.MouseEvent.CLICK

MOUSE_DOWN | Constant |

`public static const MOUSE_DOWN:String = mouseDown`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Defines the value of the `type` property of a `mouseDown` event object.

See also

flash.events.MouseEvent.MOUSE_DOWN

MOUSE_MOVE | Constant |

`public static const MOUSE_MOVE:String = mouseMove`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Defines the value of the `type` property of a `mouseMove` event object.

See also

flash.events.MouseEvent.MOUSE_MOVE

MOUSE_UP | Constant |

`public static const MOUSE_UP:String = mouseUp`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Defines the value of the `type` property of a `mouseUp` event object.

See also

flash.events.MouseEvent.MOUSE_UP

ROLL_OUT | Constant |

`public static const ROLL_OUT:String = rollOut`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Defines the value of the `type` property of a `rollOut` event object.

See also

flash.events.MouseEvent.ROLL_OUT

ROLL_OVER | Constant |

`public static const ROLL_OVER:String = rollOver`

Language Version : | ActionScript 3.0

Runtime Versions : | Flash Player 10, AIR 1.5

Defines the value of the `type` property of a `rollOver` event object.

See also

flash.events.MouseEvent.ROLL_OVER

Wed Nov 15 2017, 09:50 AM +01:00