Class: Event

Event

Event クラスのメソッドは、イベントリスナー関数で使用してイベントオブジェクトの動作に影響を与えることができます。
一部のイベントにはデフォルトの動作が関連付けられています。
例えば、doubleClick イベントには、イベント時にマウスポインター位置の単語がハイライト表示されるというデフォルトの動作が関連付けられています。
イベントリスナーで preventDefault() メソッドを呼び出してこの動作をキャンセルできます。
また、stopPropagation() メソッドまたは stopImmediatePropagation() メソッドを呼び出すと、
現在のイベントリスナーを、イベントを処理する最後のイベントリスナーにすることができます。

The methods of the Event class can be used in event listener functions to affect the behavior of the event object.
Some events have an associated default behavior. For example,
the doubleClick event has an associated default behavior that highlights the word under the mouse pointer at the time of the event.
Your event listener can cancel this behavior by calling the preventDefault() method.
You can also make the current event listener the last one to process
an event by calling the stopPropagation() or stopImmediatePropagation() method.

new next2d.events.Event (type, bubbles, cancelable)

NameTypeDefaultDescription
typestring
bubblesbooleanfalseoptional
cancelablebooleanfalseoptional
Example

Example usage of Event.

// new Event
const {Event} = next2d.events;
displayObject.dispatchEvent(new Event(Event.ENTER_FRAME));

Members

next2d.events.Event.ACTIVATE staticconstant

ACTIVATE 定数は、type プロパティ(activate イベントオブジェクト)の値を定義します。
The ACTIVATE constant defines the value
of the type property of an activate event object.

Default Value:
  • activate

next2d.events.Event.ADDED staticconstant

Event.ADDED 定数は、added イベントオブジェクトの type プロパティの値を定義します。
The Event.ADDED constant defines the value
of the type property of an added event object.

Default Value:
  • added

next2d.events.Event.ADDED_TO_STAGE staticconstant

Event.ADDED_TO_STAGE 定数は、type プロパティ(addedToStage イベントオブジェクト)の値を定義します。
The Event.ADDED_TO_STAGE constant defines the value
of the type property of an addedToStage event object.

Default Value:
  • addedToStage

next2d.events.Event.CHANGE staticconstant

Event.CHANGE 定数は、type プロパティ(change イベントオブジェクト)の値を定義します。
The Event.CHANGE constant defines the value
of the type property of a change event object.

Default Value:
  • change

next2d.events.Event.COMPLETE staticconstant

Event.COMPLETE 定数は、complete イベントオブジェクトの type プロパティの値を定義します。
The Event.COMPLETE constant defines the value
of the type property of a complete event object.

Default Value:
  • complete

next2d.events.Event.DEACTIVATE staticconstant

Event.DEACTIVATE 定数は、deactivate イベントオブジェクトの type プロパティの値を定義します。
The Event.DEACTIVATE constant defines the value
of the type property of a deactivate event object.

Default Value:
  • deactivate

next2d.events.Event.ENTER_FRAME staticconstant

Event.ENTER_FRAME 定数は、enterFrame イベントオブジェクトの type プロパティの値を定義します。
The Event.ENTER_FRAME constant defines the value
of the type property of an enterFrame event object.

Default Value:
  • enterFrame

next2d.events.Event.EXIT_FRAME staticconstant

Event.EXIT_FRAME 定数は、exitFrame イベントオブジェクトの type プロパティの値を定義します。
The Event.EXIT_FRAME constant defines the value
of the type property of an exitFrame event object.

Default Value:
  • exitFrame

next2d.events.Event.FRAME_CONSTRUCTED staticconstant

Event.FRAME_CONSTRUCTED 定数は、frameConstructed イベントオブジェクトの type プロパティの値を定義します。
The Event.FRAME_CONSTRUCTED constant defines the value
of the type property of an frameConstructed event object.

Default Value:
  • frameConstructed

next2d.events.Event.FRAME_LABEL staticconstant

Event.FRAME_LABEL 定数は、frameLabel イベントオブジェクトの type プロパティの値を定義します。
The Event.FRAME_LABEL constant defines the value
of the type property of an frameLabel event object.

Default Value:
  • frameLabel

next2d.events.Event.INIT staticconstant

Event.INIT 定数は、init イベントオブジェクトの type プロパティの値を定義します。
The Event.INIT constant defines the value
of the type property of an init event object.

Default Value:
  • frameConstructed

next2d.events.Event.MOUSE_LEAVE staticconstant

