Hey all,
After my main.lua script passes control to splash.lua, I need splash to call a function inside main.lua. For that I’ve simply added:
local main = require("main")
to the top of splash.lua. Further down in the file I’ve then attempted to invoke a call to the onFirstView function (which resides in main.lua) which calls composer.gotoScene(“view1”) along with a few other bits of code (setting up the tab bar, sounds etc).
When the splash script has done its thing, the call to this main local variable is hit (I’ve tried a variety of calls that have been suggested in other Q&A boards) and the error I get is one that appears to suggest that require(“main”) isn’t doing what I want it to do:
“splash.lua 92: attempt to index upvalue ‘main’ (a boolean value)”
I’m sure it’s something simple newbies trip up over on their adventures through Lua - anyone care to point me in the right direction? Thanks