Extend Tumult Hype with JavaScript: hypeDocument.extensions

↑ extension index


hypeDocument.stopCustomBehaviourTicker

Hype Pro Extension: Stops an active ticker broadcasting a custom behaviour.


/**
* hypeDocument.stopCustomBehaviourTicker 1.1
* @param {String} behaviour name to stop firing
*/
hypeDocument.stopCustomBehaviourTicker = function(behaviour){
    if (this.hasOwnProperty('_ticker')) {
        if (this._ticker.hasOwnProperty(behaviour)) {
            clearInterval( this._ticker[behaviour]);
            delete this._ticker[behaviour];
        }
    }
}

Usage:

hypeDocument.stopCustomBehaviourTicker('enterFrame');

Updates:
1.0 inital release
1.1 code cleanup

1 Like