THis is starting to drive me nuts.
I just added a new lua file to my project called storePage.lua and right now it’s super basic with just a couple forward declarations, the createScene that makes a background, and an enterScene that purges the menu scene.
I have all the right requirements, I basically copy/pasted from another scene.
On my menu scene I have a button that calls:
storyboard.gotoScene( “storePage”, { effect=“slideLeft”, time=800} )
and I keep getting this error:
File: ?
Attempt to concatenate global ‘sceneName’ (a nil value)
stack traceback:
[C]: ?
[C]: in function 'error’
?: in function 'gotoScene’
/Users/Steve/Google Drive/Trig Calc Project/menu.lua:54: in function '_onRelease’
?: in function '?'
?: in function <?:1056>
?: in function <?:218>
if I replace the “storePage” with another scene, it works fine. So I’m assuming there is something wrong with the storePage.lua file. But as I said it’s so basic I can’t see any issues.
storePage.lua
local widget = require ( "widget" ) local storyboard = require( "storyboard" ) local scene = storyboard.newScene() local utility = require( "utility" ) Load Forward Variables local sineText, speedText, boltText local sineDesc, speedDesc, boltDesc local sineBuy, speedBuy, boltBuy local sineBought, speedBought, boltBought local back local mySettings, restoring --Listeners local function onKeyEvent( event ) local phase = event.phase local keyName = event.keyName if ( "back" == keyName and phase == "up" ) then timer.performWithDelay(100,goBack2,1) end return true end function scene:createScene( event ) local screenGroup = self.view Runtime:addEventListener( "key", onKeyEvent ) back = display.newImageRect ( screenGroup, "backgrounds/storeBack.png", 570, 360 ) back.x = display.contentCenterX back.y = display.contentCenterY backEdgeX = back.contentBounds.xMin backEdgeY = back.contentBounds.yMin end function scene:enterScene( event ) local group = self.view --storyboard.purgeScene( "menu" ) mySettings = utility.loadTable("settings.json") if mySettings == nil then mySettings = {} mySettings.sinePaid = false mySettings.speedPaid = false mySettings.boltPaid = false utility.saveTable(mySettings, "settings.json") end end function scene:exitScene( event ) local group = self.view Runtime:removeEventListener( "key", onKeyEvent ) end scene:addEventListener( "createScene", scene ) scene:addEventListener( "enterScene", scene ) scene:addEventListener( "exitScene", scene )
storePage.lua exists and is in the right folder, and case is all correct.