# BaseEvent Class

Extends BaseObject
Defined in: `js/event/BaseEvent.js:15`
Module: event
Parent Module: StructureJS

The BaseEvent class is used as the base class for the creation of Event objects, which are passed as parameters to event listeners when an event occurs.

The properties of the BaseEvent class carry basic information about an event, such as the event's type or whether the event's default behavior can be canceled.

For many events, such as the events represented by the Event class constants, this basic information is sufficient. Other events, however, may require more detailed information.

## Index

Show: Inherited Protected Private Deprecated

### Properties

- bubbles
- cancelable
- currentTarget
- data
- isImmediatePropagationStopped
- isPropagationStopped
- sjsId
- target
- type

### Methods

- BaseEvent constructor
- clone
- destroy
- getQualifiedClassName
- stopImmediatePropagation
- stopPropagation

### Events

- ACTIVATE static
- ADDED static
- ADDED_TO_STAGE static
- CANCEL static
- CHANGE static
- CLEAR static
- CLOSE static
- CLOSING static
- COMPLETE static
- CONNECT static
- COPY static
- CUT static
- DEACTIVATE static
- DISPLAYING static
- ENTER_FRAME static
- EXIT_FRAME static
- EXITING static
- FULLSCREEN static
- INIT static
- NETWORK_CHANGE static
- OPEN static
- PASTE static
- PREPARING static
- REMOVED static
- RENDER static
- RESIZE static
- SELECTED static

## Properties

### `bubbles` Boolean public

Defined in `js/event/BaseEvent.js:101`

Indicates whether an event is a bubbling event.

Default: false

### `cancelable` Boolean public

Defined in `js/event/BaseEvent.js:110`

Indicates whether the behavior associated with the event can be prevented.

Default: false

### `currentTarget` Any public

Defined in `js/event/BaseEvent.js:82`

The currentTarget property always points to the DisplayObjectContainer that the event is currently processing (i.e. bubbling at).

Default: null

### `data` Any public

Defined in `js/event/BaseEvent.js:92`

Used to pass any type of data with the event.

Default: null

### `isImmediatePropagationStopped` Boolean public

Defined in `js/event/BaseEvent.js:129`

Indicates if the stopImmediatePropagation was called on the event object.

Default: false

### `isPropagationStopped` Boolean public

Defined in `js/event/BaseEvent.js:119`

Indicates if the stopPropagation was called on the event object.

Default: false

### `sjsId` Int public

Inherited from BaseObject: `js/BaseObject.js:27`

The sjsId (StructureJS ID) is a unique identifier automatically assigned to most StructureJS objects upon instantiation.

Default: null

### `target` Any public

Defined in `js/event/BaseEvent.js:72`

A reference to the object that originally dispatched the event.

Default: null

### `type` String public

Defined in `js/event/BaseEvent.js:62`

The type of event.

Default: null

There are no properties that match your current filter settings. You can change your filter settings in the index section on this page. index

## Constructor

### `BaseEvent`
(

- `type`
- `[bubbles=false]`
- `[cancelable=false]`
- `[data=null]`

)

Defined in `js/event/BaseEvent.js:15`

#### Parameters:

- `type` String

  The type of event. The type is case-sensitive.

- `[bubbles=false]` Boolean optional

  Indicates whether an event is a bubbling event. If the event can bubble, this value is true; otherwise it is false. Note: With event-bubbling you can let one Event subsequently call on every ancestor (parent) (containers of containers of etc.) of the DisplayObjectContainer that originally dispatched the Event, all the way up to the surface (Stage). Any classes that do not have a parent cannot bubble.

- `[cancelable=false]` Boolean optional

  Indicates whether the behavior associated with the event can be prevented. If the behavior can be canceled, this value is true; otherwise it is false.

- `[data=null]` Any optional

  Use to pass any type of data with the event.

#### Example:

    // Example: how to create a custom event by extending BaseEvent.

    class CountryEvent extends BaseEvent {

         CHANGE_COUNTRY = 'CountryEvent.changeCountry';

         constructor(type, bubbles = false, cancelable = false, data = null) {
             super(type, bubbles, cancelable, data);

             this.countryName = null;
         }
     }

    // Example: how to use the custom event.
    let event = new CountryEvent(CountryEvent.CHANGE_COUNTRY);
    event.countryName = 'Canada';
    this.dispatchEvent(event);

## Methods

### `clone` () BaseEvent public

Defined in `js/event/BaseEvent.js:173`

Duplicates an instance of an BaseEvent subclass.

Returns a new BaseEvent object that is a copy of the original instance of the BaseEvent object.

The new BaseEvent object includes all the properties of the original.

#### Returns:

BaseEvent:

#### Example:

    let cloneOfEvent = event.clone();

### `destroy` () Void public

Inherited from BaseObject: `js/BaseObject.js:55`

The purpose of the destroy method is to make an object ready for garbage collection. This should be thought of as a one way function. Once destroy is called no further methods should be called on the object or properties accessed. It is the responsibility of those who implement this function to stop all running Timers, all running Sounds, and take any other steps necessary to make an object eligible for garbage collection.

By default the destroy method will null out all properties of the class automatically. You should call destroy on other objects before calling the super.

#### Returns:

Void:

#### Example:

    destroy() {
         this.disable();

         this._childInstance.destroy();

         super.destroy();
    }

### `getQualifiedClassName` () String public

Inherited from BaseObject: `js/BaseObject.js:40`

