Copy link to clipboard
Copied
How can I make the image clickable?
not working
How can I write code with document.queryselector?
Copy link to clipboard
Copied
Hi.
You could write something like this:
stage.on("drawend", function() // components are not immediately available so we have to listen for the drawend event
{
var image = document.getElementById("yourComponent"); // "yourComponent" is the instance name of the Image component instance in the Properties panel
image.addEventListener("click", function()
{
console.log("clicked");
});
}, null, true);
But do you really need a component for this? Why just don't turn the bitmap into a symbol and add a listener to it?
Regards,
JC