Hi, still working on Simon. Here’s the link to my codepen: https://codepen.io/glennqhurd/pen/EQqxKe
Today’s problem is that I’m getting an error when I use the click events to play a sound. The error is:
Uncaught TypeError: Cannot read property ‘play’ of undefined
at VM95 pen.js:164
It’s referring to the code errorSound.sound.play() at line 164. However, I defined the variable on line 12. I also use the exact code with a different variable in a different function called buttonFlash which is line 70 and 73. The sounds play when buttonFlash is called but not with a click event. Also, I was trying this with the variable buttonSound1 at first which is also used by buttonFlash and got the same error as above. I’m not sure if it’s a scoping issue or something else that I’m missing entirely. Any help is appreciated.