Hi @espace3d
Your error is because your syntax is wrong. It should be like your first example.
Anyway, based on your first code you can do this way.
You can use id in widget.newButton to name your button
REQUIRED------------------------------------------------------------------------------------------------------------------------------------- local widget = require( "widget" ) --TEXT INFORMATION------------------------------------------------------------------------------------------------------------------------------------- local textInfo1 = display.newText("", 240,105,native.systemFont,100) textInfo1:setFillColor(1,0,0) isButtonClick = 0 local button = {} local function buttonTouch( event ) local target = event.target if ( event.phase == "began" and isButtonClick == 0 ) then if target.id == "LeftButton" then textInfo1.text = "("..target.id..")" elseif target.id == "RightButton" then textInfo1.text = "("..target.id..")" end end return textInfo1 end button[1] = widget.newButton { width = 240, height = 120, defaultFile = "buttoninactif.png.png", overFile = "buttonpressed.png", label = "button", id = "LeftButton", onEvent = buttonTouch } button[1].x = 53 button[1].y = 225 button[1].xScale = 0.5 button[1]:setLabel( ) button[2] = widget.newButton { width = 240, height = 120, defaultFile = "buttoninactif.png.png", overFile = "buttonpressed.png", label = "button", id = "RightButton", onEvent = buttonTouch } button[2].x = 428.5 button[2].y = 225 button[2].xScale = 0.5 button[2]:setLabel( )
Good Luck!
burhan