class js.html.Event

Available on js

This chapter describes the DOM Event Model. The Event interface itself is described, as well as the interfaces for event registration on nodes in the DOM, and event listeners, and several longer examples that show how the various event interfaces relate to one another.

There is an excellent diagram that clearly explains the three phases of event flow through the DOM in the DOM Level 3 Events draft.



Documentation for this class was provided by MDN.

Class Fields

static var AT_TARGET:Int

static var BLUR:Int

static var BUBBLING_PHASE:Int

static var CAPTURING_PHASE:Int

static var CHANGE:Int

static var CLICK:Int

static var DBLCLICK:Int

static var DRAGDROP:Int

static var FOCUS:Int

static var KEYDOWN:Int

static var KEYPRESS:Int

static var KEYUP:Int

static var MOUSEDOWN:Int

static var MOUSEDRAG:Int

static var MOUSEMOVE:Int

static var MOUSEOUT:Int

static var MOUSEOVER:Int

static var MOUSEUP:Int

static var NONE:Int

static var SELECT:Int

Instance Fields

var bubbles:Bool

A boolean indicating whether the event bubbles up through the DOM or not.

var cancelBubble:Bool

A boolean indicating whether the bubbling of the event has been canceled or not.

var cancelable:Bool

A boolean indicating whether the event is cancelable.

var currentTarget:EventTarget

A reference to the currently registered target for the event.

var defaultPrevented:Bool

Indicates whether or not event.preventDefault() has been called on the event.

var eventPhase:Int

Indicates which phase of the event flow is being processed.

var target:EventTarget

A reference to the target to which the event was originally dispatched.

var timeStamp:Int

The time that the event was created.

var type:String

The name of the event (case-insensitive).

function new(type:String, ?canBubble:Bool, ?cancelable:Bool):Void

function initEvent(eventTypeArg:String, canBubbleArg:Bool, cancelableArg:Bool):Void

function preventDefault():Void