Screen stuck due to a code component

URL of experiment:
Description of the problem:
Hi all,

I have a code component which enables participants to replay sounds by clicking buttons on the screen. It runs well offline. I chose Auto > JS code type, but screen stuck online and the error message is: core.wait is not a function.

My code is:
if (mouse.isPressedIn(polygon_8)) {;

I cannot figure out which function to use online, thus help would be appreciated!


core.wait is PsychoPy function, not a PsychoJS function, see here.

Best wishes Jens

Thanks Jens! Is there any alternative function that I can use instead of core.wait?

You could put the sound into a separate feedback routine.

Alternatively, start the sound and save the value of t and then check if t > savedT+x and savedT > 0 then stop the sound and reset savedT to 0

x should be the known length of sound 8

Thanks Wakefield! I’ll try and hope it can resolve my problem.