Packagedom.events
Classpublic class CustomEvent
InheritanceCustomEvent Inheritance Event Inheritance Object

Introduced in: DOM 3 Events 

The CustomEvent interface is the recommended interface for application-specific event types. Unlike the Event interface, it allows applications to provide contextual information about the event type. Application-specific event types should have an associated namespace to avoid clashes with future general-purpose event types.

To create an instance of the CustomEvent interface, use the DocumentEvent.createEvent("CustomEvent") method call.

See also

W3C - DOM 3 Events: CustomEvent


Public Properties
 PropertyDefined By
 InheritedDOM 2 Events bubbles : Boolean
[read-only] Used to indicate whether or not an event is a bubbling event.
Event
 InheritedDOM 2 Events cancelable : Boolean
[read-only] Indicates whether the event is cancelable or not.
Event
 InheritedDOM 2 Events currentTarget : EventTarget
[read-only] Identifies the current target for the event, as the event traverses the DOM.
Event
 InheritedDOM 3 Events defaulPrevented : Boolean
[read-only] Used to indicate whether Event.preventDefault() has been called for this event.
Event
  DOM 3 Events detail : DOMObject
[read-only] Specifies some detail information about the Event.
CustomEvent
 InheritedDOM 2 Events eventPhase : Number
[read-only] Used to indicate which phase of event flow is currently being accomplished.
Event
 InheritedNon-Standard explicitOriginalTarget : nsIDOMEventTarget
[read-only] The explicit original target of the event.
Event
 InheritedNon-Standard isTrusted : Boolean
[read-only] Determines if the event was from the user or script generated.
Event
 InheritedDOM 3 Events namespaceURI : DOMString
[read-only] The namespace URI associated with this event at initialization time, or null if it is unspecified.
Event
 InheritedNon-Standard originalTarget : *
[read-only] The original target of the event before any retargetings.
Event
 InheritedDOM 2 Events target : EventTarget
[read-only] Used to indicate the event target.
Event
 InheritedDOM 2 Events timeStamp : DOMTimeStamp
[read-only] Used to specify the time at which the event was created in milliseconds relative to 1970-01-01T00:00:00Z.
Event
 InheritedDOM 2 Events type : DOMString
[read-only] The local name of the event type.
Event
Public Methods
 MethodDefined By
  
DOM 3 Events initCustomEventNS(namespaceURIArg:DOMString, typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean, detailArg:DOMObject):void
Initializes attributes of a CustomEvent object.
CustomEvent
 Inherited
DOM 2 Events initEvent(typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean):void
Initializes attributes of an Event created through the DocumentEvent.createEvent method.
Event
 Inherited
DOM 3 Events initEventNS(namespaceURIArg:DOMString, typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean):void
Initializes attributes of an Event object.
Event
 Inherited
 Obsolete preventBubble():void
Prevents the event from bubbling.
Event
 Inherited
 Obsolete preventCapture():void
This method is deprecated in favor of standard stopPropagation and is removed in Gecko 1.9.
Event
 Inherited
DOM 2 Events preventDefault():void
Cancels the event if it is cancelable, without stopping further propagation of the event.
Event
 Inherited
DOM 3 Events stopImmediatePropogation():void
Prevents other event listeners from being triggered and, unlike Event.stopPropagation() its effect is immediate .
Event
 Inherited
DOM 2 Events stopPropogation():void
Prevents other event listeners from being triggered but its effect is deferred until all event listeners attached on the Event.currentTarget have been triggered .
Event
Public Constants
 ConstantDefined By
 InheritedHTML 4.0 abort : String = abort
[static] Loading of a resource has been aborted.
Event
 InheritedDOM 2 Events AT_TARGET : Number = 2
[static] The current event is in the target phase, i.e.
Event
 InheritedDOM 2 Events BUBBLING_PHASE : Number = 3
[static] The current event phase is the bubbling phase.
Event
 InheritedDOM 2 Events CAPTURING_PHASE : Number = 1
[static] The current event phase is the capture phase.
Event
 InheritedHTML 4.0 change : String = change
[static] A control loses the input focus and its value has been modified since gaining focus.
Event
 InheritedHTML 4.0 error : String = error
[static] A resource failed to load, or has been loaded but cannot be interpreted according to its semantics such as an invalid image, a script execution error, or non-well-formed XML.
Event
 InheritedHTML 4.0 load : String = load
[static] The DOM Implementation finishes loading the resource (such as the document) and any dependent resources (such as images, style sheets, or scripts).
Event
 InheritedHTML 4.0 reset : String = reset
[static] A form, such as a [HTML 4.01] or [XHTML 1.0] form, is reset.
Event
 InheritedHTML 4.0 select : String = select
[static] A user selects some text.
Event
 InheritedHTML 4.0 submit : String = submit
[static] A form, such as a [HTML 4.01] or [XHTML 1.0] form, is submitted.
Event
 InheritedHTML 4.0 unload : String = unload
[static] The DOM implementation removes from the environment the resource (such as the document) or any dependent resources (such as images, style sheets, scripts).
Event
Property Detail
DOM 3 Events detailproperty
detail:DOMObject  [read-only]

Introduced in: DOM 3 Events 

Specifies some detail information about the Event.


Implementation
    public function get detail():DOMObject

See also

Method Detail
DOM 3 Events initCustomEventNS()method
public function initCustomEventNS(namespaceURIArg:DOMString, typeArg:DOMString, canBubbleArg:Boolean, cancelableArg:Boolean, detailArg:DOMObject):void

Introduced in: DOM 3 Events 

Initializes attributes of a CustomEvent object. This method has the same behavior as Event.initEventNS().

Parameters

namespaceURIArg:DOMString — Specifies Event.namespaceURI, the namespace URI associated with this event, or null if no namespace.
 
typeArg:DOMString — Specifies Event.type, the local name of the event type.
 
canBubbleArg:Boolean — Specifies Event.bubbles. This parameter overrides the intrinsic bubbling behavior of the event.
 
cancelableArg:Boolean — Specifies Event.cancelable. This parameter overrides the intrinsic cancelable behavior of the event.
 
detailArg:DOMObject — Specifies CustomEvent.detail. This value may be null.

See also