0
Component Parameters Click Image
New Here
,
/t5/animate-discussions/component-parameters-click-image/td-p/13055647
Jul 07, 2022
Jul 07, 2022
Copy link to clipboard
Copied
How can I make the image clickable?
not working
How can I write code with document.queryselector?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/animate-discussions/component-parameters-click-image/m-p/13055698#M355425
Jul 07, 2022
Jul 07, 2022
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

