# How to remove array object when mouse pressed

**URL:** <https://discourse.processing.org/t/how-to-remove-array-object-when-mouse-pressed/3406>\
**Category:** Coding Questions\
**Created:** [September 10, 2018, 4:26am UTC](https://discourse.processing.org/t/how-to-remove-array-object-when-mouse-pressed/3406 "2018-09-10T04:26:14Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [September 10, 2018, 6:15am UTC](https://discourse.processing.org/t/how-to-remove-array-object-when-mouse-pressed/3406/6 "2018-09-10T06:15:46Z")

</div>

As a general rule, load all of the assets your sketch is gonna use in **setup()**, before **draw()** begins, storing them in global variables. 💡

Classes should request already loaded assets rather than loading them on their own. ⚠

---

_[View the full topic](https://discourse.processing.org/t/how-to-remove-array-object-when-mouse-pressed/3406)._
