When I use a tween, there is a constant memory leak, until the application is stopped.
Performance also falls.
This is due to the "cache".
shape.cache(-0.1, -0.1, width, height);
Here is my simple code, maybe I have something wrong?
window.onload = function() {
var canvas = document.getElementById("canvas"), stage = new createjs.Stage(canvas);
function createShape(radius, width, height, color){
var shape = new createjs.Shape(), g = shape.graphics;
stage.addChild(shape);
g.beginFill(color);
radius > 0 ? g.drawCircle(0, 0, radius) : g.drawRect(0,0, width, height);
g.endFill();
shape.setTransform((width/2),height/2,1,1,0,0,0,width/2,height/2);
shape.cache(-0.1, -0.1, width, height);
return shape;
}
var Layer_1 = createShape(0,556,409,"#b8aa51");
Layer_1.x = 275;
Layer_1.y = 198.5;
var main = new TimelineMax( { onComplete: again } );
main.set(Layer_1, {x:275, y:198.5, scaleX:1, scaleY:1, rotation:0, alpha:1, easel:{tint:"#000000", tintAmount:1} } );
var Layer_1_tl = new TimelineMax();
main.add(Layer_1_tl, 0);
Layer_1_tl.to(Layer_1,0.9, { easel:{tint:"#e13a3a", tintAmount:1}, ease:Linear.easeNone } );
Layer_1_tl.to(Layer_1,1.1, { easel:{tint:"#75b851", tintAmount:1}, ease:Linear.easeNone } );
Layer_1_tl.to(Layer_1,1.1, { easel:{tint:"#b8aa51", tintAmount:1}, ease:Linear.easeNone } );
TweenLite.ticker.addEventListener("tick", stage.update, stage);
stage.update();
function again() {main.restart()}
}