I am getting the following error:
Runtime error ui.lua:31: attempt to index local ‘coverTap’ (a function value) stack traceback:
ui.lua:31: in main chunk
[C]: in function 'require’Runtime error: ui.lua:31: attempt to index local ‘coverTap’ (a function value)
stack traceback:
ui.lua:31: in main chunk
[C]: in function ‘require’
I have the following code:
main.lua
local ui = require("ui")
local cover = display.newImage ("Page0.jpg")
ui.lua
--Declair the Tap Menu, including top menu, Dropdown Menu, and bottom Menu
local topMenu = display.newImage ("tapMenuBtn.png",0,0)
topMenu.alpha = 0
local topMenuDD = display.newImage ("tapMenuBtnDD.png",0,150)
topMenuDD.alpha = 0
local contents = display.newImage ("contentsBtn.png",0,824)
contents.alpha = 0
local settings = display.newImage ("settingsBtn.png",256,824)
settings.alpha = 0
local more = display.newImage ("moreBtn.png",512,824)
more.alpha = 0
--Functions, tap functions to toggle top menu
local function coverTap ( event )
if topMenu.alpha == 1 then
topMenu.alpha = 0
topMenuDD.alpha = 0
contents.alpha = 0
settings.alpha = 0
more.alpha = 0
elseif topMenu.alpha == 0 then
topMenu.alpha = 1
contents.alpha = 1
settings.alpha = 1
more.alpha = 1
return true
end
end
coverTap:addEventListener ("tap", coverTap)
--Functions, tap functions to toggle Dropdown Menu
local function topMenuTap ( event )
if topMenuDD.alpha == 1 then
topMenuDD.alpha = 0
elseif topMenuDD.alpha == 0 then
topMenuDD.alpha = 1
return true
end
end
topMenu:addEventListener ("tap", topMenuTap)
It was working, I didnt change anything and it stopped working. I dont know what happened. [import]uid: 112297 topic_id: 19684 reply_id: 319684[/import]