Class: EventDispatcher

EventDispatcher

EventDispatcher クラスは、イベントを送出するすべてのクラスの基本クラスです。

The EventDispatcher class is the base class for all classes that dispatch events.

new next2d.events.EventDispatcher ()

Example

Example usage of EventDispatcher.

// new ColorTransform
const {EventDispatcher} = next2d.events;
const eventDispatcher   = new EventDispatcher();
eventDispatcher.addEventListener(Event.ENTER_FRAME, function (event)
{
    // more...
});

Members

next2d.events.EventDispatcher.namespace string staticconstant

指定されたクラスの空間名を返します。
Returns the space name of the specified class.

Default Value:
  • next2d.events.EventDispatcher

namespace string constant

指定されたオブジェクトの空間名を返します。
Returns the space name of the specified object.

Default Value:
  • next2d.events.EventDispatcher

Methods

next2d.events.EventDispatcher.toString ()string static

指定されたクラスのストリングを返します。
Returns the string representation of the specified class.

Default Value:
  • [class EventDispatcher]
Returns:
TypeDescription
string

addEventListener (type, listener, use_capture, priority)void

イベントリスナーオブジェクトを EventDispatcher オブジェクトに登録し、
リスナーがイベントの通知を受け取るようにします。
Registers an event listener object with an EventDispatcher object
so that the listener receives notification of an event.

NameTypeDefaultDescription
typestring
listenerfunction
use_capturebooleanfalseoptional
prioritynumber0optional
Returns:
TypeDescription
void

dispatchEvent (event)boolean

イベントをイベントフローに送出します。
Dispatches an event into the event flow.

NameTypeDescription
eventEvent
Returns:
TypeDescription
boolean

hasEventListener (type)boolean

EventDispatcher オブジェクトに、特定のイベントタイプに対して登録されたリスナーがあるかどうかを確認します。
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.

NameTypeDescription
typestring
Returns:
TypeDescription
boolean

removeAllEventListener (type, use_capture)void

EventDispatcherオブジェクトから指定したタイプのリスナーを全て削除します。
Removes all listeners of the specified type from the EventDispatcher object.

NameTypeDefaultDescription
typestring
use_capturebooleanfalseoptional
Returns:
TypeDescription
void

removeEventListener (type, listener, use_capture)void

EventDispatcher オブジェクトからリスナーを削除します。
Removes a listener from the EventDispatcher object.

NameTypeDefaultDescription
typestring
listenerfunction
use_capturebooleanfalseoptional
Returns:
TypeDescription
void

toString ()string

指定されたオブジェクトのストリングを返します。
Returns the string representation of the specified object.

Returns:
TypeDescription
string

willTrigger (type)boolean

指定されたイベントタイプについて、
この EventDispatcher オブジェクトまたはその祖先にイベントリスナーが
登録されているかどうかを確認します。
Checks whether an event listener is registered
with this EventDispatcher object or
any of its ancestors for the specified event type.

NameTypeDescription
typestring
Returns:
TypeDescription
boolean