Hello! My first post here, hopefully somebody can help. I'm doing some small banner work that includes AdHelper.js that Grant Skinner wrote a long time ago (See here: https://github.com/CreateJS/html5ads/tree/master/AdHelper) . I'm getting some errors on the following functions. Specifically, I'm getting errors for the following lines:
var originalFrame = ticker.frame; //record the original frame temporarily so we can revert
Error for above line:
Cannot read properties of undefined (reading 'frame')
It appears that when console.log'ing (ticker), that it's undefined. It looks like nothing should be 'wrong', and that it should be reading GSAP's .ticker, but I'm not sure why I'm getting undefined here. I know this code was definitely written a long time ago, so I have a suspicion that it's something small I'm doing wrong.
Not sure what the solution is here, but any help would be greatly appreciated.
p._sleep = function() {
if (!this.awake) { return; }
createjs.Ticker.paused = true;
if (this.tickListener) { createjs.Ticker.removeEventListener("tick", this.tickListener); }
window.TweenLite && TweenLite.ticker && TweenLite.ticker.sleep();
this.dispatchEvent("sleep");
this.awake = false;
};
p._wake = function() {
if (this.awake) { return; }
createjs.Ticker.paused = false;
if (this.tickListener) { createjs.Ticker.addEventListener("tick", this.tickListener); }
if (window.TweenLite) {
var ticker = TweenLite.ticker;
console.log(ticker);
var originalFrame = ticker.frame; //record the original frame temporarily so we can revert
ticker.frame = 1; //hack to make legacy versions of GSAP apply lag smoothing upon wake
ticker.wake(true);
ticker.frame = originalFrame;
}