You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the documentation: "If an onClick handler is set on a container, it will receive the event if any of its children are clicked." However I tried this:
var startButton = new Container();
buttonBg = new Shape();
buttonBg.graphics.f("#A6A6A6").ss(1).s("#0F0").rr(55,55,55,25,5);
var label = new Text("Start", "16px Arial", "#000");
label.textAlign = "center";
label.x = 82;
label.y = 73;
label.maxWidth = 25;
label.alpha = 0.7;
startButton.addChild(buttonBg,label);
stage.addChild(startButton);
startButton.onClick = function(evt) { console.log("Start Pressed"); }
Nothing happened. But this worked:
buttonBg.onClick = function(evt) { console.log("Start Pressed"); }
The text was updated successfully, but these errors were encountered:
This issue should be fixed in the latest source version, committed this morning. Please let me know if you continue to experience this bug with the new source.
From the documentation: "If an onClick handler is set on a container, it will receive the event if any of its children are clicked." However I tried this:
var startButton = new Container();
buttonBg = new Shape();
buttonBg.graphics.f("#A6A6A6").ss(1).s("#0F0").rr(55,55,55,25,5);
var label = new Text("Start", "16px Arial", "#000");
label.textAlign = "center";
label.x = 82;
label.y = 73;
label.maxWidth = 25;
label.alpha = 0.7;
startButton.addChild(buttonBg,label);
stage.addChild(startButton);
startButton.onClick = function(evt) { console.log("Start Pressed"); }
Nothing happened. But this worked:
buttonBg.onClick = function(evt) { console.log("Start Pressed"); }
The text was updated successfully, but these errors were encountered: