Does anyone know why i get the error:
“Desktop/MixtureFolder/play.lua:138: attempt to index field ‘naviButton’ (a nil value)”
from the following code? Line 138 is the one trying to name the display object.
[lua]local overlayLayer = display.newGroup()
local navButton = {}
for i = 1, 7 do
if (i == 1) then
navButton = display.newText( “Close” , 0, 0, buttonFont, 40 )
navButton.y = (screenH2 - 220)
hideButtons()
elseif (i > 1 and i <= 4) then
navButton = display.newText( “More” , 0, 0, buttonFont, 40 )
navButton.y = (screenH2 - 220) + ((i - 1) * 400)
elseif (i > 4 and i <= 7) then
navButton = display.newText( “Less” , 0, 0, buttonFont, 40 )
navButton.y = (screenH2 - 220) + ((i - 4) * 400)
end
navButton.x = screenW2
navButton:setTextColor(textR, textG, textB)
overlayLayer:insert(navButton)
overlayLayer.naviButton…i = navButton
end[/lua] [import]uid: 13522 topic_id: 1716 reply_id: 27073[/import]