# mousePressed to change image multiple times

**URL:** <https://discourse.processing.org/t/mousepressed-to-change-image-multiple-times/6275>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [December 4, 2018, 3:59am UTC](https://discourse.processing.org/t/mousepressed-to-change-image-multiple-times/6275 "2018-12-04T03:59:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Missmew72](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Missmew72](https://discourse.processing.org/u/Missmew72)\
**Post date:** [December 4, 2018, 3:59am UTC](https://discourse.processing.org/t/mousepressed-to-change-image-multiple-times/6275/1 "2018-12-04T03:59:45Z")

</div>

Hi, so I am making a code for a school project. It’s nothing too fancy but I’m very new to the program and have been trying to find a way around the issue but ave had no luck. Basically I have an image that is there when I start the program. What I want to do is when I click the mouse, replace that image with another image. I’ve been trying to do that through the mousePressed function and haven’t been able to, any suggestions?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 4, 2018, 4:06am UTC](https://discourse.processing.org/t/mousepressed-to-change-image-multiple-times/6275/2 "2018-12-04T04:06:23Z")

</div>

[Studio.ProcessingTogether.com/sp/pad/export/ro.9Iaf6privOouM](http://Studio.ProcessingTogether.com/sp/pad/export/ro.9Iaf6privOouM)
