Okay you need a touch listener on the piano button that will send you to a function that calls the storyboard.gotoScene( “piano”, “fade”, 400 )
something like this:
[lua]function scene:createScene (event)
local group = self.view
– This is to display the button on the screen.
local pianoBtn = display.newImage( “button_piano.PNG”, 0, 0)
pianoBtn.x = display.contentWidth / 2
pianoBtn.y = display.contentWidth / 0.9
–Once the button is displayed, they need
–to ba clickable. When a user clicks on the button, it’ll send him to the
–next scene, which is a separate lua file.
end
function scene:enterScene (event)
local group = self.view
function changeScene()
storyboard.gotoScene( “piano”, “fade”, 400 )
end
pianoBtn:addEventListener(‘touch’, changScene)
–This space is for the code that should
–make the button clockable. Without it, the
–button will be useless.
end[/lua]
[import]uid: 75779 topic_id: 29725 reply_id: 119365[/import]