# Apply methods to a specific object from ArrayList/indexes question

**URL:** <https://discourse.processing.org/t/apply-methods-to-a-specific-object-from-arraylist-indexes-question/27135>\
**Category:** Coding Questions\
**Created:** [January 17, 2021, 8:33am UTC](https://discourse.processing.org/t/apply-methods-to-a-specific-object-from-arraylist-indexes-question/27135 "2021-01-17T08:33:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elmpt](https://avatars.discourse-cdn.com/v4/letter/e/8491ac/32.png) [@Elmpt](https://discourse.processing.org/u/Elmpt)\
**Post date:** [January 17, 2021, 8:33am UTC](https://discourse.processing.org/t/apply-methods-to-a-specific-object-from-arraylist-indexes-question/27135/1 "2021-01-17T08:33:56Z")

</div>

Good morning, everyone!  
I have a new question regarding processing programming.  
What I am working on: I have an image object that is resized by user, then there is a lot of logic defining what happens with the object next: the object is moved, it causes some changes to objects of different type and then fades away( I need it to be deleted or so). The problem that I’m facing: I want to give a user a possibility to create several objects when the first one is still “in the game”. I assume using ArrayList, but I’m not sure how can I apply methods to a specified object and how can I delete used objects after fading as I need to know the index of the object. The question is: how to save index of just created object, so I could manipulate it. Does deleting from ArrayList affect indexes of still existing objects?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 17, 2021, 9:44am UTC](https://discourse.processing.org/t/apply-methods-to-a-specific-object-from-arraylist-indexes-question/27135/2 "2021-01-17T09:44:09Z")

</div>

You don’t have to start a new discussion every time

Please also show your entire code

And of course removing changes arraylist

You don’t have to delete an item you can reset it by setting y to -33
