无论如何改变.to调用之间形状的颜色?

时间:2015-12-17 04:00:21

标签: javascript canvas createjs easeljs

Codepen

JS:

function init(){
        var stage   = new createjs.Stage("demoCanvas");
        var circle  = new Array();
        var randomColor = ["#019875", "#26C281", "#2ABB9B", "#36D7B7", "#1BA39C"];

        for(var x = 0; x < 300; x++){
            circle[x] = new createjs.Shape();
            circle[x].graphics.beginFill( randomColor[ Math.floor(Math.random() * 5) ]).drawCircle( Math.floor(Math.random() * 800), 0, 10);
            stage.addChild(circle[x]);

            createjs.Tween.get(circle[x], {loop: true})
                .to({y: Math.floor(Math.random() * 400), x: Math.floor(Math.random() * 1) }, 4000, createjs.Ease.backIn)
        .to({y: Math.floor(Math.random() * 700), x: Math.floor(Math.random() * 1) }, 8000, createjs.Ease.backIn)
        }

        createjs.Ticker.addEventListener("tick", stage);
}

我正在尝试更改上面代码笔中圆圈的颜色,当圈子在第二个。来电时。这可能吗?如果没有,那将是一种解决方法?

0 个答案:

没有答案