How to set a display.newGroup ID?

How can i set a unique id to a display.newGroup() in Corona?

i.e: As we do on a button and ask for a event.target.id of the button that is clicked

I have a number of groups and i call :addEventListener to hear if a group is clicked, 

but when i click a specific one i want to removeEventListener for the other groups.

I think i need an id per each to group all them under a function.

Thanks in advance

Hi @blablu1212,

A Corona display group is a Lua table internally, so just like other tables, you can just add an ID to it after you create it.

[lua]

local myDisplayGroup = display.newGroup()

myDisplayGroup.id = “first” – or a number, or any other valid value

[/lua]

Best regards,

Brent

Hi @blablu1212,

A Corona display group is a Lua table internally, so just like other tables, you can just add an ID to it after you create it.

[lua]

local myDisplayGroup = display.newGroup()

myDisplayGroup.id = “first” – or a number, or any other valid value

[/lua]

Best regards,

Brent