And I checked docs it says what enterFrame must be with Runtime:
Well, what line is the error actually occurring on? We don’t know what line 179 is in your code from your initial post.
Now I just get an error what doesn’t say line…(I put all listeners outside composer functions)
In SpaceMap.lua 5th line there is goto scene function
And in lobby.lua 41st line there is same goto scene function
Any help?
At some stage you have to learn to debug. Somewhere you are adding a listener that is nil. So how about everywhere in your code where you are about to add a listener, do print(object, listenerToAdd) first. If either show in the console as nil, there’s your problem. Then you can trace backwards through your code to find out why it is nil. It will usually be a scoping issue.
object:addEventListener("touch", touchListener) -- this will break local touchListener = function (event) end object:addEventListener("touch", touchListener) -- this will not
Sorry but that’s nonsense, semi-colons are completely optional in lua and serve no practical purpose.
:huh: I tested it and now it works without “;”
Very strange…