How to address a member of a group by name....

I want to do something like the following but I can’t figure to go about doing it:

screenGroup = display.newGroup() backgroundImageGroup = display.newGroup() screenGroup:insert ( 1, backgroundImageGroup ) screenGroup.backgroundImageGroup:toFront() -- Or what ever I may need to do with it.

So far I can only figure out how to addres it as “screenGroup[1]:toFront()” or “backgroundImageGroup:toFront()” 

Thanks for the help!

You can manually add a reference to it. So in your example.

[lua]

screenGroup = display.newGroup()

backgroundImageGroup = display.newGroup()

screenGroup.backgroundImageGroup = backgroundImageGroup 

screenGroup:insert ( 1, backgroundImageGroup ) 

screenGroup.backgroundImageGroup:toFront() 

[/lua]

Just add the following line:

screenGroup.backgroundImageGroup = backgroundImageGroup

Thanks. 

You can manually add a reference to it. So in your example.

[lua]

screenGroup = display.newGroup()

backgroundImageGroup = display.newGroup()

screenGroup.backgroundImageGroup = backgroundImageGroup 

screenGroup:insert ( 1, backgroundImageGroup ) 

screenGroup.backgroundImageGroup:toFront() 

[/lua]

Just add the following line:

screenGroup.backgroundImageGroup = backgroundImageGroup

Thanks.