Hi, im new to corona. I’m getting an error when i try to add another button to the createScene(event). anyone can help me?
this is the error;
?:0: attempt to index nil value
stack traceback:
?:in function"?’
?:in function <?:1259>
(tail call:?
?:in function<?:122>
(tail call): ?
?:in function ‘dispatchEvent’
?:in function ‘gotoScene’
and this is my Code for it
function scene:createScene(event)
screenGroup = self.view
background = display.newImage(“Images/Background.png”);
background.x = display.contentCenterX;
background.y = display.contentCenterY;
screenGroup:insert(background)
local StartButton = widget.newButton
{
left = 230,
top = 235,
defaultFile = “Buttons/Start.png”,
overFile = “Buttons/StartOff.png”,
onEvent = StartButtonEventHandler,
}
StartButton:addEventListener(“tap”,StartButton)
local OptionsButton = widget.newButton
{
left = 80,
top = 80,
defaultFile = “Buttons/Options.png”,
overFile = “Button/OptionsOff.png”,
onEvent = OptionsButtonEventHandler,
}
OptionsButton:addEventListener(“tap”,OptionsButton)
buttonGroup:insert(StartButton)
buttonGroup:insert(OptionsButton)