Can't switch scenes

Hi, im new to corona lua and i can’t switch between two scenes pops up an error saying there a nil value at the 2 line in my main…

Main :

[lua]local composer = require (“composer”)

Composer.gotoScene (“menu2”)[/lua] 

And on the menu2.lua theres just a print hello world… 

Hi @filippo66627,

Use

composer.gotoScene ("menu2")

Have a nice day:)

ldurniat

ye did that but doesnt work :frowning:

As discussed on the other thread, a couple of us were able to run your project (albeit a stripped back version). The error about the nil value is because the menu2.lua file is not properly setup for Composer. That is the only way this error can occur. You can’t just have a composer file that has print (“hello world”), it needs all the composer functions too. 

1.png

Yea but even if i add the composers funcyion in the new scene anda just add a background it wont show up

Let’s go back to the beginning. If you run a Corona sample app, do those work?

Here you have scene template.

You could also simply start your simulator, then select New Project and then select “Physics Based Game” or “eBook” and Corona will generate a project for you that properly utilises composer. Then you can learn or copy from there.

Thank you all guys i fugered out how to switch scenes