HELP! scene transitioning

Hi there!

I recently started coding a app wich requires some screen transtioning.

what I have so far is my home/welcome page done.

now, on my home screen I have 3 buttons I made with .widget

What I want to do is make it so that once the begginner button is clicked/tapped it moves on to the next screen wich will have 3 more buttons.

ALSO: I have setup both main.lua and my next page bcat.lua to work with storyboard.

I tried making a function that did that on release…and it doesnt come up with a error but it doesnt do anyhing. I can click it any it does nothing.

if someone can give me some advice that would be great. down below is what I have so far for my code ON BOTH PAGES.

main.lua

 


 main.lua


local storyboard = require “storyboard”

storyboard.purgeOnSceneChange = true

local widget = require “widget”

display.setStatusBar(display.HiddenStatusBar)

– load scenetemplate.lua

storyboard.gotoScene( “scenetemplate” )

– Add any objects that should appear on all scenes below (e.g. tab bar, hud, etc.):

local backround = display.newImage(“backround.jpg”)

backround:setReferencePoint(display.CentreReferencePoint)

backround. x = 0

backround. y = 210

 

local text = display.newText(“Welcome!” , 85,05,nativesystemfont,35)

local text = display.newText(“My level of knowledge is…” , 23,55,nativesystemfont,25)

 

 

local function bcat(event)

storyboard.gotoScene(“bcat”)

end

 

local Beginner = widget.newButton { label=“Beginner”, onRelease bcat}

Beginner.x = 160

Beginner.y = 150

 

local Moderate = widget.newButton {label=“Moderate”}

Moderate.x = 160

Moderate.y = 275

 

local Expert = widget.newButton {label=“Expert”}

Expert.x = 160

Expert.y = 400

bcat.lua

 
 

local storyboard = require (“storyboard”)

 

local scene = storyboard.newScene()

 

function scene:createScene(event)

 

local backround = display.newImage(“backround.jpg”)

self.view:insert(backround)

backround:setReferencePoint(display.CentreReferencePoint)

backround. x = 0

backround. y = 210

end

scene:addEventListener(“createScene” , scene)

return scene

if someone could please look over what i have and tell me what im doing worng that would be great!!!

in your beginner button code it should be onRelease = bcat

When I do that I get a error

Which is???

sorry…i was wrong…

when there is no = i get a error

when i put in the = i get nothing…

so when i have onRelease = bcat i get nothing when i click.

no errors no nothing

In your main.lua you are missing quite a bit of the storyboard code.  Please see the template here and make sure you have the required event listeners.  Also be sure to move your display objects to the createScene function, and add them to the scene’s group.

When I click here it doesn’t bring me a template. It brings me here http://docs.coronalabs.com/api/library/storyboard/index.html#scenetemplate.lua

Can you copy my main.lua and edit it to what I need and then post that???

And my display objects in bcat.lua are in the create scene function

No.  Read through some tutorials and the documentation, and learn how storyboard works.  

I said main.lua, not bcat

That is the right link.  Make sure you are also logged into the corona website

Actually main.lua should have very little storyboard code.  main.lua is for initializing things and as a springboard to storyboard scenes.

main.lua should pretty much have:

local storyboard = require(“storyboard”)

and 

storyboard.gotoScene(“menu”) – or whatever your first scene is

 

Any display objects you create in main.lua won’t be part of a storyboard scene and will sit above your storyboard scene.  Generally I don’t create any display things in main.lua unless I’m building a tabBar based business app where I want the tabBar to stay on the screen regardless of what scene is actually playing.

@Rob Miracle

That’s exactly what I have in my main.lua

But an I missing anything from from my bcat.lua.
And can I create a function that on release of a button that next scene appears

But you have this in your main.lua:

local backround = display.newImage(“backround.jpg”)

 

backround:setReferencePoint(display.CentreReferencePoint)

 

backround. x = 0

backround. y = 210

those will sit in front of any storyboard scenes and hide anything behind them.

in your beginner button code it should be onRelease = bcat

When I do that I get a error

Which is???

sorry…i was wrong…

when there is no = i get a error

when i put in the = i get nothing…

so when i have onRelease = bcat i get nothing when i click.

no errors no nothing

In your main.lua you are missing quite a bit of the storyboard code.  Please see the template here and make sure you have the required event listeners.  Also be sure to move your display objects to the createScene function, and add them to the scene’s group.