how to navigate from one scene to another

hello and thank you for reading… I have 3 scene in my game main.lua, orange.lua and apple.lua

my main.lua contains

display.setStatusBar( display.HiddenStatusBar ) local composer = require('composer') composer.gotoScene( 'apple' ,{effect = 'fade', time = 500, } ) -- when i start the game my main screen will take me to the apple screen and that -- work just fine. so far so good

my apple.lua contian

local composer = require( "composer" ) local scene = composer.newScene() local bg local title local button local function changeScenes() --this below composer gotoScene does not work composer.gotoScene('scene\_b' , {effect = 'slideLeft', time = 500} ) --if i comment the above and add this below print('it works') --this work end -- create() function scene:create( event ) local sceneGroup = self.view --remember to always insert the object into the sceneGroup so that way it get destroy when it move to a different scene bg = display.newRect(display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight) bg:setFillColor(.3,.5,.8) sceneGroup:insert(bg) title = display.newText('Hello World!', display.contentCenterX, display.contentCenterY -200,'Default', 40) title:setFillColor( .4,.9,.1 ) sceneGroup:insert(title) button = display.newRect(display.contentCenterX, display.contentHeight - 200, display.contentWidth \* .2, display.contentHeight \* .09) button:setFillColor(.3,.8,.1) sceneGroup:insert(button) button:addEventListener( 'tap', changeScenes) -- Code here runs when the scene is first created but has not yet appeared on screen end --[[and i have the scene:show, scene:hide, scene:destroy just a template and it's attach to an event listener and it does return true everything work great at this point]]

for my orange.lua file i just have the template only. the game run but it is when i click the button i get the error message saying that attempt to concatenate global 'sceneName(a nil value)

can someone help me with this problem 

update i change from sublime to atom text editor and it works

That error means that there is no scene under that name. It could be that you have a typo or you haven’t specified the correct path.

In your case, since you said that you have three scenes: “main”, “orange” and “apple” (main.lua isn’t actually a scene, or at least it shouldn’t be). But, in your code you are trying to go to a scene called “scene_b”. Now, either there is no file called “scene_b.lua” or you haven’t properly set up the composer scene there, either which will result in a crash.

oh i know why now. at first i was trying to navigate to scene_b and then i save it with different name but i guess it didn’t save so i decided to close the project and open it with a different text editor and i guess the save take place when that happen and it work