question on storyboard.newScene( "scene")

Hi all,
I am taking baby steps on trying out the storyboard api.
I can get it to work fine using the suggested approach of having separate modules for each of my scenes but when I try to use it all in the same module by passing a string scene name to the newScene function
I find that createScene event handler is never called for my first call to storyboard as in main.lua:

local storyboard = require( "storyboard" )
local scene = storyboard.newScene("scene")

storyboard.gotoScene( "scene", "fade", 400 )

The enterScene event handler is called but not the createScene handler.

Anything obvious I am doing wrong here?
Thanks,
-Dennis

You have to have to have it in separate modules... gotoScene("scenename") loads a file called "scenename.lua". That individual file has its own independent createScene, enterScene, etc.

Thanks for your reply but the docs indicate I can put all the stuff into one module, in my case main.lua by putting a scene name in the newScene call.
And it does work as I indicated except for the strange behavior I noted above.
I can get "around" the behavior by putting my initialization for the scene in enterScreen but the docs indicate createScene should be called by storyboard.
And I do notice that subsequent storyboard transitions to that scene do indeed call createScene. It's just the very first time I call that scene that createScene does not get entered.

views:1550 update:2012/1/3 13:02:13
corona forums © 2003-2011