I’m using the corona sample business app, if you mean the code inside myapp, the code is
–to move to scene
local function onBtnPress( event )
if event.target.id == 1 then
storyboard.gotoScene ( “storyboard-” … event.target.id )
end
end
local composer = require( “composer” )
local scene = composer.newScene()
local widget = require( “widget” )
local widgetExtras = require(“widget-extras”)
local myApp = require( “myapp” )
widget.setTheme(myApp.theme)
local titleText
local locationtxt
local views = {}
local function ignoreTouch( event )
return true
end
function scene:create( event )
local sceneGroup = self.view
local background = display.newRect(0,0,display.contentWidth, display.contentHeight)
background:setFillColor( 0.95, 0.95, 0.95 )
background.x = display.contentCenterX
background.y = display.contentCenterY
sceneGroup:insert(background)
background:addEventListener(“touch”, ignoreTouch)
local navBar = widget.newNavigationBar({
title = “تجربة تطبيق اخباري”,
backgroundColor = { 0.5, 0.5, 0.5 },
titleColor = {1, 1, 1},
font = “HelveticaNeue”
})
sceneGroup:insert(navBar)
local button1 = widget.newButton({
id = “gen_scn”,
defaultFile = “gen_btn.png”,
overFile = “gen_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = -1,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen2
})
sceneGroup:insert(button1)
button1.x = display.contentCenterX + 110
button1.y = display.contentCenterY - 160
local button2 = widget.newButton({
id = “wed_scn”,
defaultFile = “wed_btn.png”,
overFile = “wed_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = -210,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen3
})
sceneGroup:insert(button2)
button2.x = display.contentCenterX - 1
button2.y = display.contentCenterY - 245
local button3 = widget.newButton({
id = “deth_scn”,
defaultFile = “deth_btn.png”,
overFile = “deth_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = -200,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen4
})
sceneGroup:insert(button3)
button3.x = display.contentCenterX + 110
button3.y = display.contentCenterY - 130
local button4 = widget.newButton({
id = “born_scn”,
defaultFile = “born_btn.png”,
overFile = “born_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = -360,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen5
})
sceneGroup:insert(button4)
button4.x = display.contentCenterX - 110
button4.y = display.contentCenterY - 320
local button5 = widget.newButton({
id = “relig_scn”,
defaultFile = “relig_btn.png”,
overFile = “relig_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = -160,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen6
})
sceneGroup:insert(button5)
button5.x = display.contentCenterX - 110
button5.y = display.contentCenterY - 110
local button6 = widget.newButton({
id = “women_scn”,
defaultFile = “women_btn.png”,
overFile = “women_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = -160,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen7
})
sceneGroup:insert(button6)
button6.x = display.contentCenterX - 1
button6.y = display.contentCenterY - 110
local button7 = widget.newButton({
id = “mix_scn”,
defaultFile = “mix_btn.png”,
overFile = “mix_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = -70,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen8
})
sceneGroup:insert(button7)
button7.x = display.contentCenterX + 110
button7.y = display.contentCenterY + 50
local button8 = widget.newButton({
id = “ads_scn”,
defaultFile = “ads_btn.png”,
overFile = “ads_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = -70,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen9
})
sceneGroup:insert(button8)
button8.x = display.contentCenterX - 3
button8.y = display.contentCenterY + 50
local button9 = widget.newButton({
id = “contact_scn”,
defaultFile = “contact_btn.png”,
overFile = “contact_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = 60,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen10
})
sceneGroup:insert(button9)
button9.x = display.contentCenterX - 110
button9.y = display.contentCenterY + 80
local button10 = widget.newButton({
id = “about_scn”,
defaultFile = “about_btn.png”,
overFile = “about_btn.png”,
width = 90,
height = 90,
label = “”,
labelColor = {
default = { 0.90, 0.60, 0.34 },
over = { 0.79, 0.48, 0.30 }
},
labelYOffset = 60,
font = myApp.font,
fontSize = 18,
emboss = false,
onRelease = myApp.showScreen11
})
sceneGroup:insert(button10)
button10.x = display.contentCenterX + 0
button10.y = display.contentCenterY + 185
end
function scene:show( event )
local sceneGroup = self.view
end
function scene:hide( event )
local sceneGroup = self.view
storyboard.gotoScene ( “storyboard-list”)
–
– Clean up native objects
–
end
function scene:destroy( event )
local sceneGroup = self.view
end
scene:addEventListener( “create”, scene )
scene:addEventListener( “show”, scene )
scene:addEventListener( “hide”, scene )
scene:addEventListener( “destroy”, scene )
return scene