-
<protected> new Event()
-
This is the constructor for the Event objects being emitted by the PccViewer. Refer to PCCViewer.PccViewer.on for details on events.
Members
-
<static, readonly> target :PccViewer
-
ECMA5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For details, refer to PCCViewer.Event.getTarget.
Type:
- PccViewer
-
<static, readonly> type :string
-
ECMA5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For details, refer to PCCViewer.Event.getType.
Type:
- string
Methods
-
getTarget() → {PccViewer}
-
Gets the PCCViewer object that initiated the event
Returns:
- Type
- PccViewer
Example
var viewerObj; function windowChangedHandler (event) { console.log("WindowModeChanged event"); //see the use .getTarget() method below if(event.getTarget() !== viewerObj){ alert("The "WindowModeChanged" event did not originate from expected instance of the viewer object"); } } //subscribe to the user action WindowModeChanged event viewerObj = viewer.on("WindowModeChanged", windowChangedHandler);
-
getType() → {string}
-
Gets the name of the event type. This will be the same value as the eventType argument to the .on() function.
- See:
-
- PCCViewer.EventType for event types.
Returns:
A string containing event type.- Type
- string
Example
function windowChangedHandler (event) { console.log("WindowModeChanged event"); //get the eventType and compare it with the value of the EventType enumeration @see PCCViewer.EventType if(event.getType() !== PCCViewer.EventType.WindowModeChanged){ alert("The event type did not match"); } } //subscribe to the user Action WindowModeChanged event viewer.on(PCCViewer.EventType.WindowChangedHandler, windowChangedHandler);