console
var canvas = document.querySelector('#canvas');
var stage = new createjs.Stage(canvas);
var container = new createjs.Container();
var container2 = new createjs.Container();
var shape = new createjs.Shape();
shape.graphics.beginFill('red').drawCircle(50, 50, 30);
var shape2 = new createjs.Shape();
shape2.graphics.beginFill('blue').drawCircle(50, 50, 30);
container.addChild(shape);
container2.addChild(shape2);
container.addEventListener('mousedown', function(e) {
stage.removeAllEventListeners();
container.addEventListener('pressmove', function(e) {
container.x = e.stageX;
console.log('container.x: ' + container.x);
console.log('stage.x: ' + stage.x);
stage.update();
})
})
stage.addEventListener('stagemousedown', function(){
stage.addEventListener('stagemousemove', function(e) {
stage.x = e.stageX;
console.log('stage.x: ' + stage.x);
stage.update();
})
})
stage.addEventListener('stagemouseup', function(){
stage.removeAllEventListeners();
})
stage.addChild(container,container2);
stage.update();
<canvas id="canvas">
</canvas>
canvas {
background: #ff00ff;
}