getListenerById

Starts or stops a listener. Can also check whether a listener is started.

Syntax

ogscript.getListenerById (ID);

Parameters

Parameter

Type

Required

Description

ID

String

Yes

ID of the listener.

Returns

getListenerById returns an object representing the listener.

This object has three public methods you can call: start(), stop(), and isStarted().

The return depends on which of the three methods is used:

·         If the start() method is used, return is true if the listener started successfully; otherwise false.

·         If the stop() method is used, return is true if the listener stopped successfully; otherwise false.

·         If the isStarted() method is used, return is true if the listener is started; otherwise false.

Example

var myListener = ogscript.getListenerById (myId); myListener.start ();

myListener.stop ();

 

myListener.isStarted ();