Scene switch fail !

I am trying to switch scenes from main.lua to menu.lua and you can guess why . This is my code .this is the error

I am getting.

CODE:

local storyboard = require( "storyboard" ) local widget = require( "widget" ) -- Load Corona 'ads' library local ads = require "ads" -- Hide the status bar display.setStatusBar( display.HiddenStatusBar ) -- The name of the ad provider. local provider = "admob" -- Your application ID local appID = "Bouncy balls" [lua=auto:0] storyboard.gotoScene( "menu" ) [lua=auto:0] 

error:

main.lua:17:unexpected symbol near ‘[’

what is the problem here. what is my code corrected why am I getting this error when no symbol is near ‘[’ !

Thank you,

[lua=auto:0]

this should not be in your code.  It’s code for posting in the forums to maintain your syntax highighting.  In your app, it is not valid Lua code.

Rob

Also, this has little to do with Corona Editor, so I’m moving the post.

[quote=“rob,post:2,topic:334140”]

[lua=auto:0]

this should not be in your code. It’s code for posting in the forums to maintain your syntax highighting. In your app, it is not valid Lua code.

Rob [/quote]

Rob when i just put storyboard. GotoScene
I get an error that says error in function
Goto scene in lua mainchunk. What should i do about that

Please copy and paste the error from the terminal/command window that starts with the simulator into the post here.  Look at the line number from the error and copy/paste the code around that line number.   I need to see the code after you updated it.

Rob

code:

local storyboard = require( "storyboard" ) local widget = require( "widget" ) -- Load Corona 'ads' library local ads = require "ads" -- Hide the status bar display.setStatusBar( display.HiddenStatusBar ) -- The name of the ad provider. local provider = "admob" -- Your application ID local appID = "Bouncy balls" storyboard.gotoScene( "menu" ) 

error :

?:0: attempt to concatenate global ‘sceneName’ (a nil value)

stack traceback:

                 ?: in function ‘gotoScene’

                  main.lua:17:in main chunk

Do you want to relaunch project ?

Why am I getting this error? What changes do I need ?

Thank you.

Thanks for posting the code correctly, but you did not copy/paste the error message from the command/terminal window.  When you start Corona SDK, not only do we open the simulator, we open another windows.  On a Mac, it’s a terminal window and is most likely white with back text.  On Windows, it opens a “cmd” prompt window.  It’s black with white text.  That window should have more messages in it than the popup dialog message has.

I (well You!) need to see the text in that window.  There is likely an error in your menu.lua that should be reported there.  Either that or you don’t have a menu.lua at all.

Rob

I have found out the problem it said i did not put the storyboard plugin. I am sorry i thought you only had to require it in the text editor is this analysis correct. If so what is the storyboard plugin

There isn’t a storyboard plugin.  You should just need to be able to require it, like you’re doing in main.lua.  Your scene has to require it too.

This is why I’m asking you to copy and paste the error message from the terminal window.  I need to see everything that’s there.

Rob

The cmd prompt does not let me open it all the way . So in result I cant copy and paste it . And even if it was all the way open I still couldn’t cause my PC ( windows 8 ) wont allow me to ( cause the cursor doesn’t turn into the skinny cursor) .

What should I do about this?

Thank you.

I have solved my halfway Rob . I am not getting an error anymore . But I will post my new problem in another topic .

Thank you.

I don’t have a windows machine with me, but you should be able to scroll the window up and down.  And to copy/paste, you  have to either click or right click in one of the top corners and a menu will popup that lets you select the text.  You can then  do what you would normally do.

Rob

[lua=auto:0]

this should not be in your code.  It’s code for posting in the forums to maintain your syntax highighting.  In your app, it is not valid Lua code.

Rob

Also, this has little to do with Corona Editor, so I’m moving the post.

[quote=“rob,post:13,topic:334140”]

[lua=auto:0]

this should not be in your code. It’s code for posting in the forums to maintain your syntax highighting. In your app, it is not valid Lua code.

Rob [/quote]

Rob when i just put storyboard. GotoScene
I get an error that says error in function
Goto scene in lua mainchunk. What should i do about that

Please copy and paste the error from the terminal/command window that starts with the simulator into the post here.  Look at the line number from the error and copy/paste the code around that line number.   I need to see the code after you updated it.

Rob

code:

local storyboard = require( "storyboard" ) local widget = require( "widget" ) -- Load Corona 'ads' library local ads = require "ads" -- Hide the status bar display.setStatusBar( display.HiddenStatusBar ) -- The name of the ad provider. local provider = "admob" -- Your application ID local appID = "Bouncy balls" storyboard.gotoScene( "menu" ) 

error :

?:0: attempt to concatenate global ‘sceneName’ (a nil value)

stack traceback:

                 ?: in function ‘gotoScene’

                  main.lua:17:in main chunk

Do you want to relaunch project ?

Why am I getting this error? What changes do I need ?

Thank you.

Thanks for posting the code correctly, but you did not copy/paste the error message from the command/terminal window.  When you start Corona SDK, not only do we open the simulator, we open another windows.  On a Mac, it’s a terminal window and is most likely white with back text.  On Windows, it opens a “cmd” prompt window.  It’s black with white text.  That window should have more messages in it than the popup dialog message has.

I (well You!) need to see the text in that window.  There is likely an error in your menu.lua that should be reported there.  Either that or you don’t have a menu.lua at all.

Rob

I have found out the problem it said i did not put the storyboard plugin. I am sorry i thought you only had to require it in the text editor is this analysis correct. If so what is the storyboard plugin

There isn’t a storyboard plugin.  You should just need to be able to require it, like you’re doing in main.lua.  Your scene has to require it too.

This is why I’m asking you to copy and paste the error message from the terminal window.  I need to see everything that’s there.

Rob