This is a little off topic, but I just found something interesting. Thought I share, although it could be nothing, since I'm very new to javascript and haven't gotten around much yet...
Check this code:
var tlMain = new TimelineLite({onUpdate:updateSlider});
tlMain.add(tlRed, keyFramesRed[0].t)
.set("#redBox", curvePointsRed[0], keyFramesRed[0].t - 0.001);
curvePointsRed[0] is { x: 100, y: 100 }, so these can be used as vars for the tween. That code works in the pen, but not in my environment. I looked into the sources
p.set = function(target, vars, position) {
position = this._parseTimeOrLabel(position, 0, true);
if (vars.immediateRender == null) {
vars.immediateRender = (position === this._time && !this._paused);
}
return this.add( new TweenLite(target, 0, vars), position);
};
and it complans that vars.immediateRender is undefined, thus creating an error.
If I call the set method like this
var tlMain = new TimelineLite({onUpdate:updateSlider});
tlMain.add(tlRed, keyFramesRed[0].t)
.set("#redBox", {x:curvePointsRed[0].x, y:curvePointsRed[0].y}, keyFramesRed[0].t - 0.001);
everything works.
I like being lazy, so using curvePointsRed[0] directly would be my first choice. Would it make sense for you to check for 'undefined' instead of 'null' inside of the set method? I guess the problem is on my side anyway, since it does work flawlessly in the pen. Maybe it's the fault of the closure compiler which i'm using, who knows...