EventListener

The EventListener class is a proxy by which JavaScript functions may be nominated to handle events. Additionally, it implements the EventListener interface.

Methods

The following methods are available on the EventListener class. Additionally, it implements the EventListener interface.

Constructor

Constructs an instance of the EventListener class.

Parameters: Optional JavaScript function to be called from the proxy's implementation of handleEvent.

Return Value: none

Example Usage

function handleEvent(evt)
{
  ...
}

  ...

  var l = new EventListener(handleEvent);

Destroy

Destroy the instance and free its resources.

Parameters: none

Return Value: none

Example Usage

function handleEvent(evt)
{
  ...
}

  ...

  var l = new EventListener(handleEvent);

  ...

  l.Destroy();

SetHandler

Nominates the JavaScript method to be used as an event handler by this instance. Overrides any handler nominated by preceding calls to this method or in the constructor.

Parameters: JavaScript function to be called from the proxy's implementation of handleEvent.

Return Value: none

Example Usage

function handleEvent(evt)
{
  ...
}

  ...

  var l = new EventListener();
  l.SetHandler(handleEvent);