Help Center

Local Navigation

Object: Event

Availability

BlackBerry® Device Software version 4.6 or later

Extended by

CustomEvent, MessageEvent, MutationEvent, StorageEvent, UIEvent

The Event object represents provides contextual information about an event that Event handlers can use, such as the originating element, what stage the event is currently in within the event system, and so forth.

The properties and methods exposed by Event are minimal, and provide the basic functionality required by events of all types. More specific event objects should be used to acquire context information specific to a certain event type.

For example, the MouseEvent object, which inherits from Event through the UIEvent object, supplies additional properties supplying information such as the MouseEvent.button, MouseEvent.screenX and MouseEvent.screenY for where the current mouse event took place.

Event constants

Constant

Phase type

Description

Support level

Availability

1

CAPTURING_PHASE

Indicates that the event is in the capturing phase.

DOM 2 Events

4.6 or later

2

AT_TARGET

Indicates that the event is in being handled by the target node.

DOM 2 Events

4.6 or later

3

BUBBLING_PHASE

Indicates that the event is in the bubbling phase.

DOM 2 Style

4.6 or later

Event properties

Property name

Type

Description

Status

Support level

Availability

bubbles

boolean

When true, the event is a bubbling event.

read only

DOM 2 Events

4.6. or later

cancelable

boolean

When true, the action of the event can be cancelled using Event.preventDefault() .

read only

DOM 2 Events

4.6. or later

cancelBubble

boolean

When true, bubbling of the event is cancelled.

writable

Non-standard.

4.6. or later

currentTarget

EventTarget

The node of the Document object that is currently handling the event.

read only

DOM 2 Events

4.6. or later

eventPhase

unsigned short

The phase that the event is currently in, represented using an Event constant.

read only

DOM 2 Events

4.6. or later

target

EventTarget

The target node to which the event was dispatched.

read only

DOM 2 Events

4.6. or later

timeStamp

unsigned long

The time (in milliseconds since epoch) at which the event was created.

read only

DOM 2 Events

4.6 or later

type

DOMString

The name of the event.

read only

DOM 2 Events

4.6 or later

Event methods

Method name

Description

Support level

Availability

initEvent()

Initializes the properties of an Event object.

DOM 2 Events

4.6 or later

preventDefault()

Cancels the event, preventing the default action from occurring.

DOM 2 Events

4.6 or later

stopPropagation()

Prevents further propagation of this event during an event flow.

DOM 2 Events

4.6 or later

Previous topic: CustomEvent methods

Was this information helpful? Send us your comments.