Stephen, there are two totally separate systems for managing scenes in Corona SDK. The 3rd Party “Director Class” and the officially supported Storyboard. They do not work together. If you see code that looks like:
module(..., package.seeall)
function new()
local localGroup = display.newGroup()
...
return localGroup
end
and
director.changeScene("somescene")
then the assumption is you are using Director to do this. Your main.lua has to call the right functions to require the director class and initialize it. With out that, functions like director.changeScene() won’t work.
Storyboard on the other hand looks like this:
local storyboard = require( "storyboard" )
local scene = storyboard.newScene()
...
function scene:createScene( event )
local group = self.view
end
function scene:enterScene( event )
local group = self.view
end
function scene:exitScene( event )
local group = self.view
end
function scene:destroyScene( event )
local group = self.view
end
function scene:overlayEnded( event )
local group = self.view
end
scene:addEventListener( "createScene", scene )
scene:addEventListener( "enterScene", scene )
scene:addEventListener( "exitScene", scene )
scene:addEventListener( "destroyScene", scene )
scene:addEventListener( "overlayEnded", scene )
return scene
and has calls like this:
storyboard.gotoScene("somescene")
Likewise you have to require the storyboard code in your main.lua and goto your first scene.
Director and Storyboard do very similar things but cannot work together. Settle on one way or the other, but not both. If you are doing storyboard and you find some code someone else wrote that’s done in Director, you have to convert it to storyboard methods.
[import]uid: 199310 topic_id: 34875 reply_id: 138630[/import]