# Not able to make two images go in a loop, and the mouse component does not make the routine end correctly

**URL:** <https://discourse.psychopy.org/t/not-able-to-make-two-images-go-in-a-loop-and-the-mouse-component-does-not-make-the-routine-end-correctly/42707>\
**Category:** Builder\
**Created:** [October 29, 2024, 12:14pm UTC](https://discourse.psychopy.org/t/not-able-to-make-two-images-go-in-a-loop-and-the-mouse-component-does-not-make-the-routine-end-correctly/42707 "2024-10-29T12:14:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hrabba](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/hrabba/32/43149_2.png) [@Hrabba](https://discourse.psychopy.org/u/Hrabba)\
**Post date:** [October 29, 2024, 12:14pm UTC](https://discourse.psychopy.org/t/not-able-to-make-two-images-go-in-a-loop-and-the-mouse-component-does-not-make-the-routine-end-correctly/42707/1 "2024-10-29T12:14:04Z")

</div>

If this template helps then use it. If not then just delete and start from scratch.

**OS** (e.g. Win10): mac os 15.1  
**PsychoPy version** (e.g. 1.84.x): v2021.2.3  
**Standard Standalone? (y/n)** If not then what?: yes  
**What are you trying to achieve?:** I am trying to make a version of a change blindness experiment where I have pairs of images that are identical except for one change in one of the images in the pair. I have defined 9 regions in the images ( I used polygons to make the regions ), and defined what region has the correct answer in a conditions file. I want them to go in a loop until the participant taps on the correct region of the images ( the region where the change in the images happens ). What I have now are two images that each show up one time, and do therefore not go in a loop. The mouse component also does not work, and makes the experiment end with an error.

**What did you try to make it work?:** I have tried many things, such as using a mouse component, coding etc. But I do not know how to use the code component as I am just starting to use psychopy, so I may have done it incorrectly.

**What specifically went wrong when you tried that?:** When I used the mouse component ( end routine on press = valid click, clickable stimuli = corAns ) this came in the runner = “File “/Users/hrafnhildur/Library/CloudStorage/OneDrive-Menntask\xfd/2 \xe1r - haust\xf6nn/Skynjunars\xe1lfr\xe6\xf0i/Lotuverkefni - Psychopy/Lotuverkefni copy\_lastrun.py”, line 415, in   
if obj.contains(mouse):  
AttributeError: ‘str’ object has no attribute ‘contains’”

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [October 29, 2024, 1:34pm UTC](https://discourse.psychopy.org/t/not-able-to-make-two-images-go-in-a-loop-and-the-mouse-component-does-not-make-the-routine-end-correctly/42707/2 "2024-10-29T13:34:05Z")

</div>

These threads might have your answer

> [@AttributeError: 'str' on clickable stimuli](https://discourse.psychopy.org/t/attributeerror-str-on-clickable-stimuli/25768):
>
> OS (e.g. Win10): Mac M1 PsychoPy version (e.g. 1.84.x): 2021.2.3 Standard Standalone? (y/n) If not then what?: What are you trying to achieve?:. I’m building an experiment where images pop on the screen one at a time and the response has to be made by mouse or touch. What did you try to make it work?: I have a condition file with - image column to present the images in spatial order and a valid column for reference of valid click. What specifically we…

> [@Mouse Response: Experiment exits on click](https://discourse.psychopy.org/t/mouse-response-experiment-exits-on-click/10908):
>
> I’m trying to build an experiment with a mouse response. There are two text fields that are automatically generated from the excel list. People hear a sound and have to click on one of the words. So far that works, but once I test the experiment and click on one of the words, it exits. I’ve tried pretty much all the settings there are for the mouse response, without success. This is the error message that I get: if obj.contains(mouse): AttributeError: 'str' object has no attribute 'contai…

---

<div class="post-metadata">

**Author:** ![Hrabba](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/hrabba/32/43149_2.png) [@Hrabba](https://discourse.psychopy.org/u/Hrabba)\
**Post date:** [October 31, 2024, 4:43pm UTC](https://discourse.psychopy.org/t/not-able-to-make-two-images-go-in-a-loop-and-the-mouse-component-does-not-make-the-routine-end-correctly/42707/3 "2024-10-31T16:43:29Z")

</div>

thank you so much!!
