splash.lua not loading

hi,

happy new year to everyone!

i got trouble to load splash.lua, i use it to make intro, to show the studio name before getting to the menu.

 here is the main.lua

[lua]-- hide the status bar
display.setStatusBar( display.HiddenStatusBar )

– include the Corona “storyboard” module
local storyboard = require “storyboard”

– load menu screen
storyboard.gotoScene( “splash”, “fade”, 500 )
storyboard.isDebug = true[/lua]

here is the splash.lua

[lua]-------------------------------------------------------------

– splash.lua


local storyboard = require “storyboard”

local storyboard = display.newImage( “dreamscape.jpg” ) --Your splash image

local gotonextscene = function()

    storyboard.gotoScene( “menu”,“crossFade”, 500 ) --Your next scene

    

end

local sceneTimer = timer.performWithDelay( 3000, gotonextscene, 1 ) --Splash timer[/lua]

the splash.lua file is in the same folder as main and menu

i don t understand why it s not loading properly! can someone point me out?

On line 8 of splash.lua you are overwriting the storyboard assignment you made on line 6. 

So basically by doing that, “storyboard” is no longer what you expect and when it goes to make the call to gotoScene on line 11 it can’t.

Change line 8 to a different variable name, for instance: local splashImage

Then your code will work.

Further reading: http://www.lua.org/pil/4.2.html

Also is that all of your splash.lua?  If so it’s missing many of the elements that make up a storyboard scene file.

thanks for the both of you. i am really a newbie and coding isnt quite my cup of tea… i am decent with graphism, game and level design but nit coding…so i am trying my best to get a good start with it. with my splash.lua, i just want to show the intro to show the studio page in fade out before getting the menu. is it wrong?

That is the right way to do a splash screen.  And if the splash.lua was properly setup, it would work for you. 

This is the minimal code for any storyboard scene:

local storyboard = require( "storyboard" ) local scene = storyboard.newScene() function scene:createScene(event)     local group = self.view     --     -- Create any display objects here     -- end function scene:enterScene( event )     local group = self.view     --     -- Start any timers, transitions.     -- create any native objects     -- end function scene:exitScene( event )     local group = self.view     --     -- Clean up native objects     -- cancel any timers, tranistions     -- end function scene:destroyScene( event )     local group = self.view     --     -- end scene:addEventListener( "createScene", scene ) scene:addEventListener( "enterScene", scene ) scene:addEventListener( "exitScene", scene ) scene:addEventListener( "destroyScene", scene ) return scene

Keep in mind that main.lua is not a storyboard scene.  You load storyboard there and then use it to goto your first scene.  So main.lua just needs:

local storyboard = require( "storyboard" ) -- other init code storyboard.gotoScene("splash")

The scene’s have to create the scene (2nd line), setup the four basic event handlers for creating the scene, entering the scene, exiting the scene and the rarely used destroyScene.  Then it has to return the scene object at the end.  Without those you don’t have a storyboard scene.  

Rob

On line 8 of splash.lua you are overwriting the storyboard assignment you made on line 6. 

So basically by doing that, “storyboard” is no longer what you expect and when it goes to make the call to gotoScene on line 11 it can’t.

Change line 8 to a different variable name, for instance: local splashImage

Then your code will work.

Further reading: http://www.lua.org/pil/4.2.html

Also is that all of your splash.lua?  If so it’s missing many of the elements that make up a storyboard scene file.

thanks for the both of you. i am really a newbie and coding isnt quite my cup of tea… i am decent with graphism, game and level design but nit coding…so i am trying my best to get a good start with it. with my splash.lua, i just want to show the intro to show the studio page in fade out before getting the menu. is it wrong?

That is the right way to do a splash screen.  And if the splash.lua was properly setup, it would work for you. 

This is the minimal code for any storyboard scene:

local storyboard = require( "storyboard" ) local scene = storyboard.newScene() function scene:createScene(event)     local group = self.view     --     -- Create any display objects here     -- end function scene:enterScene( event )     local group = self.view     --     -- Start any timers, transitions.     -- create any native objects     -- end function scene:exitScene( event )     local group = self.view     --     -- Clean up native objects     -- cancel any timers, tranistions     -- end function scene:destroyScene( event )     local group = self.view     --     -- end scene:addEventListener( "createScene", scene ) scene:addEventListener( "enterScene", scene ) scene:addEventListener( "exitScene", scene ) scene:addEventListener( "destroyScene", scene ) return scene

Keep in mind that main.lua is not a storyboard scene.  You load storyboard there and then use it to goto your first scene.  So main.lua just needs:

local storyboard = require( "storyboard" ) -- other init code storyboard.gotoScene("splash")

The scene’s have to create the scene (2nd line), setup the four basic event handlers for creating the scene, entering the scene, exiting the scene and the rarely used destroyScene.  Then it has to return the scene object at the end.  Without those you don’t have a storyboard scene.  

Rob