composer help.

My game code works in the main.lua file but I wanted to make a menu screen so I did an placed my game code in level1.lua and so when I click play now on my menu it gives this error?

<stack traceback:

[C]: in function ‘error’

?: in function ‘gotoScene’

menu.lua:22: in function ‘_onRelease’

?: in function ‘?’

?: in function <?:1358>

?: in function <?:169>

You would have to show what line 22 is, also you have to place this line of code at the top of all scenes you need the Composer API:

local composer = require("composer")

Then you would use:

composer.gotoScene("your file name")

You would have to show what line 22 is, also you have to place this line of code at the top of all scenes you need the Composer API:

local composer = require("composer")

Then you would use:

composer.gotoScene("your file name")