• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to click a drawing drawn from code(HTML5)

Enthusiast ,
Dec 29, 2020 Dec 29, 2020

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----")}); 
}
};

 

Views

157

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2020 Dec 29, 2020

Copy link to clipboard

Copied

Hi.

 

Have you tried adding the click listener to the shape instance?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 29, 2020 Dec 29, 2020

Copy link to clipboard

Copied

I'm practicing.

I want the code to generate everything.

I think I'll execute it with jiaose.dh().

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 29, 2020 Dec 29, 2020

Copy link to clipboard

Copied

I think that's a "No."

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 29, 2020 Dec 29, 2020

Copy link to clipboard

Copied

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 29, 2020 Dec 29, 2020

Copy link to clipboard

Copied

LATEST

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()

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines