Example
Example usage of EventDispatcher.
// new ColorTransform
const {EventDispatcher} = next2d.events;
const eventDispatcher = new EventDispatcher();
eventDispatcher.addEventListener(Event.ENTER_FRAME, function (event)
{
// more...
});
Members
指定されたクラスの空間名を返します。
Returns the space name of the specified class.- Default Value:
- next2d.events.EventDispatcher
指定されたオブジェクトの空間名を返します。
Returns the space name of the specified object.- Default Value:
- next2d.events.EventDispatcher
Methods
指定されたクラスのストリングを返します。
Returns the string representation of the specified class.- Default Value:
- [class EventDispatcher]
Returns:
Type Description string イベントリスナーオブジェクトを EventDispatcher オブジェクトに登録し、
リスナーがイベントの通知を受け取るようにします。
Registers an event listener object with an EventDispatcher object
so that the listener receives notification of an event.Name Type Default Description type
string listener
function use_capture
boolean false optional priority
number 0 optional Returns:
Type Description void イベントをイベントフローに送出します。
Dispatches an event into the event flow.Name Type Description event
Event Returns:
Type Description boolean EventDispatcher オブジェクトに、特定のイベントタイプに対して登録されたリスナーがあるかどうかを確認します。
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.Name Type Description type
string Returns:
Type Description boolean EventDispatcherオブジェクトから指定したタイプのリスナーを全て削除します。
Removes all listeners of the specified type from the EventDispatcher object.Name Type Default Description type
string use_capture
boolean false optional Returns:
Type Description void EventDispatcher オブジェクトからリスナーを削除します。
Removes a listener from the EventDispatcher object.Name Type Default Description type
string listener
function use_capture
boolean false optional Returns:
Type Description void 指定されたオブジェクトのストリングを返します。
Returns the string representation of the specified object.Returns:
Type Description string 指定されたイベントタイプについて、
この EventDispatcher オブジェクトまたはその祖先にイベントリスナーが
登録されているかどうかを確認します。
Checks whether an event listener is registered
with this EventDispatcher object or
any of its ancestors for the specified event type.Name Type Description type
string Returns:
Type Description boolean