xai
July 7, 2020, 4:18pm
1
URL of experiment: https://pavlovia.org/jaycbcs1/esst_
Description of the problem: text and image is not appearing on screen online
I am using .setImage and goXO1.setText(‘X’) and also tried goXO1.text = ‘X’
but not working
any suggestion…
Thanks in advance…
In what way is it not working? Please show your code component and the routine so we can see the relative positions.
xai
July 7, 2020, 10:43pm
3
it is not showing text and image that i am setting in the code section.
I added these inline in the begin routine
as this same code is working in offiline without giving any error.
I think it need some modification for online running as in js script.
if stimXO1[trialN] == 1:
goXO1.setText(‘X’)
else:
goXO1.setText(‘O’)
if GNG1[trialN] == 1:
#print (“trial number”,trialN)
#print (“image”, eFace[emoId1[trialN]])
stop1.setImage(eFace[int(emoId1[int(trialN)]]))
Thanks
Have you tried print(trialN) etc?
Personally I’ve found that .text= works better than.setText() but I think that both should work and you say you’ve tried both .
You have some commented out print commands . They have , where U would expect +
Did the confirm that your image is correct?
Are you getting any error messages?
Is there anything else that might be hiding the images?
xai
July 9, 2020, 1:25am
5
Hello Thanks for reply
i tried both but letter not appearing.
print i tried in offline, where it worked…
is this possible to see online, please let me know.
There is no error message, program is running smoothly.
Thank You
You really should show us the JavaScript version as well then.
xai
July 9, 2020, 1:30pm
8
It seems code written in Begin Routine is not visible in js code online.
xai
July 9, 2020, 1:32pm
9
Thanks a lot @wakecarter for this information.
xai
July 9, 2020, 1:47pm
10
sorry to say but i am unable to see code of begin routine section in .js online file and also in web IDE.
Thanks for your support.
Have you made your experiment in Builder?
If so, please could you show screen shots of your code components?
xai
July 9, 2020, 7:49pm
13
Now some issue resolved as i saved images as image.jpg and in online html.resources saved as image.jpg.jpg.
now i am using this code stop1.setImage(None) which was working offline but now it seems problem here.
in some trials i am setting an image but on some trials i don’t need image.
any suggestion regarding this would be helpful.
Thank You
To hide an image use stop1.setAutoDraw(False)
Check the syntax in my crib sheet