Event.MOUSE_LEAVE 定数は、mouseLeave イベントオブジェクトの type プロパティの値を定義します。
The Event.MOUSE_LEAVE constant defines the value
of the type property of a mouseLeave event object.

Default Value:
  • mouseLeave

next2d.events.Event.namespace string staticconstant

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

Default Value:
  • next2d.events.Event

next2d.events.Event.REMOVED staticconstant

Event.REMOVED 定数は、removed プロパティ(paste イベントオブジェクト)の値を定義します。
The Event.REMOVED constant defines the value
of the type property of a removed event object.

Default Value:
  • removed

next2d.events.Event.REMOVED_FROM_STAGE staticconstant

Event.REMOVED_FROM_STAGE 定数は、removedFromStage イベントオブジェクトの type プロパティの値を定義します。
The Event.REMOVED_FROM_STAGE constant defines the value
of the type property of a removedFromStage event object.

Default Value:
  • removedFromStage

next2d.events.Event.RENDER staticconstant

Event.REMOVED 定数は、render イベントオブジェクトの
type プロパティの値を定義します。
The Event.REMOVED constant defines the value
of the type property of a render event object.

Default Value:
  • render

next2d.events.Event.RESIZE staticconstant

Event.RESIZE 定数は、resize イベントオブジェクトの
type プロパティの値を定義します。
The Event.RESIZE constant defines the value
of the type property of a resize event object.

Default Value:
  • resize

next2d.events.Event.SCROLL staticconstant

Event.SCROLL 定数は、render イベントオブジェクトの
type プロパティの値を定義します。
The Event.SCROLL constant defines the value
of the type property of a render event object.

Default Value:
  • scroll

next2d.events.Event.SOUND_COMPLETE staticconstant

Event.SOUND_COMPLETE 定数は、soundComplete イベントオブジェクトの type プロパティの値を定義します。
The Event.SOUND_COMPLETE constant defines the value
of the type property of a soundComplete event object.

Default Value:
  • render

next2d.events.Event.STOP staticconstant

Event.STOP 定数は、render イベントオブジェクトの
type プロパティの値を定義します。
The Event.STOP constant defines the value
of the type property of a render event object.

Default Value:
  • stop

next2d.events.Event.UPDATE staticconstant

Event.UPDATE 定数は、render イベントオブジェクトの
type プロパティの値を定義します。
The Event.STOP constant defines the value
of the type property of a render event object.

Default Value:
  • update

bubbles boolean readonly

イベントがバブリングイベントかどうかを示します。
Indicates whether an event is a bubbling event.

cancelable boolean readonly

イベントに関連付けられた動作を回避できるかどうかを示します。
Indicates whether the behavior associated
with the event can be prevented.

currentTarget object readonly

イベントリスナーで Event オブジェクトをアクティブに処理しているオブジェクトです。
The object that is actively processing the Event object
with an event listener.

eventPhase number readonly

イベントフローの現在の段階です。
The current phase in the event flow.

listener function readonly

現在コールされている関数
Function currently being called.

namespace string constant

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

Default Value:
  • next2d.events.Event

target object readonly

イベントターゲットです。
The event target.

type string readonly

イベントのタイプです。
The type of event.

Methods

next2d.events.Event.toString ()string static

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

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

formatToString ()string

カスタム ActionScript 3.0 Event クラスに
toString() メソッドを実装するためのユーティリティ関数です。
A utility function for implementing the toString() method
in custom ActionScript 3.0 Event classes.

Returns:
TypeDescription
string

isDefaultPrevented ()boolean

イベントで preventDefault() メソッドが呼び出されたかどうかを確認します。
Checks whether the preventDefault() method has been called on the event.

Returns:
TypeDescription
boolean

preventDefault ()void

イベントのデフォルト動作をキャンセルできる場合に、その動作をキャンセルします。
Cancels an event's default behavior if that behavior can be canceled.

Returns:
TypeDescription
void

stopImmediatePropagation ()void

イベントフローの現在のノードおよび後続するノードで、
イベントリスナーが処理されないようにします。
Prevents processing of any event listeners in the current node
and any subsequent nodes in the event flow.

Returns:
TypeDescription
void

stopPropagation ()void

イベントフローの現在のノードに後続するノードで
イベントリスナーが処理されないようにします。
Prevents processing of any event listeners in nodes subsequent
to the current node in the event flow.

Returns:
TypeDescription
void

toString ()string

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

Returns:
TypeDescription
string