I have a student that wants a button click to choose a random canvas (two options). Is that possible at his point or is that coming later in Unit 5? Thanks
It might be a bit beyond Unit 3 but assuming the canvases are named canvas1 and canvas2 then this should work:
onEvent(“button1”, “click”, function(event) {
setActiveCanvas(“canvas”+randomNumber(1, 2));
});
Thank you!
Kyle Kuhlers