| Reference | Downloads | Github

Change position of imageStim in PsychoJS

URL of experiment:
Description of the problem:
I’m developing an experiment on effort allocation where in each trial participants need to tap spacebar to move a figurer (an imageStim) and get reward. I used the “setPos()” to move the imageStim for each tapping. This way works in my Python code and also in the first trial of the online experiment. However, in the second trial, it shows an error says setPos is not a function (as shown in the screenshot).

Anyone have a clue how to solve the problem? Many thanks for your help in advance!

I think maybe you have a line in your JavaScript code componnent that says:

person.setPos = ([(-0.5), 0]);

What you’ve done there is accidentally set was was a function to be a JS array. Probably take away the = from that line

Hi Jon,

I took away the “=” and the code works now! Many thanks for your help!