???Am I doing something wrong???

The coding that I’m using for the storyboard isn’t right, because it doesn’t show my app in the simulator.
Can you help me to correct my mistakes?!

main.lua

[code]display.setStatusBar( display.HiddenStatusBar )

local storyboard = require “storyboard”

storyboard.gotoScene( “menu” )[/code]

menu.lua

[code]local storyboard = require “storyboard”
local scene = storyboard.newScene()
local widget = require “widget”
display.setStatusBar( display.HiddenStatusBar )

local button, button2, button3, button4, button5, background, ball, white, myText, myText2

local function onButtonRelease( self, event )
if event.phase == “release” then
storyboard.gotoScene( “sp” )
return true
end
end

local function onButtonRelease2( self, event )
if event.phase == “release” then
storyboard.gotoScene( “mp” )
return true
end
end

local function onButtonRelease3( self, event )
if event.phase == “release” then
storyboard.gotoScene( “pm” )
return true
end
end

local function onButtonRelease4( self, event )
if event.phase == “release” then
storyboard.gotoScene( “tbm” )
return true
end
end

local function onButtonRelease5( self, event )
if event.phase == “release” then
storyboard.gotoScene( “s” )
return true
end
end

function scene:createScene( event )
local screenGroup = self.view

background = display.newImage ( “SkySoccer Grass.jpg” )

ball = display.newImage( “SkySoccer Ball.gif” )
ball.x = display.contentWidth / 2
screenGroup:insert( ball )

white = display.newImage( “witteachtergrond.png” )
white.x = display.contentWidth / 1.3
white.y = display.contentWidth / 25
screenGroup:insert( white )

myText = display.newText( “SkySoccer”, 0, 0, native.systemFont, 50 )
myText.x = display.contentCenterX
myText.y = display.contentWidth / 4.5
myText:setTextColor( 255, 0, 0 )
screenGroup:insert( myText )

myText2 = display.newText( “BroekieNetwork”, 0, 0, native.systemFont, 20 )
myText2.x = display.contentWidth / 1.3
myText2.y = display.contentWidth / 25
myText2:setTextColor( 0, 0, 255 )
screenGroup:insert( myText2 )

button = widget.newButton{
id = “singleplayer”,
left = 100,
top = 150,
default = “single player.png”,
over = “single player2.png”,
onEvent = onButtonRelease
}
screenGroup:insert( button )

button2 = widget.newButton{
id = “multiplayer”,
left = 100,
top = 150,
default = “multiplayer.png”,
over = “multiplayer2.png”,
onEvent = onButtonRelease2
}
screenGroup:insert( button2 )

button3 = widget.newButton{
id = “promode”,
left = 100,
top = 150,
default = “pro mode.png”,
over = “pro mode2.png”,
onEvent = onButtonRelease3
}
screenGroup:insert( button3 )

button4 = widget.newButton{
id = “twoballsmode”,
left = 100,
top = 150,
default = “two balls mode.png”,
over = “two balls mode2.png”,
onEvent = onButtonRelease4
}
screenGroup:insert( button4 )

button5 = widget.newButton{
id = “shop”,
left = 100,
top = 150,
default = “shop.png”,
over = “shop2.png”,
onEvent = onButtonRelease5
}
screenGroup:insert( button5 )

end

scene:addEventListener( “createScene”, scene )

return scene[/code]

sp.lua

[code]local storyboard = require “storyboard”
local scene = storyboard.newScene()
local widget = require “widget”
display.setStatusBar( display.HiddenStatusBar )

local background = display.newImage ( “uitlegbg.jpg” )

local myText = display.newText( “Single Player”, 0, 0, native.systemFont, 40 )
myText.x = display.contentCenterX
myText.y = display.contentWidth / 10
myText:setTextColor( 255, 0, 0 )

local myText = display.newRetinaText( “You have one ball and you have to keep the ball high as many times as you can”, 30, 70, 280, 220, native.systemFont, 22 )
myText:setTextColor( 255, 0, 0 )

local road = display.newImage( “roadklein.jpg” )
road.x = display.contentWidth / 5.5
road.y = display.contentWidth / 1.5

local beach = display.newImage( “beachklein.jpg” )
beach.x = display.contentWidth / 1.97
beach.y = display.contentWidth / 1.5

local house = display.newImage( “houseklein.jpg” )
house.x = display.contentWidth / 1.2
house.y = display.contentWidth / 1.5

local park = display.newImage( “parkklein.jpg” )
park.x = display.contentWidth / 3.3
park.y = display.contentWidth / 0.95

local stadium = display.newImage( “stadiumklein.jpg” )
stadium.x = display.contentWidth / 1.4
stadium.y = display.contentWidth / 0.95

local function goBack( event )
if event.phase == “release” then
storyboard.gotoScene(storyboard.getPrevious())
end
return true
end

local myButton = widget.newButton{
id = “btn001”,
left = 100,
top = 200,
default = “back.png”,
over = “back2.png”,
onEvent = goBack
}
group:insert( myButton )

local function Start( event )
if event.phase == “release” then
storyboard.gotoScene(“spstart”)
end
return true
end

