I've got a problem using the apply() method from Function.prototype.apply().
I'm trying to create a series of drawings on my CreateJS stage by passing arrays of arguments to the bezierCurveTo method using apply(). This will allow me to loop through about a hundred such sets of arguments and draw a full picture.
However, apply() isn't working on the bezierCurveTo method (it works on moveTo and lineTo).
Instead, I get
TypeError: this.append is not a function
Does anyone have any ideas about why this might be happening? I'm not clear on why it works on the other methods and not bezierCurveTo.
var myData = {
curveTo: [214.1, 853.1, 327.1, 903.7, 451.8, 903.7],
};
var sha = new createjs.Shape();
sha.graphics.bezierCurveTo.apply(myData.curveTo);
Thank you.
Edit:
Stack trace shows this is where the error lies:
p.moveTo = function(x, y) {
return this.append(new G.MoveTo(x,y), true);
};