Copy link to clipboard
Copied
Like what.
I'd like to click on the jiaose pop-up prompt
var jiaose = {
name: "gw",
dh: function() {
var shape = new createjs.Shape(new createjs.Graphics().beginFill("#ff0000").drawRect(5, 5, 50, 50));
this.addChild(shape);
this.on("click", function(){alert("ss----")});
}
};
Copy link to clipboard
Copied
Hi.
Have you tried adding the click listener to the shape instance?
Copy link to clipboard
Copied
I'm practicing.
I want the code to generate everything.
I think I'll execute it with jiaose.dh().
Copy link to clipboard
Copied
I think that's a "No."
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I found and rewritten 1 code(Insert (body label))。
But this code cannot be inserted into the “stage”。
If I can insert it into the stage (canvas), that's what I want to do
var uvw=function(){
var x="hi.", b;
(b = document.createElement("button")).innerHTML = "click me,This is the button";
b.setAttribute("onclick", "alert('"+x+"')");
document.body.appendChild(b);
}
uvw()