Is there a way to quickly remove all the objects onscreen without looping through all the display groups (and without putting them in groups?)
Thanks! [import]uid: 8782 topic_id: 3030 reply_id: 303030[/import]
There is this function that was included with the Director class in the code exchange section. You feed it a group and the level with which it iterates. So, if you had all your objects in one group, you’d call:
local function cleanGroups ( curGroup, level )
if curGroup.numChildren then
while curGroup.numChildren \> 0 do
cleanGroups ( curGroup[curGroup.numChildren], level+1 )
end
if level \> 0 then
curGroup:removeSelf()
end
else
curGroup:removeSelf()
curGroup = nil
end
end
As: cleanGroups( myGroup, 0 )
…to remove all objects recursively through the children. Finally, it would remove myGroup, as well.
[import]uid: 4454 topic_id: 3030 reply_id: 8866[/import]