I am using groups on a screen to hold a series of rectangles and text objects. I can remove the group from the display by calling the following: -
if BehGrp ~= nil then BehGrp:removeSelf() BehGrp = nil end
This works fine, however I have some code in another function that has to check / remove an object from the group: -
if Overlay ~= nil then Overlay:removeSelf() Overlay = nil end
This code works fine first time around, however when the first function has run the object called Overlay is not set to nil so the second function then tries to remove it (although it has already been removed).
Is there a way of checking if an object has already been removed (e.g. by the group:removeSelf call) as this call does not seem to set all of the objects it holds to nil…