Pretty new, Struggling, Please help me

okay so for college I need to create an app, designing it was simple enough and getting all the graphics sorted, easy. I can create the scenes that I need so far, but “so far” is the first page and thats it…

Im struggling to link my “Scenes” I believe they are called? Ive been watching a tutorial that uses the Director Class (im using the condensed version http://developer.coronalabs.com/code/director-class-24-lines-code), but for the life of me I cant get it to move between scenes properly.

Where am I going wrong?! I just keep getting Nil Value errors

(screenshot of error message - http://gyazo.com/aa997339fac62210a3f38c05e93ff01a)

Ive removed some of the additional stuff I had set up but not moved onto yet in my code

main.lua

function changeScene(e)

    if (e.phase == “ended”) then

        director:changeScene(e.target.scene)

    end

end

local director = require(“director”)

director:changeScene(“mainmenu”)

mainmenu.lua

module (…, package.seeall)

function new()

    local menuGroup = display.newGroup()

    

        local background = display.newImage(“images/menu_background.png”, 160, 240)

        local menucircle = display.newImage(“images/menucircle.png”, 160, 240)

        local options = display.newImage(“images/options_button.png”, 290, 40)

        options.scene = “options”

        

        options:addEventListener(“touch”, changeScene)

        

        menuGroup:insert(background)

        menuGroup:insert(menucircle)

        menuGroup:insert(options)

        

    return menuGroup

end

options.lua

module (…, package.seeall)

function new()

    local optionsGroup = display.newGroup()

    

        local background = display.newImage(“images/background.png”, 160, 240)

        local menucircle = display.newImage(“images/menucircle.png”, 160, 240)

        

        local home_button = display.newImage(“images/home_button.png”, 200, 30)

        

        home_button.scene = “mainmenu”

        

        home_button:addEventListener(“touch”, changeScene)

    

        optionsGroup:insert(background)

        optionsGroup:insert(menucircle)

        optionsGroup:insert(home_button)

        

    return optionsGroup

end

Suggest you use Storyboard instead of Director. Storyboard is the newer scene management system developed and supported by  Corona Labs. You can find some good tutorials on this site and samples on your Corona installation / Samples folder. Good luck with your project.

Suggest you use Storyboard instead of Director. Storyboard is the newer scene management system developed and supported by  Corona Labs. You can find some good tutorials on this site and samples on your Corona installation / Samples folder. Good luck with your project.

It took me 3 weeks to get a heck of just changing scenes and giving a restart button for my app. You should go with composer api, storyboard and director are old things now… When you will download the new sdk you will get a sample code of composer api… Let me know if you need any help with it.

Composer is newer. It’s not difficult ; I would write an app to create three simple scenes and switch between them so you understand it.

Corona Labs provide some excellent sample code already installed on your PC/Mac. Look for the Samples directory and see examples specifically in the Interface directory. Hope this helps.

Thanks guys Ill give composer a try :slight_smile:

It took me 3 weeks to get a heck of just changing scenes and giving a restart button for my app. You should go with composer api, storyboard and director are old things now… When you will download the new sdk you will get a sample code of composer api… Let me know if you need any help with it.

Composer is newer. It’s not difficult ; I would write an app to create three simple scenes and switch between them so you understand it.

Corona Labs provide some excellent sample code already installed on your PC/Mac. Look for the Samples directory and see examples specifically in the Interface directory. Hope this helps.

Thanks guys Ill give composer a try :slight_smile: