I need to create and later recreate a large number of display objects. Putting them all in the same group seems natural. Removing the group should remove all its child display objects, but I am confused on ownership.
If I do:
[code]
g = display.newGroup()
…
t = display.newText(…)
t is owned by the current stage. If I then do:
[code]
g:insert(t)
is t removed from the current stage and only owned by g or do I need to do:
[code]
display.getCurrentStage:remove(t)
for when I do:
[code]
display.getCurrentStage:remove(g)
I want t and any other display objects in g to go away and be eventually reclaimed by the garbage collector.
Is there a better way to do this? What I would really like to do is:
[code]
g = display.newGroup()
…
t = g:newText(…)
…
display.getCurrentStage:remove(g)
[import]uid: 1813 topic_id: 295 reply_id: 300295[/import]