asb14690
asb14690

Reputation: 1837

How can I add child on another child of canvas in create js

This code is not working and does not look appropriate for adding child on another child.

var child1 = new createjs.Shape();
child1.graphics.beginStroke("#0066FF").beginFill("#CCCCCC").drawRect(60,253, 25,24);
stage,addChild(child1);
stage.update();
var child2 = new createjs.Text("ABS","bold 22px Arial");
stage.addChild(child2);
stage.update();

Upvotes: 0

Views: 640

Answers (1)

Evan Knowles
Evan Knowles

Reputation: 7511

You appear to have a , instead of a .:

stage,addChild(child1);

Try

stage.addChild(child1);

Upvotes: 1

Related Questions