so from a flash background I use groups like movieclips…
I tried this…
local function test(group)
print("test1 ",group.childgroup);
end
local maingroup = display.newGroup();
local childgroup = display.newGroup();
maingroup:insert(childgroup);
test(maingroup);
but that prints a null value.
The only way I could do it was first insert the childgroup and then add it as a variable to maingroup
local function test(group)
print("test1 ",group.childgroup);
print("test2 ",group.child);
end
local maingroup = display.newGroup();
local childgroup = display.newGroup();
maingroup.child = childgroup;
maingroup:insert(childgroup);
test(maingroup);
so test1 print still prints nil.
but test2 prints out the table and I can use that.
Is that the only way to ref it? [import]uid: 102413 topic_id: 26558 reply_id: 326558[/import]