I want to be able to click on an image to provide more info on the picture - currently using spacexdata crew info, driven by the spacexdata API and JSON results, clicking on the crew member picture e.g. https://i.imgur.com/ooaayWf.png. I am perfectly able to load that URL into a canvas using drawImageURL(url).
However, I can’t seem to get onEvent(“myCanvas”,“click”, handleCanvasClickFunction) to work - it doesn’t ever generate an event when I click on the canvas.
As a workaround, I tried using a Button with an image instead, but this refuses to load the image URL! It appears not to be able to load any image programmatically. It does load the image if I specify it in the Design mode.
Is this a bug/feature, or am I missing something - on both counts!
- clicking on a canvas doesn’t raise an event
- setImageURL() won’t load URLs programmatically
The setImageURL problem is demonstrated in Code.org - App Lab