How to go to another lua file Corona SDK?

I am doing a little game, I would like to know how to go to another lua file in Corona SDK. First of all, I have a main.lua with the first level. I am trying this, make a main.lua with the menu, and level.lua with the first level, but I do not know how to go from main.lua to level1.lua. I read that dofile function does not work in Corona SDK.

Goodbye!!

use storyboard api

How can I use it?

Look through the documentation, as well as throughout the site.  There are tons of examples available

Try this

http://www.coronalabs.com/blog/2012/08/21/storyboard-basic-usage/

http://www.coronalabs.com/resources/tutorials/user-interface-scenes-and-widgets/

My functions move the objects that are on createScene function. How my function acces to my objects?

Thanks for answering :wink:

I’m not sure I understand the question.  Can you post some code that would help us understand what your looking to do?

Here is my code:

pastebin.com/YMfQ04MZ

I would like to change the scene in the function eliminar9.

I’m assuming that’s your main.lua?

If so you need to include the code to require in the storyboard module.  Then you would use the storyboard.gotoScene() function to get to new scene.  The file you’re loading must be in a very specific format to be considered a storyboard scene.  You need to read all of those tutorials to try and understand what’s involved.

That said, most of the code in the pastebin above should probably be in it’s own scene file and a minimal amount in your main.lua

use storyboard api

How can I use it?

Look through the documentation, as well as throughout the site.  There are tons of examples available

Try this

http://www.coronalabs.com/blog/2012/08/21/storyboard-basic-usage/

http://www.coronalabs.com/resources/tutorials/user-interface-scenes-and-widgets/

My functions move the objects that are on createScene function. How my function acces to my objects?

Thanks for answering :wink:

I’m not sure I understand the question.  Can you post some code that would help us understand what your looking to do?

Here is my code:

pastebin.com/YMfQ04MZ

I would like to change the scene in the function eliminar9.

I’m assuming that’s your main.lua?

If so you need to include the code to require in the storyboard module.  Then you would use the storyboard.gotoScene() function to get to new scene.  The file you’re loading must be in a very specific format to be considered a storyboard scene.  You need to read all of those tutorials to try and understand what’s involved.

That said, most of the code in the pastebin above should probably be in it’s own scene file and a minimal amount in your main.lua