remove display objects

I understand how to remove display objects but was unsure of where exactly to do this? is it not until scene:destroy?

If you add them to your scene group you don’t need to remove them manually - Composer will do it for you.

If you create an object and want to delete it before the end of the scene, remember it’s also a good idea to nil out any variable that you’ve used as a reference.  This is because that, although removeSelf() removes an object from the scene, there will still be some fragments of data associated with the object left hanging around.  These won’t be removed until the variable is set to nil.

--Early in the scene, create a rectangle and store it in a variable defined elsewhere rect = display.newRect(0, 0, 100, 100) ... --Later on delete it and completely remove any associated data rect:removeSelf() rect=nil

If you add them to your scene group you don’t need to remove them manually - Composer will do it for you.

If you create an object and want to delete it before the end of the scene, remember it’s also a good idea to nil out any variable that you’ve used as a reference.  This is because that, although removeSelf() removes an object from the scene, there will still be some fragments of data associated with the object left hanging around.  These won’t be removed until the variable is set to nil.

--Early in the scene, create a rectangle and store it in a variable defined elsewhere rect = display.newRect(0, 0, 100, 100) ... --Later on delete it and completely remove any associated data rect:removeSelf() rect=nil