Deleting pictures/commands using a button

I want to use a button command to delete another or the original button before using another to bring to bring it back (like a reset button) but the delete command only works in the same line of code ex.

local x = displayImageRect(y)

delete.display(x)

only this works. however I wish for the command to delete another picture in order to replace a button with the round 2,3,4 and 5 buttons because a button on top of another will stop both.

You can remove images with display.remove( object )

I meant that code

It doesn’t work unless if it’s in the same line of code with the local displayImageRect

@david, this sounds like there will be a simple solution.  However, you will need to post the code you are using and remember to format the code with the “<>” button in the menu bar