Returns the fully qualified class name of an object.

#### Returns:

String:

Returns the class name.

#### Example:

    let someClass = new SomeClass();
    someClass.getQualifiedClassName();

    // SomeClass

### `stopImmediatePropagation` () public

Defined in `js/event/BaseEvent.js:158`

Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. This method takes effect immediately, and it affects event listeners in the current node. In contrast, the stopPropagation method doesn't take effect until all the event listeners in the current node finish processing.

#### Example:

    event.stopImmediatePropagation();

### `stopPropagation` () public

Defined in `js/event/BaseEvent.js:144`

Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. This method does not affect any event listeners in the current node (currentTarget). In contrast, the stopImmediatePropagation method prevents processing of event listeners in both the current node and subsequent nodes. Additional calls to this method have no effect.

#### Example:

    event.stopPropagation();

There are no methods that match your current filter settings. You can change your filter settings in the index section on this page. index

## Events

### `ACTIVATE`

String public static

Defined in `js/event/BaseEvent.js:195`

The BaseEvent.ACTIVATE constant defines the value of the type property of an activate event object.

### `ADDED`

String public static

Defined in `js/event/BaseEvent.js:204`

The BaseEvent.ADDED constant defines the value of the type property of an added event object.

### `ADDED_TO_STAGE`

String public static

Defined in `js/event/BaseEvent.js:213`

The BaseEvent.ADDED_TO_STAGE constant defines the value of the type property of an addedToStage event object.

### `CANCEL`

String public static

Defined in `js/event/BaseEvent.js:222`

The BaseEvent.CANCEL constant defines the value of the type property of a cancel event object.

### `CHANGE`

String public static

Defined in `js/event/BaseEvent.js:231`

The BaseEvent.CHANGE constant defines the value of the type property of a change event object.

### `CLEAR`

String public static

Defined in `js/event/BaseEvent.js:240`

The BaseEvent.CLEAR constant defines the value of the type property of a clear event object.

### `CLOSE`

String public static

Defined in `js/event/BaseEvent.js:249`

The BaseEvent.CLOSE constant defines the value of the type property of a close event object.

### `CLOSING`

String public static

Defined in `js/event/BaseEvent.js:258`

The BaseEvent.CLOSING constant defines the value of the type property of a closing event object.

### `COMPLETE`

String public static

Defined in `js/event/BaseEvent.js:267`

The BaseEvent.COMPLETE constant defines the value of the type property of a complete event object.

### `CONNECT`

String public static

Defined in `js/event/BaseEvent.js:276`

The BaseEvent.CONNECT constant defines the value of the type property of a connect event object.

### `COPY`

String public static

Defined in `js/event/BaseEvent.js:285`

Defines the value of the type property of a copy event object.

### `CUT`

String public static

Defined in `js/event/BaseEvent.js:294`

Defines the value of the type property of a cut event object.

### `DEACTIVATE`

String public static

Defined in `js/event/BaseEvent.js:303`

The BaseEvent.DEACTIVATE constant defines the value of the type property of a deactivate event object.

### `DISPLAYING`

String public static

Defined in `js/event/BaseEvent.js:312`

The BaseEvent.DISPLAYING constant defines the value of the type property of a displaying event object.

### `ENTER_FRAME`

String public static

Defined in `js/event/BaseEvent.js:321`

The BaseEvent.ENTER_FRAME constant defines the value of the type property of an enterFrame event object.

### `EXIT_FRAME`

String public static

Defined in `js/event/BaseEvent.js:330`

The BaseEvent.EXIT_FRAME constant defines the value of the type property of an exitFrame event object.

### `EXITING`

String public static

Defined in `js/event/BaseEvent.js:339`

The BaseEvent.EXITING constant defines the value of the type property of an exiting event object.

### `FULLSCREEN`

String public static

Defined in `js/event/BaseEvent.js:348`

The BaseEvent.FULL_SCREEN constant defines the value of the type property of a fullScreen event object.

### `INIT`

String public static

Defined in `js/event/BaseEvent.js:357`

The BaseEvent.INIT constant defines the value of the type property of an init event object.

### `NETWORK_CHANGE`

String public static

Defined in `js/event/BaseEvent.js:366`

The BaseEvent.NETWORK_CHANGE constant defines the value of the type property of a networkChange event object.

### `OPEN`

String public static

Defined in `js/event/BaseEvent.js:375`

The BaseEvent.OPEN constant defines the value of the type property of an open event object.

### `PASTE`

String public static

Defined in `js/event/BaseEvent.js:384`

The BaseEvent.PASTE constant defines the value of the type property of a paste event object.

### `PREPARING`

String public static

Defined in `js/event/BaseEvent.js:393`

The BaseEvent.PREPARING constant defines the value of the type property of a preparing event object.

### `REMOVED`

String public static

Defined in `js/event/BaseEvent.js:402`

The BaseEvent.REMOVED constant defines the value of the type property of a removed event object.

### `RENDER`

String public static

Defined in `js/event/BaseEvent.js:411`

The BaseEvent.RENDER constant defines the value of the type property of a render event object.

### `RESIZE`

String public static

Defined in `js/event/BaseEvent.js:420`

The BaseEvent.RESIZE constant defines the value of the type property of a resize event object.

### `SELECTED`

String public static

Defined in `js/event/BaseEvent.js:429`

The BaseEvent.SELECTED constant defines the value of the type property of a selected event object.

There are no events that match your current filter settings. You can change your filter settings in the index section on this page. index