Adding array of images to the stage with easeljs and preloadjs

746 views Asked by At

Different images should appear on stage. For this I am trying to create an array and put it in a container but id doesn't work. What am I doing wrong? Thanks

canvas = document.getElementById("testCanvas");
stage = new createjs.Stage(canvas);
var queue = new createjs.LoadQueue(true);
var imagesPic = queue.loadManifest(["image1.png", "image2.png","image3.png","image4.png"]);

var w = canvas.width = window.innerWidth;
var h = canvas.height = window.innerHeight;

container = new createjs.Container();
stage.addChild(container);

captureContainers = [];
captureIndex = 0;

for (var i=0; i<50; i++) {
        container.addChild(imagesPic);  
}

for (i=0; i<100; i++) {
        var captureContainer = new createjs.Container();
        captureContainer.cache(0,0,w,h);
        captureContainers.push(captureContainer);
}
0

There are 0 answers