HELP!! Change Scene Not Working accordingly

I currently have 3 scenes…in my game app… the game usually starts with a “startpage” this page contains 3 buttons … 1. Play (to load the game scene) ,2. Help(to Load the help scene 3. credits(to load the credits scene)
the issue is

  • when I click the play button instead of the game scene to come up, the credits scene comes up
  • when i click the help button the instead of help to come up, the credits scene comes up instead of help scene.
  • when i click the credits button the credit scene comes up.(works well here)
    Code:

START PAGE.lua
module(…, package.seeall)

function new()
local localGroup = display.newGroup()

local background = display.newImage(“background1.png”)

local b_play = display.newImage(“buttons/button.png”)
b_play.x = 190
b_play.y = 190
b_play.Scene = “help”
local b_help = display.newImage(“buttons/help.png”)
b_help.x = 190
b_help.y = 250
b_help.Scene = “help”

local b_thanks = display.newImage(“buttons/thanks.png”)
b_thanks.x = 190
b_thanks.y = 310
b_thanks.Scene = “help”
function changeScene(e)
if (e.phase == “ended”) then
director:changeScene(e.target.Scene)

end
end

localGroup:insert(background)
localGroup:insert(b_play)
localGroup:insert(b_help)
localGroup:insert(b_thanks)

b_play:addEventListener(“touch”, changeScene)
b_help:addEventListener(“touch”, changeScene)
b_thanks:addEventListener(“touch”, changeScene)

return localGroup

end

CREDITS SCENE
module(…, package.seeall)

function new()
local localGroup = display.newGroup()
local background = display.newImage(“background1.png”)
localGroup:insert(background)
return localGroup

end

HELP SCENE
module(…, package.seeall)

function new()
local localGroup = display.newGroup()
local background = display.newImage(“background1.png”)
localGroup:insert(background)

return localGroup

end
Can sum1 Plz HELP??

[import]uid: 202019 topic_id: 37091 reply_id: 67091[/import]

I prefer storyboard to manage scene changes, but looking at your code I notice that:

b\_play.Scene = "help"  
b\_help.Scene = "help"  
b\_thanks.Scene = "help"  

Are all pointing to the same place [import]uid: 208811 topic_id: 37091 reply_id: 145341[/import]

True, good catch!

Also don’t use the name changeScene because it’s used by Director and you might have problems…
[import]uid: 12407 topic_id: 37091 reply_id: 145362[/import]

yup… i just noticed that , i have changed but still does not work… do u know of any links that have storyboard tutorials at all??? [import]uid: 202019 topic_id: 37091 reply_id: 145681[/import]

do you mean i shouldnt use the name changeScene in my function??? [import]uid: 202019 topic_id: 37091 reply_id: 145682[/import]

@Abraham, you should have a look at the source code for the Corona storyboard tutorial. It will show you how to layout for your lua files to use storyboard and is fairly well commented to describe what is happening. [import]uid: 208811 topic_id: 37091 reply_id: 145755[/import]

I prefer storyboard to manage scene changes, but looking at your code I notice that:

b\_play.Scene = "help"  
b\_help.Scene = "help"  
b\_thanks.Scene = "help"  

Are all pointing to the same place [import]uid: 208811 topic_id: 37091 reply_id: 145341[/import]

True, good catch!

Also don’t use the name changeScene because it’s used by Director and you might have problems…
[import]uid: 12407 topic_id: 37091 reply_id: 145362[/import]

yup… i just noticed that , i have changed but still does not work… do u know of any links that have storyboard tutorials at all??? [import]uid: 202019 topic_id: 37091 reply_id: 145681[/import]

do you mean i shouldnt use the name changeScene in my function??? [import]uid: 202019 topic_id: 37091 reply_id: 145682[/import]

@Abraham, you should have a look at the source code for the Corona storyboard tutorial. It will show you how to layout for your lua files to use storyboard and is fairly well commented to describe what is happening. [import]uid: 208811 topic_id: 37091 reply_id: 145755[/import]