Hi.
One of the problems is that the local variable stage is shadowing the global variable stage (which is created in the published output) and receiving two different values in sequence. Also there's a tick event that is not being used and it's not needed if the goal is to only move the car by click.
That being said, here is a suggestion:
var car = new createjs.Shape();
car.setBounds(0, 0, 50, 50);
car.size = car.getBounds();
car.graphics.beginFill("green").drawRect(0, 0, car.size.width, car.size.height);
car.speed = 5;
car.x = lib.properties.width / 2;
car.y = lib.properties.height - car.size.height;
stage.addChild(car);
this.stop(); // methods that change the display list may require the current timeline to be stopped
stage.on("stagemousedown", function()
{
car.x += car.speed;
});
Note that I set bounds to the shape because CreateJS doesn't provide a way of calculating a shape's bound automatically, added a speed property to the car itself for a more objected oriented approach and left the stage's framerate to be set directly in the IDE of Animate. I hope it helps. Regards, JC
... View more