unregisterEventHandler

[ Function ]

public unregisterEventHandler(
    name: 'animationstart' | 'animationend' | 'animationiteration',
    callback: (event: TcHmi.Animation.AnimationEvent) => void
): this;

Unregister a callback for an animation event.

Parameter

Name

Type

Description

name

string

The name of the previously registered event.

'animationstart' is triggered when the animation starts, after the delay has expired.

'animationend' is triggered when the animation ends.

'animationiteration' is triggered when the animation starts in a new repetition.

callback

(event: TcHmi.Animation.AnimationEvent) => void

The previously registered function. Must be the same reference as the callback parameter previously passed to registerEventHandler.

Return value

Type

Description

TcHmi.Animation

This method returns its parent object to allow concatenation of method calls.

Sample - JavaScript

var animation = new TcHmi.Animation('ViewDesktopBeckhoffLogo', '');
var eventHandler = function (event) {
    console.log('Animation started: ' + event.animationName);
};
animation.registerEventHandler('animationstart', eventHandler);
var handlers = animation.eventHandlers(); // [{ name: 'animationstart', callback: f(event) }]
animation.unregisterEventHandler('animationstart', eventHandler);
handlers = animation.eventHandlers(); // []
unregisterEventHandler 1:

Available from 1.8