Is this loop nested under some parent event? You need to explain the task.
The code you posted will destroy only one SpritesA instance at a time. Even if there are 100 sprite instances on the layout, the loop will repeat 101 times, but every time it will be picking the same single instance - closest to (0,0).
Then after 0.07s delay it will destroy this one instance 101 times :)
all the code is like this, when I want to make the code to work when a button is pressed, it doesn't happen, but it happens whenever I take the code out.
so it works smoothly as it is, what I want is to delete the top 5 objects when the button is pressed.