local myButton2 = widget.newButton{
id = “btn002”,
left = 150,
top = 250,
default = “start.png”,
over = “start2.png”,
onEvent = Start
}
group:insert( myButton2 )[/code] [import]uid: 203192 topic_id: 34070 reply_id: 334070[/import]

Are you getting any messages in your terminal/console log?
[import]uid: 199310 topic_id: 34070 reply_id: 135516[/import]

on your widget.newButton codeyou left off the ( )
should be

[code]
local myButton = widget.newButton({
id = “btn001”,
left = 100,
top = 200,
default = “back.png”,
over = “back2.png”,
onEvent = goBack
})
group:insert( myButton ) [import]uid: 7911 topic_id: 34070 reply_id: 135523[/import]

**EDIT* [import]uid: 7911 topic_id: 34070 reply_id: 135526[/import]

I have a picture of the terminal/log. How can I send it to you? [import]uid: 203192 topic_id: 34070 reply_id: 135577[/import]

I have a picture of the terminal/log. How can I send it to you? [import]uid: 203192 topic_id: 34070 reply_id: 135578[/import]

Try adding your code to the Storyboard Template. I see you have a “createScene” but no “enterScene” , “exitScene” etc…
Also you must remove the menu.lua scene when you go to the sp.lua scene or you will get error.

storyboard.removeScene( “menu” ) [import]uid: 75779 topic_id: 34070 reply_id: 135587[/import]

I have never HAD to do storyboard.removeScene()
[import]uid: 7911 topic_id: 34070 reply_id: 135590[/import]

http://www.coronaforums.org/Thread-Am-I-doing-something-wrong

Here you can see my error [import]uid: 203192 topic_id: 34070 reply_id: 135592[/import]

Remove self from functions
Should be

local function onButtonRelease( event ) [import]uid: 7911 topic_id: 34070 reply_id: 135597[/import]

— [import]uid: 75779 topic_id: 34070 reply_id: 135586[/import]

Try replacing menu.lua with this
** EDIT** forgot to end for loop

[code]
local storyboard = require “storyboard”
local scene = storyboard.newScene()
local widget = require “widget”
display.setStatusBar( display.HiddenStatusBar )

local button, background, ball, white, myText, myText2
local buttons ={ scenes ={ “sp”,“mp”,“pm”,“tbm”,“s”},
images={{“single player.png”,“single player2.png”},
{“multiplayer.png”,“multiplayer2.png”},
{“pro mode.png”,“pro mode2.png”},
{“two ball mode.png”,“two ball mode2.png”},
{“shop.png”,“shop2.png”}}}

local function onButtonRelease( event )
local id = event.target.id
storyboard.gotoScene( buttons[id] )
end

function scene:createScene( event )
local screenGroup = self.view

background = display.newImage ( “SkySoccer Grass.jpg” )

ball = display.newImage( “SkySoccer Ball.gif” )
ball.x = display.contentWidth / 2
screenGroup:insert( ball )

white = display.newImage( “witteachtergrond.png” )
white.x = display.contentWidth / 1.3
white.y = display.contentWidth / 25
screenGroup:insert( white )

myText = display.newText( “SkySoccer”, 0, 0, native.systemFont, 50 )
myText.x = display.contentCenterX
myText.y = display.contentWidth / 4.5
myText:setTextColor( 255, 0, 0 )
screenGroup:insert( myText )

myText2 = display.newText( “BroekieNetwork”, 0, 0, native.systemFont, 20 )
myText2.x = display.contentWidth / 1.3
myText2.y = display.contentWidth / 25
myText2:setTextColor( 0, 0, 255 )
screenGroup:insert( myText2 )

For a = 1, #buttons.scenes do
button = widget.newButton({
id = a,
left = 100,
top = 150,
default = buttons.images[a][1],
over = buttons.images[a][2],
onEvent = onButtonRelease
})
screenGroup:insert( button )
end
end

scene:addEventListener( “createScene”, scene )

return scene [import]uid: 7911 topic_id: 34070 reply_id: 135607[/import]

Everything is working fine now. I’ve discovered the problem! Yeah :slight_smile: [import]uid: 203192 topic_id: 34070 reply_id: 135611[/import]

That’s great. Please share what you did so if someone in the future has a similar problem it may help them if they read this. [import]uid: 7911 topic_id: 34070 reply_id: 135625[/import]

It had to do with the event.phase
event.phase isn’t needed at all [import]uid: 203192 topic_id: 34070 reply_id: 135650[/import]

Are you getting any messages in your terminal/console log?
[import]uid: 199310 topic_id: 34070 reply_id: 135516[/import]

on your widget.newButton codeyou left off the ( )
should be

[code]
local myButton = widget.newButton({
id = “btn001”,
left = 100,
top = 200,
default = “back.png”,
over = “back2.png”,
onEvent = goBack
})
group:insert( myButton ) [import]uid: 7911 topic_id: 34070 reply_id: 135523[/import]

**EDIT* [import]uid: 7911 topic_id: 34070 reply_id: 135526[/import]

I have a picture of the terminal/log. How can I send it to you? [import]uid: 203192 topic_id: 34070 reply_id: 135577[/import]

I have a picture of the terminal/log. How can I send it to you? [import]uid: 203192 topic_id: 34070 reply_id: 135578[/import]