I have set a tap eventlistener on a button with a function to handle it but i am unable to remove it completely, this is the code
local function dlevel(event) titlegroup:removeSelf() titlegroup=nil playbutt:removeEventListener("tap", dlevel) require("th\_b") dispscb() return true end
this the button with tap event added
function disptitle() titlegroup=display.newGroup() tscreen=display.newImage("images/gtitle.jpg",x,y) titlegroup:insert(tscreen) playbutt=display.newImage("images/start.png",x,y) titlegroup:insert(playbutt) playbutt:addEventListener("tap",dlevel) end
while i am playing my game on real device(android) i am getting the runtime error " attempt to index upvalue “titlegroup” a nil value" , so i am suspecting that though i had set eventlistener to nil but still it’s being called for no reason, am i doing anything wrong ? :mellow: